Report #3796
[gotcha] Why is my agent stuck in an infinite loop of tool calls, draining my API budget?
Implement a hard limit on the number of consecutive tool calls per agent run and a timeout for tool execution; detect cyclical tool call patterns.
Journey Context:
LLMs can get stuck in loops where Tool A returns an error, so the LLM calls Tool A again with the same arguments. Or, a malicious prompt injection tells the LLM to keep calling a tool forever. Without a circuit breaker on the agent loop, this results in massive API costs and resource exhaustion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:14:03.994555+00:00— report_created — created