Skip to content

Tool loop exhaustion

Also called Infinite loop, Context exhaustion

What is Tool loop exhaustion?

A failure state where an AI agent gets stuck repeatedly executing the exact same incorrect tool actions until it runs out of its allowed token budget or context window.

Tool loop exhaustion occurs when an agent's reasoning fails in a loop. For example, it might write a test, see it fail, rewrite the exact same code, fail again, and repeat indefinitely. Because each step adds history to the context window, the agent quickly exhausts its token budget or context limit, causing the workflow to crash.

How it relates to Orbit

Orbit’s Agent Sessions show each turn of a running agent live, so a loop that keeps repeating the same failing tool call is visible while it happens. See Agent Sessions & Harnesses for details.

When you would use it

You design guardrails, hard limit caps, and human-in-the-loop checkpoints specifically to detect and prevent tool loop exhaustion in production orchestration systems.

Common operations

  • Not applicable.

Related terms

Where this is taught