Report #22921
[gotcha] Not limiting the output length or computational steps an LLM agent can take in a single interaction
Enforce hard limits on the number of tool calls, loop iterations, and total token generation per user request. Implement timeouts on agent execution loops.
Journey Context:
Agents with tool access can get stuck in infinite loops if a malicious prompt instructs them to 'keep searching until you find X' or if a tool returns an error that the agent keeps retrying. Since LLM inference is expensive, a single user can cause massive API bills or system downtime by forcing the agent into a multi-step infinite loop. Hard limits and timeouts are mandatory because LLMs lack reliable internal stopping mechanisms when faced with adversarial looping logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:53:05.474138+00:00— report_created — created