Multi-detector loop detection
Detect Reasoning Loops Before They Burn Your Budget
Runaway AI agents rapidly consume API credits through loops and inefficient retries.
Open-source detection system with 6 production detectors and 2 more in development - from embedding similarity and exact token repeats to information theory. Runs on Supabase free tier.
Real stories from the community
"My AI agent built a runaway retry loop that cost me over $700 in a single night"
"$30,000 in an agent loop implementing a financial circuit breaker"
"$1,400 in 6 hours because an AI agent kept retrying"
"Agent runaway burnt all monthly credits in hours"
Why built-ins don't save you:
01 / Detection methods
Science Based Detection Methods
From embedding similarity and exact repeats to information theory
Semantic Similarity
Embedding-based cosine similarity. Catches paraphrased repetition and semantic attractors - circular reasoning in vector space.
Token Repeat
Exact repeated token spans, within a response and across steps. The verbatim loop Antidoom targets at training time, caught here at runtime.
Action Cycles
Detects when agents call the same tools repeatedly: search→search→search. Implements state machine reasoning's Stop signal.
N-gram Overlap
Fast text pattern matching using DeRep's 20-pattern repetition taxonomy. Catches repeated phrases before embeddings notice.
Compression (NCD)
Information-theoretic similarity via Normalized Compression Distance. Derived from Kolmogorov complexity - zero API cost.
Edit Distance Decay
Directly implements the Mirror Loop paper's delta_I metric. A 55% edit distance decline signals an agent converging on a fixed point.
CUSUM Drift
Cumulative embedding drift detection. 89% of Long-CoT failures show prefix-dominant deadlocks - CUSUM catches the trajectory early.
Entropy Collapse
Text-level vocabulary diversity monitoring. When output vocabulary collapses across steps, the loop has set in.
Verifier Models
GPT-4 audit for critical agents. Full semantic understanding as a last-resort check for high-stakes pipelines.
02 / Live demo
See It In Action
A real agent loop detected and halted in the terminal

03 / In the wild
Doom Loops Happen in Your Editor
A coding agent stuck repeating the same constraint. Every step re-billed, no progress.
OpenCode AI assistant in a doom loop
Recorded from a real agent session. InferenceBrake halts this at the first repeat, not the hundredth.
04 / Integration
Integrate in Minutes
Add loop detection to any agent in 3 lines of code
from inferencebrake import InferenceBrake
guard = InferenceBrake(api_key="ib_key")
for step in agent.run():
status = guard.check(step.reasoning, session_id="agent-1")
if status.should_stop:
print("Loop detected!")
break05 / Pricing
Simple, usage-based pricing
Scale with the number of agent steps you monitor. Cancel anytime.
Growth
$49/mo
100,000 checks/month for production agents.
- ✓ All 6 production detectors
- ✓ Slack + webhook alerts
- ✓ Est. dollars-saved dashboard
- ✓ 30-day log retention
Pro
$199
- ✓ All 6 production detectors
- ✓ Custom voting thresholds
- ✓ Priority API latency
- ✓ 90-day log retention
Paid plans require a free account. Upgrade from the dashboard after signing up.