Skip to main content
Prevent cascading failures by opening a circuit breaker after 5 consecutive LLM provider failures. The circuit stays open for 30 seconds, then enters a half-open state allowing one test request before fully closing.

Policy JSON

What It Does

  • Counts consecutive failures to the LLM provider (timeouts, 5xx errors, rate limits)
  • Opens the circuit after 5 failures — all subsequent requests are immediately denied without calling the provider
  • Resets after 30 seconds into a half-open state, allowing 1 test request through
  • Closes the circuit if the test request succeeds; re-opens if it fails
  • Prevents wasted API calls and latency during provider outages

Example

6th consecutive request to a failing provider: Decision object:

Install

Customize

For high-traffic agents, lower failure_threshold to 3 to trip faster. For batch processing agents where occasional failures are expected, raise it to 10.