Circuit Breakers for Agent Tools
In this article
- Explain how retries that are each reasonable on their own can add up to a retry storm against a service that is down.
- Replay a list of calls through a circuit breaker and say, for each one, whether it is sent, rejected or used as a probe, and what the caller gets back.
- Sort errors into those a breaker counts as failures (timeouts, 5xx such as a 529) and those it ignores (a 400 caller error, a 429 rate signal).
- Pick a fallback in advance that is safe: a stale read clearly marked, or an explicit "not done", never a guessed write.
- Terms defined here: retry storm, circuit breaker.
Overview
Your support agent is an AI model that acts by calling tools, ordinary functions such as get_order, which reads an order from the order service. That service has gone down. Every request that needs it still waits for its timeout, retries, waits again and fails. Each retry was a sensible choice on its own. Together they keep hammering a service that cannot answer, and they tie up your own workers while they wait.
The fix is to stop asking for a while once failures pile up, answer callers at once with something safe, and test carefully whether the service is back. You will configure that switch for one tool, replay calls through it by hand, and choose what callers get while it is off.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- When retries make it worse
- Three states
- Tripping on a count
- What counts as a failure
- What the caller gets
- Coming back
- One breaker per dependency
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions