CRUD endpoints
POST /api/v1/policies/GET /api/v1/policies/GET /api/v1/policies/{policy_id}PUT /api/v1/policies/{policy_id}DELETE /api/v1/policies/{policy_id}
- Budgets:
run_budget,session_budget,action_budgets - Lists:
denied_actions,allowed_actions - Rate limits:
rate_limits - Scope:
scope(global/agent/run/group/mission) andtarget_id - Approvals:
require_approval,approval_actions,approval_tags,approval_risk_levels,approval_threshold_usd,approval_timeout_seconds,default_approvers,approval_rules - Evidence graph:
evidence_requirements,evidence_max_age_seconds,commit_actions,evidence_actions - Argument constraints:
argument_constraints(per-action JSON Schema),grounding_rules(field-level)
PUT creates a PolicyVersion snapshot — see Version history below.
Compile from prose / YAML / JSON
PolicyCreate-shaped dict (or structured errors). Prose and Markdown are routed through Gemini (gemini-2.5-flash); YAML/JSON skip the LLM and validate directly. Full reference: SDK → Prose policies.
Version history
EveryPUT /api/v1/policies/{policy_id} creates an immutable PolicyVersion snapshot with status active, archives the previous active version, and updates policy.current_version_id.
List versions
draft, in_review, active, archived.
Get a version
Review a version
draft or in_review version as reviewed by the caller.
Rollback to a version
policy_data from the chosen version back onto the policy, archives the current active version, and creates a new active PolicyVersion snapshot. The rollback is itself a versioned event in the history.
Policy exceptions
Time-bound or count-bound carve-outs that let specific agents/runs bypass a policy:GET /api/v1/policies/{policy_id}/exceptionsPOST /api/v1/policies/{policy_id}/exceptionsDELETE /api/v1/policies/{policy_id}/exceptions/{exception_id}
Policy sync (SDK)
Test alert
default_approvers to verify the channel works.
Simulate
See also
- SDK → Prose policies — natural-language authoring
- Console → Settings — version history + diff + rollback UI
- Console → Replay — simulate policies against past runs
