CLI Reference
The PhronEdge CLI is the developer and CI/CD surface for policy management, agent operations, and chain verification. It covers 11 commands across 4 command groups and 3 standalone commands.
All commands read PHRONEDGE_API_KEY and PHRONEDGE_GATEWAY_URL from environment variables.
Installation
The phronedge command is available after installation.
Command groups
| Group | Commands | Purpose |
|---|---|---|
policy | build, deploy, status | Sign policies, deploy credentials, show registry |
agent | list, quarantine, reinstate | Agent inventory and lifecycle |
chain | verify, events | Audit chain inspection |
| Standalone | verify, scan, export | Credential check, code scan, policy export |
Authentication
Set your API key once per shell:
For enterprise self-hosted deployments, point the CLI at your gateway:
policy
Sign, deploy, and inspect governance policies.
policy build
Sign a policy for review. Credentials are not issued. Use this for CI preview and pre-merge validation.
| Argument | Description |
|---|---|
file | Required. Path to policy.yaml or policy.json |
| Flag | Description |
|---|---|
-o, --output | Write the signed artifact to a file |
--json | Treat the input file as JSON instead of YAML |
Output:
policy deploy
Sign the policy and issue credentials. Agents become governable as soon as this completes.
| Argument | Description |
|---|---|
file | Required. Path to policy.yaml or policy.json |
| Flag | Description |
|---|---|
--json | Treat the input file as JSON instead of YAML |
Output:
What gets anchored:
POLICY_SIGNED(once per policy)AGENT_REGISTERED(once per agent)CREDENTIAL_ISSUED(once per agent)TOOL_REGISTERED(once per tool)
policy status
Show all signed policies, registered agents, and permitted tools under your tenant.
Output:
agent
Agent inventory and lifecycle management.
agent list
List every agent under the tenant with tier, tool count, and state.
Output:
Agent states:
| State | Meaning | Recoverable |
|---|---|---|
| ACTIVE | Normal operation. All checkpoints active. | N/A |
| QUARANTINED | All tool calls blocked. Credential preserved. | Yes, with phronedge agent reinstate |
| KILLED | Permanent termination. Credential revoked. Agent ID cannot be reused. | No |
agent quarantine
Suspend an agent. All tool calls are blocked immediately. Reversible.
| Argument | Description |
|---|---|
agent_id | Required. Agent to quarantine |
reason | Required. Incident reference or justification |
Anchors AGENT_QUARANTINED event to the chain with the reason and initiator.
agent reinstate
Restore a quarantined agent to active state. No-op on killed agents.
| Argument | Description |
|---|---|
agent_id | Required. Agent to reinstate |
reason | Required. Justification |
Anchors AGENT_REINSTATED event to the chain.
Kill switch is not available via CLI. Kill is permanent and irreversible. The Console at phronedge.com/brain is the only surface for killing an agent.
chain
Inspect and verify the audit chain.
chain verify
Recompute every event hash and confirm the chain is intact.
Output when chain is clean:
Output when chain is broken:
Exit codes:
| Code | Meaning |
|---|---|
| 0 | Chain valid |
| 1 | Break detected |
| 2 | Gateway unreachable |
chain events
Show the most recent events in the audit chain.
| Flag | Default | Description |
|---|---|---|
--limit | 50 | Number of events to return |
--agent | all | Filter by agent ID |
--type | all | Filter by event type |
Output:
export
Export the signed policy as deployable governance artifacts.
| Argument | Description |
|---|---|
format | Required. One of: rego, yaml, json |
| Flag | Description |
|---|---|
-o, --output | Write to file instead of stdout |
--agent | Agent ID to export. Without this, exports the first available credential |
OPA Rego export
The Rego bundle contains 9 enforcement rules that mirror the gateway checkpoints:
| Rule | Enforces |
|---|---|
agent_authorized | Agent is registered in the signed policy |
tool_permitted | Tool is in the agent's permitted_tools |
data_classification_valid | Agent clearance meets or exceeds tool data class |
jurisdiction_valid | Call jurisdiction is in the tool's allowed list |
tier_sufficient | Agent tier meets tool minimum tier |
within_baseline | Call rate is within behavioral baseline |
model_allowed | Model is in the permitted_models list |
delegation_valid | Delegation target is in can_delegate_to |
human_oversight | Human approval is satisfied where required |
Drop the Rego into any OPA runtime for independent enforcement outside PhronEdge.
Why export
- Version control. Commit
policy.yamlto git. Review policy changes in pull requests. - Independent enforcement. Load
policy.regointo an OPA instance on your infrastructure. - Regulatory audit. Hand
policy.jsonto an auditor. Hash of the artifact is anchored in the chain. - Disaster recovery. Re-import a signed policy if your local state is lost.
Standalone commands
phronedge verify
Verify that a specific agent's credential is live and signed correctly.
| Flag | Description |
|---|---|
--agent | Agent ID to verify. Without this, verifies the first available credential |
Output:
Exit codes:
| Code | Meaning |
|---|---|
| 0 | Credential valid |
| 1 | Authentication or credential fetch failed |
phronedge scan
Parse a Python file and report which tools are governed with @pe.govern() and which are not.
| Argument | Description |
|---|---|
file | Required. Python file (or glob) to scan |
| Flag | Description |
|---|---|
--strict | Exit with code 1 if any ungoverned tools are found. Use in CI. |
Output:
How scan works:
The scanner parses the file as an AST. It flags functions that have a @tool decorator (from LangChain, CrewAI, OpenAI Agents, etc.) or a clear docstring signature, and checks for a @pe.govern() decorator on the same function. Functions starting with _ (private) are skipped.
CI/CD integration
A complete governance CI pipeline:
What this proves:
- 1.Every policy change goes through version control.
- 2.No policy deploys without pull request approval.
- 3.Every deployment is auditable (git commit plus chain event).
- 4.The audit trail is tamper-evident (chain verify in CI).
- 5.The OPA rules are independently verifiable (Rego artifact in repo).
Global flags
| Flag | Description |
|---|---|
-h, --help | Show command help. Available on every command and subcommand. |
Environment variables
| Variable | Required | Description |
|---|---|---|
PHRONEDGE_API_KEY | Yes | API key starting with pe_live_ |
PHRONEDGE_GATEWAY_URL | No | Gateway URL. Defaults to https://api.phronedge.com/api/v1 |
PHRONEDGE_AGENT_ID | No | Default agent for verify, export, and lifecycle commands |
Next steps
- Quickstart. End-to-end example
- SDK reference. Python API for runtime governance
- REST API reference. HTTP endpoints for non-Python clients
- Console guide. Visual Policy Builder and Observer
- Enterprise deployment. Self-hosted CLI with your gateway