Policy is a versioned document, not a setting.
Every decision records the exact policy version it was evaluated against. Change a limit and the record still tells you which rule was in force at the time.
A complete policy
Rules are evaluated in ascending priority; the first match wins. If nothing matches, the policy's default effect applies, and that default should be deny.
{
"name": "Agency refunds",
"default_effect": "deny",
"fail_mode": "closed",
"rules": [
{
"id": "spend-under-500",
"name": "Refunds under 500 USD",
"priority": 10,
"when": {
"tools": ["refund.create"],
"amount_usd_lte": 500,
"data_classes_not_in": ["health", "credentials"]
},
"effect": "allow",
"explanation": "Refunds under the automated ceiling are approved by policy."
},
{
"id": "large-refund",
"name": "Refunds above 500 USD",
"priority": 20,
"when": { "tools": ["refund.create"], "amount_usd_gt": 500 },
"effect": "deny",
"explanation": "Above the ceiling the action is denied. Nothing waits on a person."
}
]
}Condition keys
| Field | Type | Meaning |
|---|---|---|
| tools | string[] | Tool names, exact or globbed with *. |
| amount_usd_lte / _gt | number | Spend ceilings and floors. |
| data_classes_any / _not_in | string[] | Data class fences. |
| hour_outside {from,to} | object | UTC business hours, 0-23. |
| velocity {max,window_seconds} | object | Per-agent call cap inside a window. |
| risk_score_gte | number | Threshold against a caller-supplied score. |
| agent_ids | string[] | Restrict a rule to specific agents. |
Example library
Velocity cap
Stop a loop before it becomes an incident.
{
"id": "velocity-cap",
"priority": 5,
"when": { "tools": ["*.write"], "velocity": { "max": 60, "window_seconds": 600 } },
"effect": "deny",
"explanation": "More than 60 writes in ten minutes from one agent is denied."
}Business hours only
Time windows for actions that should not happen at 3am.
{
"id": "business-hours",
"priority": 30,
"when": { "tools": ["invoice.send"], "hour_outside": { "from": 8, "to": 18 } },
"effect": "deny",
"explanation": "Invoices are only sent during business hours (UTC)."
}Data class fence
Keep an agent away from the data it was never cleared for.
{
"id": "no-credentials",
"priority": 1,
"when": { "data_classes_any": ["credentials", "health"] },
"effect": "deny",
"explanation": "This agent is not cleared for credential or health data."
}Changing policy is itself an action
Publishing a policy version writes an audit event with the previous and new version, the actor, and the diff. Policies are authorized like anything else: a compromised admin session leaves a trail, and a version can be rolled back without erasing what happened under the old one.
