Prompt LibraryAgents

Agent Loop Budget & Stopping Criteria Prompt

Define when an agent loop must stop.

The prompt

Define stopping criteria for the agent loop below:
- SUCCESS: the goal condition is verifiably met (state the check).
- BUDGET_EXHAUSTED: max tokens or steps reached (state the numbers).
- STUCK: the same tool call repeated N times with no state change (state N).
- SAFETY: a guardrail triggered (state which).
- ESCALATE: confidence below threshold after a replan (state threshold).
For each, state what the agent does next (return, retry, ask human).

Agent loop: {{loop}}

Replace the {{fields}} with your own context and tighten the rules to match your domain.

Share this prompt