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)
Server-side decision
decide() is the single source of
truth for whether an action proceeds; the SDK’s local policy cache and the
/approvals/check pre-flight endpoint below are both advisory shortcuts on
top of it, never the enforcement point itself.
Returns a Decision:
outcome is one of allow, deny, require_approval. Evaluation runs in
a fixed order and stops at the first match:
- Kill switch — an active kill switch on the caller’s agent denies
unconditionally (
kill_switch_active), before any policy is consulted. - Denied list — the action is in a covering policy’s
denied_actions(denied_action). - Allowed list — a covering policy sets a non-empty
allowed_actionsand the action isn’t on it (not_in_allowed_actions). Being on the list only clears this gate; it does not by itself produceallowfor a write (see the default below). - Approval rules — a covering policy has
require_approvalset and the action matches onapproval_actions,approval_tags,approval_risk_levels,approval_threshold_usd, or a complexapproval_rulesentry (policy_requires_approval). - Action budget — the estimated cost for this single call exceeds the
policy’s per-action cap in
action_budgets(action_budget_exceeded). - Default — with no covering policy (or no earlier step matched):
deny (
no_policy_for_write) whenimpact >= medium, allow (advisory_read) otherwise. This is fail-closed: an org with no policy at all still can’t let its agents perform unreviewed writes, and adenyfrom any earlier step can never be downgraded torequire_approval— the steps run in order and stop at the first match, so a harddenyis always final.
decide() is resolved from the caller’s principal (their
organization, or their own directly-owned policies, plus the agent id on
the request) — global, agent, and group scoped policies apply; run-
and mission-scoped policies are out of reach here since decide() takes
no run or mission id.
Approval pre-flight check (SDK)
decide(). Reports {"requires_approval": true, ...}
only for the require_approval outcome; an outright allow or deny from
decide() both report {"requires_approval": false} since this endpoint’s
response shape has no field for denial — actual enforcement of a deny
happens at other checkpoints (e.g. ingest’s kill-switch check).
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
