Skip to content

CLI Command Reference

Global flags

FlagDescription
--api-keyGOVERN API key (overrides env/credentials)
--org-idOrganization ID
--outputOutput format: table (default), json, yaml
--quietSuppress non-essential output
--debugEnable debug logging
--configPath to CLI config file (default: ~/.govern/config.yaml)

govern assess

Assess one or more inference inputs against GOVERN policy.

Terminal window
govern assess [flags]

Flags

FlagRequiredDescription
--modelYesModel ID (e.g., claude-sonnet-4-20250514)
--promptYes*Inline prompt string
--prompt-fileYes*Path to JSON prompt file
--responseYes*Inline response string
--response-fileYes*Path to response text file
--batch-fileJSON file containing array of prompt/response pairs
--modeOverride mode: log, flag, block
--outputtable, json, yaml
--fail-on-flagExit code 1 if any assessment is flagged
--fail-on-blockExit code 1 if any assessment would be blocked

*Either --prompt/--response (inline) or --prompt-file/--response-file (file) required.

Examples

Terminal window
# Assess a single inference
govern assess \
--model claude-sonnet-4-20250514 \
--prompt "Summarize the Q3 report" \
--response "Q3 revenue was $4.2M, up 18% from Q2..."
# Output:
# Assessment: PASS
# Security: 0.01 ✓
# Bias: 0.00 ✓
# Accuracy: 0.87 ✓
# Drift: 0.03 ✓
# Cost: 0.05 ✓
# Assess from files
govern assess \
--model claude-sonnet-4-20250514 \
--prompt-file tests/prompt.json \
--response-file tests/response.txt \
--output json
# Batch assessment (CI mode)
govern assess \
--batch-file tests/govern/test-cases.json \
--fail-on-flag \
--output json

Batch file format

[
{
"id": "test-001",
"model": "claude-sonnet-4-20250514",
"prompt": [{"role": "user", "content": "What is 2+2?"}],
"response": "2+2 equals 4.",
"metadata": {"test_name": "basic-math"}
}
]

govern policy

Manage your organization’s governance policy.

Terminal window
govern policy <subcommand>

govern policy show

Terminal window
govern policy show
# Shows current policy: mode, thresholds, enabled scorers

govern policy set-mode

Terminal window
govern policy set-mode block
# Sets org-wide scoring mode to 'block'

govern policy set-threshold

Terminal window
govern policy set-threshold --scorer security --threshold 0.65

govern events

Query governance events from the audit trail.

Terminal window
govern events list [flags]
FlagDescription
--sinceStart time (e.g., 24h, 7d, 2026-04-01)
--actionFilter by action: pass, flag, block
--scorerFilter by scorer that triggered
--modelFilter by model
--limitMax events to return (default: 50)
Terminal window
# Last 24 hours of flags
govern events list --since 24h --action flag
# Exports as JSON
govern events list --since 7d --output json > events.json

govern probes

Manage and inspect connected Probe instances.

Terminal window
govern probes list
govern probes status <probe-id>
govern probes reset-drift <probe-id>
govern probes push-policy <probe-id>

govern auth

Authentication management.

Terminal window
govern auth login # Interactive browser login
govern auth logout # Remove stored credentials
govern auth status # Show current auth state
govern auth set-key KEY # Set API key directly

govern version

Terminal window
govern version
# govern version 1.2.0 (linux/amd64, commit abc123, built 2026-04-01)

Exit codes

CodeMeaning
0Success
1Assessment failure (with --fail-on-flag or --fail-on-block)
2Authentication error
3Invalid input
4Network error
5Policy error