Skip to main content
A guardrail policy (/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.
require_approval is not available yet. Creating a policy with that effect returns 422. The effect is defined in the schema, but the mechanism that lets an approved request through on retry is still pending an ADR — shipping it without that would make require_approval a permanent deny wearing the wrong name. Use deny or flag today.

Fields

The effects

  • deny — the request is blocked with 403 before 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 with 403, 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 returns 422 rather 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 to enforce.
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.