SDK Reference
PhronEdge()
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | PHRONEDGE_API_KEY env var | Your API key from the console |
gateway_url | str | api.phronedge.com/api/v1 | Gateway endpoint |
timeout | int | 30 | Request timeout in seconds |
raise_on_block | bool | False | Raise exception instead of returning block info |
Example
@pe.govern(tool_name)
Decorator that wraps a function with constitutional governance. Every call is intercepted, validated against 7 checkpoints, and either allowed or blocked before the function body executes.
Parameters
| Parameter | Type | Description |
|---|---|---|
tool_name | str | Must match a tool in the signed policy's permitted_tools |
Behavior
- Allowed: Returns the original function's return value. The function executes normally.
- Blocked (
raise_on_block=False): Returns a dict with block details. - Blocked (
raise_on_block=True): RaisesGovernanceError.
Block response format
Example: multiple tools
GovernanceError
Raised when a tool call is blocked and raise_on_block=True.
pe.scan(path)
Scan agent code for governance vulnerabilities before deployment.
pe.status(agent_id)
Check real-time governance status of a deployed agent.
pe.export(format)
Export the active policy from your credential.
Data classifications
Agents are credentialed with specific data clearance levels:
| Level | Code | Description |
|---|---|---|
| Public | PUB | No restrictions |
| Internal | INT | Company internal data |
| Confidential | CONF | Sensitive business data |
| Personal | PII | Personally identifiable information |
| Health | PII_HEALTH | Protected health information |
| Financial | PII_FINANCIAL | Financial records, payment data |
| Restricted | RESTRICTED | Maximum classification |
An agent with INT clearance cannot access PII_HEALTH data. The gateway blocks it at the Data Classification checkpoint.
Agent tiers
| Tier | Description | Typical use |
|---|---|---|
| T0 | Read-only, public data | Report generators, summary agents |
| T1 | Single-domain access | Medical reviewer, financial auditor |
| T2 | Multi-domain access | Cross-functional analysts |
| T3 | Orchestrator, can delegate | Lead agents, pipeline coordinators |
Environment variables
| Variable | Required | Description |
|---|---|---|
PHRONEDGE_API_KEY | Yes | API key from the console |
PHRONEDGE_GATEWAY_URL | No | Override gateway URL |