Give your agent a kill switch before it needs one

Put explicit limits, timeouts, and circuit breakers around the agent, and a bad run stops itself instead of running up a bill or an incident. Leave them out and there is nothing between a loop and your production systems.

B

Balagei G Nagarajan

3 MIN READ


A circuit breaker halting a runaway agent before it reaches production systems
Set a step budget and a wall-clock timeout so a run cannot continue forever.
— from “Give your agent a kill switch before it needs one”

Key facts.

  • "Expensively Quadratic" documents agent context and cost growing quadratically with steps, so an unbounded run becomes an unbounded bill without hard limits. source
  • ToolEmu finds agents take risky and irreversible actions in high-stakes scenarios, the case a circuit breaker on consequential actions exists to stop. source

Why does an agent need explicit limits?

Agent cost grows quadratically with steps, so an unbounded loop is an unbounded bill; a better model just loops cheaper, not bounded. (arXiv:2309.15817)

A traditional service fails in bounded ways: it errors, times out, returns. An agent can fail in unbounded ones. It can loop, retrying a step that will never succeed; it can wander, taking action after action toward a goal it misread; it can escalate, each step committing to a wrong path. Without explicit limits there is nothing to stop any of these and two costs run away at once. The Expensively Quadratic effect means a long run gets disproportionately expensive as history accumulates, so a stuck agent is also a financial event. And ToolEmu shows the actions themselves can be irreversible, so an unbounded agent is not just wasting money, it may be doing damage you cannot undo.

The fix is standard reliability engineering applied to a new kind of system. Set a step budget and a wall-clock timeout so a run cannot continue forever. Set a spend cap so cost cannot run away. Put a circuit breaker in front of consequential or irreversible actions, so they require a check or a human rather than firing automatically. And design a graceful degradation path, so when a limit trips the agent falls back to a safe state instead of crashing mid-action. These are not exotic; they are the seatbelts that should be standard, installed before the crash rather than after.

A circuit breaker pattern with step budget, timeout, spend cap, and action gate around an agent

What limits belong around a production agent?

ControlWithout itWith it
Step/time budgetLoops foreverHalts at the limit
Spend capRunaway billCost bounded
Action circuit breakerIrreversible action firesGated or escalated
Degradation pathCrashes mid-actionFalls back safely

Knowing which actions need a circuit breaker means knowing which carry consequence, a pattern-level judgment the Pattern Intelligence Layer makes explicit. VibeModel distinguishes the routine patterns that can run freely from the consequential ones that need a gate, so the limits land where they matter and a bad run stops itself before it becomes a bill or an incident rather than after.

Frequently asked questions

Aren't limits just for cost?
No. They also stop irreversible actions. ToolEmu shows agents take risky, irreversible steps, so a circuit breaker on consequential actions is a safety control, not only a budget one.

Why does an agent run away in cost?
Context and cost grow quadratically with steps, so a stuck or looping agent gets disproportionately expensive fast. A spend cap and step budget bound it.

Where should the circuit breaker sit?
In front of consequential or irreversible actions, so they require a check or a human rather than firing automatically.


Share this post

Join the discussion

Have a take, a war story, or a question? Sign in with GitHub to comment and react. Comments are powered by GitHub Discussions, ad-free and yours to moderate.

Continue Reading

Find where your agent breaks, before you build it

Faultmap maps where your agent will fail from the goal and your data, then hands you the first test suite it has to pass.