Agent Circuit Breaker
A control that automatically stops an AI agent (or its calls to a failing dependency) when errors cross a threshold, instead of letting a broken agent flood a downstream system. Borrowed directly from distributed-systems and site-reliability practice, it 'trips' after a run of failures — halting new runs, shedding load, or routing to a Fallback — then allows cautious retries once the dependency recovers. It matters more for agents than for ordinary services because agents act in *loops* at machine speed: a non-deterministic agent that misreads an error can retry a doomed action thousands of times a minute, turning one bad step into an outage or a runaway bill. The circuit breaker caps the blast radius of a failure in time, complementing the kill switch (manual, immediate, total stop) and graceful degradation (what to do *instead* once tripped). A close cousin is the per-run step/tool budget that trips a stopping condition when an agent loops.
Example
A support agent's payment tool starts returning 500s. Without a circuit breaker the agent retries every failed refund in a tight loop, hammering the gateway and racking up API charges. With one, after 5 consecutive failures the breaker trips: new refund attempts are paused and queued, an alert fires, and the agent gracefully degrades to 'I've logged your refund for a human to process.' When the gateway recovers, the breaker half-opens and lets a trickle of calls through to confirm health before resuming.
Frequently asked questions
- How is a circuit breaker different from a retry?
- A retry attempts a failed action again, assuming the failure was transient; a circuit breaker does the opposite — it *stops* retrying once failures cluster, on the assumption that the dependency is genuinely down and more attempts will only make things worse. They work together: retry a few times with backoff, and if failures persist, trip the breaker so you don't retry into an outage. Both are pointless unless the underlying action is idempotent.
- Is a circuit breaker the same as a kill switch?
- No. A circuit breaker is automatic and scoped — it trips on error thresholds for a specific agent or dependency and can reset itself. An kill switch is manual, immediate, and total — a human stops the agent entirely, now, regardless of error rate. You want both: the breaker for the failures fast enough that no human could react in time, the kill switch for the judgment call that the agent has to stop for reasons a metric can't see.