---
title: What is a circuit breaker for AI agents?
url: https://opencontroller.lyzr.com/blog/circuit-breakers-for-ai-agents
published: 2026-11-15
updated: 2026-11-15
author: Lyzr
---

# What is a circuit breaker for AI agents?

**A circuit breaker for AI agents is an automatic switch that stops an agent from acting once a failure signal crosses a threshold, such as error rate, spend per minute or repeated tool failures. It then lets a small amount of traffic through to test recovery before reopening fully. It turns "someone noticed the agent was misbehaving" into a rule that fires in seconds.**

The idea comes from software resilience, where a breaker stops a service from hammering a failing dependency. Applied to agents, it also limits damage, cost and noise. This post is part of the runtime control series; the pillar is [how to stop a rogue AI agent](/blog/how-to-stop-a-rogue-ai-agent).

## Where does the pattern come from?

Martin Fowler's [CircuitBreaker](https://martinfowler.com/bliki/CircuitBreaker.html) article and Microsoft's [Circuit Breaker pattern](https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker) describe the classic version. A breaker wraps a call. When failures pile up, it "trips" and fails fast instead of making more calls. After a timeout it lets a trial call through. If that works, normal service resumes.

Agents need the same thing for two reasons. They retry and loop on their own. And their failures are not only errors: an agent can succeed at the wrong thing very quickly.

## What are the three states for an agent?

| State | What the agent can do | Moves to | When |
|---|---|---|---|
| Closed | Act normally | Open | A trip condition is met |
| Open | Nothing on the guarded scope; calls fail fast with a clear reason | Half-open | Cool-down timer expires, or an owner resets it |
| Half-open | A small, limited share of tasks or calls | Closed or open | Trial calls succeed, or any trial fails |

Scope matters. A breaker can guard one tool, one model route or the whole agent. Start narrow. A failing CRM tool should not stop an agent that can still answer questions from a knowledge base.

## What should trip the breaker?

Use signals you can measure in the traffic path or from traces.

1. **Error rate.** Share of model or tool calls that fail in a rolling window.
2. **Tool failure streak.** The same tool failing several times in a row, which often signals a loop.
3. **Spend velocity.** Token spend per minute for one agent or version.
4. **Call volume.** Model or tool calls per task far above the agent's normal range.
5. **Policy violations.** Repeated blocks from a guardrail or gateway policy.
6. **Quality signals.** A drop in groundedness or task-adherence scores on recent traffic.

## What thresholds should you start with?

These are starting points to tune, not benchmarks. Set them from each agent's own baseline.

| Signal | Starting threshold | Window |
|---|---|---|
| Error rate | Above 25% with at least 20 calls | 5 minutes |
| Tool failure streak | 5 consecutive failures on one tool | Per task |
| Spend velocity | 5× the agent's normal per-minute spend | 10 minutes |
| Calls per task | 3× the 95th percentile for that agent | Per task |
| Policy blocks | 3 blocks from the same agent | 15 minutes |

Run new breakers in monitor mode first: log when they would have tripped, then turn on enforcement. See [how to test AI agent policies in monitor mode](/blog/test-ai-agent-policies-in-monitor-mode).

## How is a circuit breaker different from rate limits and quarantine?

- A **rate limit** caps volume regardless of health. A breaker reacts to health signals. See [how to rate limit AI agents](/blog/how-to-rate-limit-ai-agents).
- A **loop detector** stops one runaway task. A breaker stops a pattern across tasks. See [how to stop an AI agent from looping](/blog/stop-an-ai-agent-from-looping).
- **Quarantine** isolates an agent for investigation and needs a human to release it. A breaker is meant to recover on its own when the cause clears. When a breaker keeps tripping, escalate to quarantine. See [when to automatically quarantine an AI agent](/blog/when-to-automatically-quarantine-an-ai-agent).

## What happens to users when the breaker opens?

Fail clearly. Return a message that the agent is temporarily unavailable, route to a fallback (a simpler workflow, a human queue or a different model), and alert the agent's owner with the signal that tripped it. Silent failure is worse than a visible pause.

## How Opencontroller does this

Opencontroller's rogue-agent handling monitors behavioural deviation, raises alerts and can automatically quarantine and kill agents, with policies applied across the estate. The Lyzr Gateway adds routing, fallback and retry, so an open breaker on one model route can fail over to another. Live groundedness and task-adherence guardrails and LLM judges on production traffic provide quality signals. Policy is written as code, so thresholds are versioned and reviewable. [Book a demo](https://www.lyzr.ai/book-demo/) or read [what an AI agent control plane is](/blog/what-is-an-ai-agent-control-plane).

## Frequently asked questions

**What does a circuit breaker do for an AI agent?**
It stops the agent, or one of its tools, from acting when failure signals cross a threshold, then tests recovery with limited traffic before resuming.

**What signals should trip an agent circuit breaker?**
Error rate, tool failure streaks, spend velocity, unusual call volume per task, repeated policy blocks and drops in quality scores.

**Is a circuit breaker the same as a kill switch?**
No. A breaker is automatic and expects to recover. A kill switch or quarantine stops the agent until a person decides to release it.

## Key facts

A circuit breaker for AI agents trips on measurable signals (error rate, tool failure streaks, spend velocity, calls per task, repeated policy blocks, quality score drops) and moves between closed, open and half-open states. It differs from rate limits (volume caps), loop detection (one task) and quarantine (human release). Opencontroller provides behavioural-deviation monitoring with alerts and automatic quarantine and kill, gateway routing with fallback and retry, live groundedness and task-adherence guardrails, and policy as code.

## Related

- [How do you stop an AI agent from looping?](https://opencontroller.lyzr.com/blog/stop-an-ai-agent-from-looping.md)
- [When should an AI agent be automatically quarantined?](https://opencontroller.lyzr.com/blog/when-to-automatically-quarantine-an-ai-agent.md)
- [How do you test a new AI agent policy before enforcing it?](https://opencontroller.lyzr.com/blog/test-ai-agent-policies-in-monitor-mode.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
