CLI Command Reference
Global flags
| Flag | Description |
|---|---|
--api-key | GOVERN API key (overrides env/credentials) |
--org-id | Organization ID |
--output | Output format: table (default), json, yaml |
--quiet | Suppress non-essential output |
--debug | Enable debug logging |
--config | Path to CLI config file (default: ~/.govern/config.yaml) |
govern assess
Assess one or more inference inputs against GOVERN policy.
govern assess [flags]Flags
| Flag | Required | Description |
|---|---|---|
--model | Yes | Model ID (e.g., claude-sonnet-4-20250514) |
--prompt | Yes* | Inline prompt string |
--prompt-file | Yes* | Path to JSON prompt file |
--response | Yes* | Inline response string |
--response-file | Yes* | Path to response text file |
--batch-file | JSON file containing array of prompt/response pairs | |
--mode | Override mode: log, flag, block | |
--output | table, json, yaml | |
--fail-on-flag | Exit code 1 if any assessment is flagged | |
--fail-on-block | Exit code 1 if any assessment would be blocked |
*Either --prompt/--response (inline) or --prompt-file/--response-file (file) required.
Examples
# Assess a single inferencegovern 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 filesgovern 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 jsonBatch 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.
govern policy <subcommand>govern policy show
govern policy show# Shows current policy: mode, thresholds, enabled scorersgovern policy set-mode
govern policy set-mode block# Sets org-wide scoring mode to 'block'govern policy set-threshold
govern policy set-threshold --scorer security --threshold 0.65govern events
Query governance events from the audit trail.
govern events list [flags]| Flag | Description |
|---|---|
--since | Start time (e.g., 24h, 7d, 2026-04-01) |
--action | Filter by action: pass, flag, block |
--scorer | Filter by scorer that triggered |
--model | Filter by model |
--limit | Max events to return (default: 50) |
# Last 24 hours of flagsgovern events list --since 24h --action flag
# Exports as JSONgovern events list --since 7d --output json > events.jsongovern probes
Manage and inspect connected Probe instances.
govern probes listgovern probes status <probe-id>govern probes reset-drift <probe-id>govern probes push-policy <probe-id>govern auth
Authentication management.
govern auth login # Interactive browser logingovern auth logout # Remove stored credentialsgovern auth status # Show current auth stategovern auth set-key KEY # Set API key directlygovern version
govern version# govern version 1.2.0 (linux/amd64, commit abc123, built 2026-04-01)Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Assessment failure (with --fail-on-flag or --fail-on-block) |
| 2 | Authentication error |
| 3 | Invalid input |
| 4 | Network error |
| 5 | Policy error |