Budgets and policies
A policy is a rule Guardrail checks before every request. Tracking tells you what happened; a policy is what makes it stop.
Where they live
Open protections in the dashboard at localhost:4000. Policies live in your local database and take effect immediately — no restart, and nothing to change in the tool you connected.
What you can cap
| Limit | Catches |
|---|---|
| Maximum estimated spend per session | The long session that quietly gets expensive |
| Maximum requests per session | A loop that keeps calling with small payloads |
| Maximum tokens per session | Context that grows every turn |
| Requests per minute | A runaway retry, early |
| Model denylist | An expensive model reached from the wrong project |
Block or warn
Each policy either blocks or warns. A warn records the breach and shows it in the dashboard while letting the call through, which is the honest way to find the right number before enforcing it. A block refuses the request.
What your tool sees when it blocks
Guardrail answers with a provider-shaped 429carrying the reason, and never contacts the provider. Coding agents and agent frameworks already handle rate-limit errors, so this surfaces as an ordinary error rather than a crash — and because the call was never sent, it costs nothing.
HTTP/1.1 429 Too Many Requests
{
"type": "error",
"error": {
"type": "guardrail_budget_exceeded",
"message": "Guardrail blocked this session because it exceeded the configured budget."
}
}Why caps are per session
A session is how the tools already group work: one Claude Code conversation is one session. Capping there bounds a unit of work rather than your whole month, and stops a single runaway session from exhausting a budget everything else shares.
Team caps
On a Team plan an admin sets shared caps per project in the hosted console. Those are pushed to every member’s machine and enforced locally, so they keep working even offline. See plans and billing.
Costs are estimates.A spend cap fires on Guardrail’s estimate, computed from a price table and labelled with a confidence level. It tracks provider billing closely, but set your cap with a little headroom rather than to the cent.