An agent turn is not a single model call. The harness assembles context, invokes the model, executes whatever tool the model picked, appends the observation to context and repeats until a stop condition fires, as described in Oracle's breakdown of the agent loop. Most agent engineering happens in that harness, not in the model, which is exactly where loop detection belongs.
The failure mode has a name in the research literature. Hou, Wang, Zhao and Wang define an Infinite Agentic Loop as a feedback path that repeatedly triggers model calls, tool invocations or workflow transitions without an effective termination condition, and they note that framework limits such as LangChain's max_iterations or LangGraph's recursion limits are often omitted, misconfigured or placed outside the actual feedback path (the IAL paper). Their static analyzer scanned 6,549 agent repositories and confirmed 68 loop failures across 47 projects.
The reason your APM dashboard does not catch this is economic, not technical. A loop looks like fifty successful HTTP 200 responses from a model API. The cost model changes from linear to exponential once each step carries the accumulated context of every prior step, which is why an analysis of LLM cost control argues that cost per task, not latency, is the metric that matters for agents. That same analysis cites a community-reported incident in which a coding agent's recursion loop consumed roughly 1.67 billion tokens in about five hours.
Two distinct failure modes get conflated, and they need different defenses:
| Failure mode | What happens | Where to intercept |
|---|---|---|
| Retry storm | A tool call fails, the harness retries the same call with backoff | Your HTTP or tool client layer |
| Reasoning loop | The agent re-plans around an error and calls the same tool with near-identical arguments | The orchestrator, before tool execution |
| Handoff cycle | Agent A delegates to agent B, which delegates back to A | The multi-agent router |
Infrastructure-level circuit breakers see the first one. They cannot see the second, because the retries happen inside the model's reasoning: the agent reads "timeout" as "try a different approach," as a practitioner guide on agent timeouts and circuit breakers puts it. Detection has to live in the harness, where you can inspect the tool name and arguments before the call executes.



