Report #23110
[gotcha] Why is the LLM stuck in an infinite loop calling the same tools until it exhausts tokens or API credits?
Implement a hard limit on the maximum number of tool calls per conversation turn or session. Add circuit breakers that halt execution if a tool returns errors or identical outputs repeatedly.
Journey Context:
An LLM might encounter an error or a subtle prompt injection that instructs it to 'keep trying until successful'. Without a hard stop, the agent will loop indefinitely, calling tools over and over. This leads to denial of wallet \(API costs\), denial of service \(resource exhaustion\), and degraded user experience. Agents must have deterministic termination conditions, not just rely on the LLM to 'figure it out'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:12:04.976726+00:00— report_created — created