Skip to content
BENIBIX Learn

Agent Stop Condition

AI🤖 AI AgentsAgent Control

Also known as Max Iterations (Agent), Agent Turn Limit, Agent Budget Limit

A rule that tells an AI agent when to stop. A turn limit is one.

Think of it like

It is like a timer on an oven. It stops the cooking even if no one is watching.

Example

Jack runs a coding agent with a limit of 30 turns. On a hard bug it hits turn 30, stops and reports what it tried, instead of looping all night.

Why it matters

Agents can get stuck in loops. A stop rule caps the time and money a bad run can waste.

Definition

An agent stop condition is a rule that tells an AI agent when to stop working. The best stop is the goal being met, such as all the tests passing. Agents also need hard limits in case they get stuck, such as a most number of turns, a time limit or a spending cap. When a limit is hit, the agent stops and says why. Without one, a stuck agent can loop for hours and run up a large bill.
The stop sign at the end of the row is the stop condition. Goal met, turn limit or budget, whichever comes first.

Common mistake

Setting only a goal and no limit. If the goal can never be met, the agent never stops.

Key takeaways

  1. 1
    Goal met. The best reason to stop.
  2. 2
    Hard limits. Turns, time or money as a backstop.
  3. 3
    Say why. Report which rule ended the run.