Pattern · Agents
Budgets and kill switches
Cap steps, tokens, time and money per task, user and day, and let an operator stop any agent instantly.
Say it in the interview
I would put budgets at three levels, task, user and day, in a shared store, with a kill switch an operator can flip without a deploy, and the provider limit only as a backstop.
When to use it
- Any agent in production
- Agents that can loop or call paid APIs
How it works
- Every task → Caps (steps, tokens, time)
- Every tool call → Checks (kill switch, repeated calls)
- Every day → Spend caps (per user, per feature, alert at 75%)
- Caps (steps, tokens, time) → Shared store
- Checks (kill switch, repeated calls) → Shared store
- Spend caps (per user, per feature, alert at 75%) → Shared store
- Shared store → Provider spend limit (the backstop)
Trade-offs
- Prevents runaway bills and loops
- Caps can stop a legitimate long task
Pitfalls interviewers probe
- Only a provider limit, which stops everyone at once
- Kill switch that needs a deploy