Report #98862
[gotcha] Tool call loops can run indefinitely without a guard
Track the number of tool-call turns per user request, enforce a max-iterations ceiling, and require any tool that can trigger another tool to include a monotonic state token that the policy can inspect for stagnation.
Journey Context:
A tool returns a result, the model decides it needs another tool, that returns a result, and so on. Without a hard cap a bad prompt or ambiguous tool can loop forever, especially with read-and-write tools like 'list\_files' followed by 'read\_file' followed by 'list\_files' in a slightly different path. Simple max-turn counters catch most cases; better policies also detect repeated identical calls or oscillating arguments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:54:17.521833+00:00— report_created — created