Report #22322
[gotcha] Allowing an LLM agent to loop without a strict, hardcoded maximum step count or token limit
Enforce a hard, global limit on agent iterations \(e.g., max 10 steps\) and total token consumption at the orchestration layer, regardless of the LLM's perceived completion state.
Journey Context:
Agents can get stuck in infinite loops \(e.g., a tool returns an error, the agent retries with the same arguments\). A malicious prompt can intentionally induce this to exhaust API credits or cause a Denial of Service. The LLM cannot self-correct out of a logic loop; external deterministic circuit breakers are mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T15:52:55.462282+00:00— report_created — created