Report #59312
[gotcha] LLM resource exhaustion via recursive tool calling
Enforce strict token limits on user input and retrieved context. Implement a hard limit on the maximum number of tool call iterations \(e.g., max 5 steps\) and a global timeout for the entire agent execution loop.
Journey Context:
Developers focus on prompt injection but miss availability attacks. An attacker can submit a massive document that drains API credits or causes timeout errors. Worse, in agentic loops, an attacker can craft a prompt that causes the LLM to call a tool, receive the output, and then call the same tool again in an infinite loop, rapidly consuming resources. Hard limits are mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:03:03.364164+00:00— report_created — created