budget denies calls once a limit is used up. Limits are counted by the harness, in the run's store. This is separate from the budget set on the agent in Scute, which the engine enforces and which pauses the agent when exceeded (see Agents).
guards.budget({ calls: 20, perHour: { high: 5 }, usdPerRun: 2 });Options#
No option is required; an omitted limit is not enforced.
What is counted#
- Calls. A call counts when its verdict lets it run (proceed or transform), at check time. Calls that are refused, guided or waiting for a person do not count. With the AI SDK, a call waiting on the person's tool approval is counted once, when it runs after they approve.
- Hourly executions. The same moment, recorded with the call's tier under scute:hour:<agent>:<person>. For runs on a task token without actsFor, the person comes from the task (whoami).
- Spend. Whatever you add:
await run.recordUsage({ usd: 0.012 });Because checks in a run go one at a time and a call takes its share when it is allowed, parallel tool calls in one step cannot overspend.
Decisions#
| Limit | Reason | Message |
|---|---|---|
| calls | budget_exhausted | This run has used its 20 tool calls. Stop here and tell the person what's left. |
| usdPerRun | budget_exhausted | This run has spent its $2 budget. Stop here and tell the person what's left. |
| perHour (number) | budget_exhausted | The hourly limit of 5 actions is reached. Tell the person to try again later. |
| perHour (per tier) | budget_exhausted | The hourly limit of 5 high-risk actions is reached. Tell the person to try again later. |
All are deny.
Stop the loop#
Ask whether a run budget (calls or spend) is used up, to end the agent loop instead of letting the model keep trying:
| TypeScript | Python | Ruby |
|---|---|---|
| await run.budgetExhausted() | run.budget_exhausted() | run.budget_exhausted? |
With the Vercel AI SDK, pass run.budgetExceeded to stopWhen. Hourly limits are not part of this check.