The Authensor CLI (npx authensor) is a command-line tool for managing policies, querying receipts, running the MCP gateway, and interacting with the control plane. This is the full command reference.
The CLI is included in the @authensor/cli package:
pnpm add -g @authensor/cli
# or run without installing:
npx authensor <command>
authensor policy lint <file>Validate a YAML policy file. Checks for syntax errors, unreachable rules, missing reasons on escalation rules, and invalid regex patterns.
npx authensor policy lint ./policy.yaml
authensor policy test <file> --input <json>Test a policy against a specific tool call:
npx authensor policy test ./policy.yaml \
--input '{"tool": "shell.execute", "args": {"command": "rm -rf /"}}'
# Output: BLOCK - "Destructive shell commands are blocked"
authensor policy diff <file1> <file2>Show the differences between two policy files:
npx authensor policy diff ./old-policy.yaml ./new-policy.yaml
authensor receipts listList recent receipts from the control plane:
npx authensor receipts list --limit 20
npx authensor receipts list --action block --since 24h
npx authensor receipts list --session sess_abc123
authensor receipts verifyVerify the integrity of a receipt chain:
npx authensor receipts verify --session sess_abc123
Returns exit code 0 if the chain is intact, 1 if tampering is detected.
authensor mcp-gatewayStart the MCP gateway:
npx authensor mcp-gateway --config ./mcp-gateway.yaml
npx authensor mcp-gateway --policy ./policy.yaml --transport stdio
authensor initInitialize a new Authensor project with a default policy and configuration:
npx authensor init
authensor statusCheck the connection to the control plane:
npx authensor status --endpoint http://localhost:3000
| Flag | Description |
|------|-------------|
| --config <path> | Path to configuration file |
| --endpoint <url> | Control plane URL |
| --api-key <key> | API key for authentication |
| --format <json\|table> | Output format |
| --verbose | Enable debug logging |
The CLI reads these environment variables:
AUTHENSOR_ENDPOINT: Control plane URLAUTHENSOR_API_KEY: API keyAUTHENSOR_CONFIG: Path to configuration fileExplore more guides on AI agent safety, prompt injection, and building secure systems.
View All Guides