AP35 · Unbounded agent loop
Family: Loop, stopping and orchestration
Strong evidence
Original names: unbounded agentic loop, no stopping condition, unbounded consumption
Nothing in the code stops the agent: no turn cap, no budget, no deadline.
Definition
The loop goes on for as long as the model or a tool result decides: another retry, another tool call, another conversation turn, another handoff. The only safeguard is a billing alert, seen after the fact.
Observable symptoms
- Identical actions, with the same arguments, repeat in the traces.
- Two agents keep passing the turn back and forth with almost identical messages.
- Cost per task has a long tail: a few sessions cost dozens of times the median.
- No trace ever reports a budget being reached: the overrun shows up on the bill.
Why it hurts
A model is a poor judge of its own deadlock. An error sent back without a counter reproduces the same error, and every turn rereads the whole context: cost grows faster than the number of turns. Between two agents, neither one owns the stopping condition.
A defensible choice when…
- A short exploration, watched live, with no side effects and no shared budget.
Figures
- Of 68 confirmed infinite loops in 47 open-source agent projects, none had a bound enforced by code (July 2026 preprint).
- Across 1,642 traces of multi-agent systems, repeated steps account for 15.7% of failures and ignored stopping conditions for 12.4%.
- Early versions of Anthropic’s research system spawned up to 50 sub-agents for simple questions and searched endlessly for sources that did not exist.
Remedies from the catalogue
- F5 · Budgets and circuit breakers — Caps on turns, tokens, cost and time checked before every call, a repetition detector and a kill switch.
- B6 · Custom state graph — A state graph with an explicit end state, rather than a free-form conversation.
- F1 · Human in the loop — Beyond a failure threshold, a human takes over instead of another turn.
Measures outside the catalogue
- A retry counter per error type.
- Alerts on hourly rather than monthly spend.
Misused patterns
Related anti-patterns
Sources
- When Agents Do Not Stop — Hou, Wang, Zhao et Wang, arXiv, 2026-07-02
- Why Do Multi-Agent LLM Systems Fail? — Cemri et al., arXiv, 2025-03-17
- How we built our multi-agent research system — Anthropic, 2025-06-13
Content reviewed on 2026-10-05