Loading patterns…
Budget-Guarded Autonomy(BGA)
Hard, enforced per-task and per-session budgets on tokens, dollars, wall-clock time, and tool-call count that are checked before each call and pause or terminate execution, rather than after-the-fact cost alerts. Mechanisms include pre-flight budget checks that raise a budget-exceeded stop before the next call reaches the provider, a token-velocity circuit breaker that trips on runaway loops, loop detectors that halt no-progress cycles, and delegated budget ceilings where a parent agent grants a child a spend cap the child cannot exceed. Distinct from `cost-aware-model-selection`, which routes to cheaper models to lower unit cost but does not enforce a ceiling or halt spend.
In 30 seconds
- What
- Enforces hard ceilings on tokens, dollars, time, and tool calls before each execution step, halting or pausing when limits are reached.
- When to use
- Autonomous agents running unsupervised tasks where runaway loops, token bloat, or unexpected costs pose real financial or operational risk.
- Watch out
- Overly tight budgets starve legitimate work; undersized caps breed false alarms and frequent pauses that frustrate users and waste engineering time.
Ask the AI expert about this pattern
Opens the assistant with your question prefilled. You review it before sending.
Budget-Guarded Autonomy: Overview
Hard, enforced per-task and per-session budgets on tokens, dollars, wall-clock time, and tool-call count that are checked before each call and pause or terminate execution, rather than after-the-fact cost alerts. Mechanisms include pre-flight budget checks that raise a budget-exceeded stop before the next call reaches the provider, a token-velocity circuit breaker that trips on runaway loops, loop detectors that halt no-progress cycles, and delegated budget ceilings where a parent agent grants a child a spend cap the child cannot exceed. Distinct from `cost-aware-model-selection`, which routes to cheaper models to lower unit cost but does not enforce a ceiling or halt spend.
- Pre-flight enforcement: budget checked before the next call, not after spend
- Hard caps on tokens, dollars, wall-clock time, and tool-call count
- Token-velocity circuit breaker trips on runaway or ping-ponging loops
- Loop detection halts repeated no-progress cycles
- Delegated ceilings: a parent grants a child a spend cap it cannot exceed
- Pause-with-state on breach so a human can raise the cap or kill the run
The Agent Architect
One pattern, one tradeoff, one production failure story. A short weekly briefing for people building agentic systems.
Weekly email, one-click unsubscribe. We only use your address to send the briefing.
References
The papers, specifications, and repositories this pattern is based on.
From the engineer behind this catalog
Get your agent architecture reviewed
This page documents one pattern. Your system runs dozens, and most failures live in how they fit together. Have the whole design reviewed against the 288 patterns in this catalog: architecture, reliability, evaluation and cost, every finding mapped to the pattern that fixes it.
€750 instead of €1,500, one week, written report and walkthrough call, until 30 September