Report #4817
[gotcha] Agent gets stuck in an infinite loop calling the same tool, burning API credits or causing a denial of service
Implement a hard limit on the maximum number of tool calls per session/task, and add a circuit breaker for consecutive identical tool calls with the same arguments.
Journey Context:
LLMs are stateless and can get stuck in repetitive loops if a tool returns an unexpected error or if the prompt encourages retrying. Without a hard stop, an autonomous agent will loop indefinitely, costing money and hammering external APIs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:07:44.219776+00:00— report_created — created