/api/policies) matches requests on criteria you define and applies an
effect. Unlike budgets, guardrails aren’t about spend — they’re about which requests are
allowed to happen at all.
Fields
The effects
deny— the request is blocked with403before dispatch. No provider call, no charge.flag— the request proceeds normally. The match is recorded in the decision log for visibility, with no effect on the response.require_approval— not available yet. The intent is that the request is blocked with403, an approval request opens against the effect’s approval policy, and the caller retries once it’s granted. What isn’t settled is the grant itself: what an approval records so the retry passes. Until an ADR specifies that, authoring the policy returns422rather than leaving you with a rule that denies forever and reports “approval required”.
Testing before you enforce
Two ways to see what a policy would do before it can block real traffic:- Set
enforcement: "shadow"on the policy itself — it evaluates on every real request and logs the decision, but never denies or gates one. POST /api/policies/{id}/shadow-impact— run a policy against recent traffic on demand to see its hit rate before flipping it toenforce.
POST /api/policies/lint validates a policy’s match/conditionCel without creating it —
useful for catching a malformed CEL expression before it ever reaches the database.
Where next
Approvals & automation
Approval chains for budget increases and key unpauses, and how to build one.
Routing
Reroute a model instead of denying the request outright.