CLI Reference
The PhronEdge CLI gives you governance controls directly from your terminal. Scan code, verify connections, export policies.
Install
The CLI installs automatically with the SDK. No separate package.
Commands
phronedge scan
Scan a Python file for tool functions and identify which ones are governed. Use this as a CI/CD gate to block deploys with ungoverned tools.
Output:
What it detects
The scanner uses static analysis to find tool functions:
- Functions with
@pe.govern("name")decorators (governed) - Functions with docstrings (likely tools)
- Functions with
@toolor similar framework decorators (likely tools) - Private functions (starting with
_) are skipped
Strict mode
Use --strict to exit with code 1 when ungoverned tools are found. Add this to your CI pipeline to block deploys:
CI/CD integration
GitHub Actions:
GitLab CI:
Pre-commit hook:
Multi-file scan
Scan all agent files:
Or with a glob:
phronedge verify
Verify your API key, gateway connection, and credential in one command. Run this after setup to confirm everything works.
Output:
What it checks
- 1.
PHRONEDGE_API_KEYis set - 2.Gateway is reachable (hits the public
/plansendpoint) - 3.Credential can be fetched with your API key
- 4.Credential is valid and contains agent info
Failure cases
phronedge export
Export your signed policy as OPA Rego, YAML, or JSON. Use this to deploy governance rules to external systems.
Save to file
Output:
OPA integration
Export and deploy directly to your OPA runtime:
Every rule in the exported Rego traces to a specific regulation from your signed credential. Nothing is hardcoded. The Rego file includes:
- Agent authorization (from
credential.agent_id) - Tool permissions (from
credential.permitted_tools) - Model permissions (from
credential.permitted_models) - Data classification enforcement (from
credential.data_classifications) - Jurisdiction validation (from
credential.jurisdiction) - PII detection patterns
- Cross-border transfer rules
- Behavioral baseline limits
- Delegation permissions
- Denial reasons with regulation citations
YAML export
Use YAML for GitOps workflows. Store your governance policy alongside your infrastructure:
JSON export
Use JSON for programmatic access or integration with custom policy engines:
Environment Variables
| Variable | Required | Description |
|---|---|---|
PHRONEDGE_API_KEY | Yes (for verify, export) | Your API key from the console |
PHRONEDGE_GATEWAY_URL | No | Override gateway URL. Default: https://api.phronedge.com/api/v1 |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure (ungoverned tools in strict mode, connection failed, export failed) |
Examples
Complete setup and verification
CI/CD pipeline with scan gate
Export policy for compliance audit
Next steps
- Quickstart - Get started in 2 minutes
- SDK Reference - Full Python API
- Framework Guides - 9 framework integrations
- REST API Reference - Every endpoint