Governance
Define and enforce safety policies, tool restrictions, and human-in-the-loop approval gates for your agents. Ensure AI behavior stays within boundaries.
What is Governance?
Governance policies are rules that control what agents can and cannot do. They are enforced automatically before every tool call and LLM interaction, ensuring your agents stay safe in production.
Create a Policy
Create Governance Policybash
curl -X POST http://localhost:8000/api/v1/governance/policies \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"name": "production-safety",
"agent_id": "AGENT_ID",
"rules": [
{ "type": "token_limit", "max_tokens_per_run": 5000 },
{ "type": "tool_restriction", "blocked_tools": ["file-delete", "email-send"] },
{ "type": "approval_gate", "requires_approval_for": ["dangerous"] },
{ "type": "content_filter", "block_patterns": ["credit card", "SSN"] }
],
"enabled": true
}'Policy Types
| Type | Description |
|---|---|
| token_limit | Max tokens per run to control costs and prevent runaway generations |
| tool_restriction | Block specific tools from being called |
| approval_gate | Require human approval before certain actions |
| content_filter | Block outputs containing sensitive patterns |
| escalation | Auto-escalate to a human agent under certain conditions |
Always add governance for production agents!
At minimum, set a token limit and block dangerous tools. This prevents unexpected costs and unsafe behavior.