Report #12298
[gotcha] Infinite loops and resource exhaustion from recursive agent-tool-agent callbacks
Enforce a hard limit on the depth of tool calls and total execution steps per agent session; track the call stack depth of tool invocations.
Journey Context:
Some MCP patterns allow tools to request the agent to perform actions. If a tool returns a prompt that causes the agent to call the same tool again, it creates an infinite loop, rapidly consuming tokens and API credits. Developers forget to implement circuit breakers for recursive agentic loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:40:56.223347+00:00— report_created — created