Autonomy Is Measured by a Budget
The phrase "work until you're done" sounds flexible but sets no boundaries. An agent's autonomy is measured not by trust but by a budget: the runtime limits the number of model turns, the number of tool calls, wall-clock time, result sizes, cost, and the classes of allowed actions. Without these limits one request can spin into an expensive infinite loop, and you'll learn about it from the provider's bill.
A budget is an ordinary constant plus a timer that aborts the run.
export const AGENT_BUDGET = {
maxModelTurns: 6,
maxToolCalls: 10,
maxWallTimeMs: 25_000,
maxToolResultBytes: 24_000,
maxRepeatedCall: 2
} as const;
const controller = new AbortController();
const timeout = setTimeout(function abortRun() {
controller.abort("agent_timeout");
}, AGENT_BUDGET.maxWallTimeMs);
try {
return await runWithSignal(controller.signal);
} finally {
clearTimeout(timeout);
}A separate question is what to execute in parallel and what strictly in sequence. Here it's important not to mix up levels.
Situation · Execution · Why
- Two independent read tools - In parallel; Latency drops with no state conflict
- The second call depends on the first - Sequentially; The model must see the first result
- Two previews of one order - Sequentially or deduplicate; Avoid different calculations and extra load
- Any commit - Outside the free loop; It needs approval, idempotency, and a transaction
The logic is simple: two independent read tools can be called in parallel to cut latency; a dependent call goes after the model has seen the first result; any commit leaves the free loop entirely - it needs approval, idempotency, and a transaction. And one distinction that saves both money and nerves.
Parallel tool calling is not parallel agents. The first means several independent functions in one model turn. The second creates separate contexts, results, and cost. Add multi-agent only with a clear division of responsibility, not to go faster.
The budget bounded what the agent can do. Now we decide what it must remember - and here provider state doesn't replace your own journal.