On this page
The core idea
A model may repeatedly search, retry or revise without making useful progress. An explicit execution budget makes the workflow predictable. Different limits protect different resources: a step cap bounds actions, a timeout bounds elapsed time and a cost budget bounds paid usage. Stopping should preserve useful work and explain what remains unresolved.
A practical approach
Step 1
Define the unit of work and the maximum calls, elapsed time and resource use allowed for it. Use smaller budgets for uncertain or exploratory tasks.
Step 2
Track progress against a concrete goal, such as retrieving a valid record or producing a verified draft. Repeating the same failed operation is not progress.
Step 3
When a limit is reached, return the completed work, failure context and a clear continuation option. Do not silently restart the same loop.
Worked example
An assistant tries to locate a missing document. After several distinct searches produce no supported match, it should explain the missing identifier and ask for a better reference. Searching indefinitely may increase cost without improving the result.
A mistake to avoid
A timeout around only the final request does not limit earlier tool calls. Place the budget around the whole workflow and propagate cancellation to operations that support it. Account for retries in the same budget.
Try it yourself
Run a deliberately impossible lookup through your agent. Record calls and elapsed time, then confirm that the stop response identifies what was tried and what information would unblock the task.
Your implementation checklist
- Budgets cover the entire workflow.
- Retries count toward the same limits.
- Repeated failures trigger a stop condition.
- Useful partial results survive cancellation.
Share or cite this guide
Innovate with Ajay Editorial (2026-10-04). Set an Agent Step Budget before You Need an Emergency Stop. https://innovatewithajay.com/blogs/set-an-agent-step-budget
