Report #83992
[gotcha] Allowing agents to call tools indefinitely without depth or iteration limits
Enforce hard limits on the maximum number of tool calls per conversation turn, the maximum depth of tool-call chains, and the total execution time. Break the loop and return an error if thresholds are exceeded.
Journey Context:
LLMs can get stuck in infinite loops, calling the same tool over and over with slightly varying arguments \(especially if the tool returns an error the LLM doesn't understand\). This leads to exponential API costs, resource exhaustion on the MCP server, and a frozen agent. Hard circuit breakers are essential.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:34:32.804388+00:00— report_created — created