01 / REQUEST FLOW
Volatile-memory request inspection
HTTP/2 · SSE
[ GATEWAY SPECIFICATION // REV-2026 ]
A drop-in reverse proxy that catches infinite tool loops and enforces hard spend caps in volatile RAM. Sub-35ms overhead. Zero payload retention.
TRY LIVE IN YOUR TERMINALcurl -I https://circuit-breaker-api.onrender.com/health
Frankfurt (eu-central-1) — 32ms proxy latency — HTTP/2 SSE active
gateway // request traceeu-central-1
12:08:41.018 POST /v1/chat/completions
12:08:41.021 window scan: prompt hash match 1/3
12:08:41.024 spend check: within configured cap
HTTP/2 200 · upstream response passed
Simulated trace · example values
CLIENT CONFIGURATION
ARCHITECTURE // REQUEST PATH
01 / REQUEST FLOW
HTTP/2 · SSE
02 / BLOCK RESPONSE
{
"error": {
"message": "Request blocked by Circuit Breaker",
"type": "circuit_breaker_loop_detected",
"code": "infinite_loop_killed"
}
}03 / VOLATILE MEMORY
<15ms
memory execution target
FingerprintSHA-256
Prompt disk writes0
Payload storageNone
04 / MICRO-DOLLAR ACCOUNTING
429 BUDGET_LIMIT_BREACHED
Requests are checked against hourly and daily account caps before they are sent upstream. The bars below illustrate cap windows, not live account utilization.
Hourly ceiling$2.00 / hour
CAP THRESHOLD · USAGE NOT SHOWN
Daily ceiling$10.00 / day
CAP THRESHOLD · USAGE NOT SHOWN
Performance figures are engineering targets and depend on deployment, network conditions, and request profile.
FAILURE ANALYSIS // ILLUSTRATIVE SCENARIO
SQL RETRY LOOP
An unhandled SQL error leaves an agent retrying the same tool call at 120 attempts per minute. In this example, the sliding deque recognizes the repeat at attempt three and interrupts the cycle before the remaining requests are sent.
The $680+ / 45-minute cost is a modeled scenario, not measured customer spend. Estimated avoided spend assumes $35 per intercepted incident.
01 · 00:00
SQL write fails
Agent receives retryable error.
02 · 00:01
Retry cadence begins
Unchanged tool plan repeats at 120/min.
03 · 00:02
Attempt #3 detected
Prompt fingerprint crosses repeat threshold.
04 · 00:02+
Loop halted
$680+ illustrative exposure avoided.

Built by Roan de Jager (@roandejager) in Norway.
I built Circuit Breaker after an autonomous agent got trapped in a recursive tool retry loop and burned through hundreds of dollars in API credits overnight. It's built in Python and FastAPI for sub-35ms raw performance with strict zero-payload retention.