Give Your Agent a Budget Before You Give It Authority
A spending limit belongs in the executor, not just in the prompt.
Read the full white paper PDF · 14 pages ↓Reserve maximum authorized exposure atomically before execution; keep unresolved commitments in the budget until their outcomes are known.
Give an agent permission to buy something and a sentence telling it to be careful. You have created a purchasing assistant. You have not yet created a spending limit.
Here is a hypothetical failure that needs no hallucination. Twenty workers share a 10,000-unit budget. Each finds something costing 700. Each checks a balance that still appears sufficient. Together, they can commit 14,000 units. Every individual request looks reasonable. The system has allowed several promises to spend the same money.
The solution is an execution boundary: reserve the maximum authorized exposure before the action runs, and bind permission, approval and reservation to the same proposal. A budget in a prompt can improve a plan. A budget enforced by the application determines whether the plan can become a commitment.
Permission is not a purchasing policy
OWASP's Excessive Agency guidance distinguishes excessive functionality, permissions and autonomy. A read-only task can receive a tool that deletes. A narrow tool can run under an overpowered account. A properly scoped account can act without appropriate review. OWASP recommends minimal functionality and permissions, approval for high-impact actions, and authorization enforced downstream. [1]
Budget is another dimension. Being allowed to place one order does not say how much many orders may cost. A rate limit counts requests; it does not necessarily bound their value. And a monetary ceiling cannot authorize a prohibited destination or the disclosure of private information, even when the action is free.
MCP's inspected authorization specification protects access to resources and requires token audience validation. That is valuable, but it is not an application-specific spending ledger. Its tool specification also treats annotations from untrusted servers as untrusted. The executor needs its own knowledge of permitted actions; a model-facing description is not enforcement. [2][3]
Three gates before a commitment.
Permission, approval and budget answer different questions. All must describe the same proposed action.
Scope
Allow only the intended principal, operation and destination.
Approval
Bind any required review to the actual proposal and maximum.
Reservation
Atomically allocate remaining capacity before execution.
Original application design. Protocol access and SDK approval mechanisms supply parts of the boundary, not an automatic aggregate spending policy.
Count commitments before the bill arrives
A dashboard that counts only completed charges can hide exposure from requests already in flight. The useful invariant is simple: confirmed spending plus outstanding reservations must stay within the ceiling.
For an operation capped at 700 units, reserve 700 before dispatch. If the confirmed cost is 500, record 500 as spending and release 200. If the outcome is unknown, retain the reservation. Releasing it would treat uncertainty as available money.
The cap must mean something outside the ledger. An estimated price does not enforce a maximum. Delivery, tax, exchange rates, additional tools or variable computation can change the total. The executor needs a defensible bound or another decision before crossing it. Local accounting cannot stop a provider charging more than the application assumed.
Define the unit and the scope. Dollars, tokens and emails are different allowances. Several agents serving one department must share its ceiling or receive non-overlapping allocations. Resetting a period must not erase unresolved commitments from the previous one.
Make admission indivisible
The concurrency bug appears when checking the balance and recording the commitment are separate steps. Two requests can both pass an accurate check and then allocate the same capacity.
The admission decision and reservation need one atomic storage operation. The accompanying local example uses a SQLite immediate transaction to serialize competing writers. A distributed deployment needs equivalent guarantees at its actual consistency boundary; a lock in one process does not coordinate other machines. [7]
A durable operation ID matters too. After a restart, a worker should recover its existing reservation. It should not create another because its conversation no longer contains a clear result. The example binds the operation ID to a payload fingerprint: an identical request returns existing state, while changed terms under the same ID are rejected.
This controls reservations. Preventing a repeated external purchase is a separate obligation. The companion paper, The Retry Button Can Spend Twice, examines that boundary.
Approve the action that will actually run
A useful approval record names the principal, operation, destination, consequential payload and maximum exposure. Production policy also needs a validity window and a way to handle revocation. A reviewer must see those terms clearly. A hash detects later changes; it cannot make a misleading approval screen honest.
The inspected OpenAI Agents SDK provides approval interruptions and resumable run state. Its documentation distinguishes per-call approval from persistent approval of a tool identity. The latter grants broader authority, with specific version-dependent behavior when approval state is shared. Builders should inspect that scope instead of assuming “approved” always means one immutable action. [4]
MCP's security guidance makes a related point through its OAuth proxy confused-deputy scenario: prior consent associated with the wrong client is not adequate authorization. That source concerns access, not purchasing, but the identity-binding lesson applies. [6]
Standing authority can be appropriate. Define its destinations, per-action maximum, aggregate allowance and expiration. Per-call review can handle exceptions. Asking a person to approve every trivial step is not the only alternative to unrestricted execution.
The gate must come before the consequence
“Guardrails are on” does not specify when a check runs. The captured Agents SDK documentation says default parallel input guardrails can run while the agent has already consumed tokens or executed tools. Blocking input checks run first. Agent-level output checks run after completion; function-tool checks have their own execution path. [5]
For spending, admission belongs where the side effect is controlled. A final-output check cannot undo an earlier purchase. A proposing component also should not have an unrestricted credential that bypasses the controlled executor. Otherwise the spending gate becomes optional. [1]
Twenty workers, one ceiling
Download the Python standard-library example in reference 7 and run python3 example.py. It creates temporary local databases, runs assertions and writes result.json. It makes no network, payment or model calls. All amounts are fictional units. [7]
Across twenty rounds, twenty threads per round request 700 units against a 10,000-unit ceiling. Each round accepts fourteen requests and denies six. Peak reservations are 9,800 units. The measured run includes 400 requests, with no ceiling breach in those cases.
Ten admitted operations then settle at 500 each. Four remain unknown with their 700-unit reservations retained. The balance is 5,000 spent, 2,800 reserved and 2,200 available. Repeating an existing reservation adds nothing. Separate assertions reject an unapproved 4,000-unit proposal, changed terms after approval, an unauthorized destination, a negative amount and settlement above the reservation.
Twenty requests cannot all spend the same balance.
In each of 20 rounds, twenty concurrent requests seek 700 fictional units from a 10,000-unit ceiling.
Admitted
Each receives a 700-unit reservation.
Budget denied
Insufficient unallocated capacity; no reservation created.
Peak reserved
Below the 10,000-unit ceiling in every measured round.
400 requests across 20 local rounds. SQLite serialized writers. These are fixture observations, not a guarantee for distributed deployments or real providers.
These are fixture results, not a production guarantee. The example assumes trusted identity and reviewer actions, uses one local wallet per database, and does not implement real payment execution, expiry or distributed failover. Finite passing tests do not prove every possible schedule.
Unknown spending needs an owner
A timeout is not a cancellation. If an external action can still complete, automatically releasing its reservation can recreate the overspending problem. The workflow needs a reconciliation owner, an external operation identity and a visible reason why capacity remains committed.
This conservatism has a cost. Unresolved reservations can obstruct useful work. Measure their age, approval waiting time and budget denials so the owner can improve the policy or recovery process deliberately. Quietly treating uncertain commitments as free capacity hides the problem.
A per-transaction review threshold also needs a business boundary. Splitting one consequential purchase into smaller calls should not manufacture authority. Keep the user's task or order identity alongside its individual commitments, so a reviewer can see the whole undertaking.
Unknown is still committed.
After ten operations settle at 500 units and four remain unresolved, the original 10,000-unit ceiling has three distinct parts.
Confirmed spending
Ten operations with a known 500-unit result.
Unknown outcomes
Four full 700-unit reservations remain held.
Available
Only this remainder may fund new commitments.
Fictional integer units in the local fixture. A timeout does not prove cancellation; the example retains rather than releases unresolved reservations.
Delegate within an enforceable envelope
Not every assistant needs a bespoke purchasing ledger. A downstream service may already enforce a suitable prepaid allowance or shared account ceiling. A fixed-cost, low-impact task may need a simpler limit. Verify the existing boundary before adding another authoritative system.
For consequential variable spending, require evidence that competing requests cannot claim the same capacity, approval cannot silently change meaning, and uncertain outcomes remain funded until resolved. Those are useful acceptance tests for the application, independent of the model's eloquence.
The point of delegation is to avoid specifying every step. A capable assistant can choose the best use of the authority it has. The application must be able to show, in durable accounting rather than reassuring prose, how much authority remains. The full white paper develops the lifecycle, failure cases, approval contract and implementation limits behind this approach.
Questions worth asking.
Is a budget written into the system prompt enough?
It can help the model propose appropriate actions, but it does not atomically coordinate concurrent spending or prevent a separate execution path from bypassing policy. Enforce admission where the side effect is controlled, using an authoritative reservation record. The local fixture demonstrates that accounting boundary. [1][7]
Why reserve the maximum instead of counting completed charges?
Several requests can be in flight before any charge appears. Reserving a defensible maximum prevents those requests from claiming the same capacity. Settlement releases unused capacity; an unknown outcome retains its reservation. The maximum must also be enforceable or defensible at the external boundary. [7]
Does every tool call need human approval?
No. Bounded standing authority can cover routine actions within a defined destination set, per-action maximum and aggregate ceiling. High-impact or exceptional decisions can require per-call approval. Inspect the SDK and application rules because persistent tool approval is broader than approving one proposal. [1][4]
Does the example work as a production payment service?
No. It is a Python standard-library illustration using a local SQLite wallet and fictional units. Identity and reviewer trust are assumptions; real payment execution, approval expiry, revocation and distributed failover are outside its scope. Its assertions verify selected local cases. [7]
What happens when an action times out?
A timeout does not prove that an external action was canceled. Keep its reservation and reconcile the original operation using the executor’s actual guarantees. Assign an owner and show why capacity remains unavailable instead of treating uncertainty as permission to spend again. [7]
Sources & method.
Analysis of exact primary-source repository snapshots captured November 16, 2026: OWASP Excessive Agency guidance, MCP 2025-06-18 materials and OpenAI Agents SDK documentation. A separate Python standard-library SQLite fixture executed 20 rounds of 20 concurrent reservation attempts and selected policy assertions. Amounts are fictional integer units; no model, payment or provider API was called. The proposed production controls extend beyond the deliberately bounded local fixture. No claim of distributed-failover validation, provider performance or universal prevention is made.
- LLM06:2025 Excessive Agency OWASP GenAI Security Project · 2026-11-16 · Primary security guidance
Supports excessive functionality, permissions and autonomy; downstream complete mediation, minimum functionality and human approval. The linked third-party incidents were not independently retrieved or reused as evidence. Exact inspected path: 2_0_vulns/LLM06_ExcessiveAgency.md. Commit 99f4395589bdbd120ae961f9cd179e79d7f9b27f. Reference date is capture date, not original publication date. Original bytes and SHA-256 preserved in the source receipt.
Accessed copy ↗ - MCP 2025-06-18: Authorization Model Context Protocol · 2026-11-16 · Primary protocol specification
Inspected protected-resource authorization, resource indicators, audience validation and rejection of token passthrough. This source is not claimed to implement a spending ledger. Exact inspected path: docs/specification/2025-06-18/basic/authorization.mdx. Commit ac00313ff7f5e9f47b0e0d1ebdf9c0ad6411380b. Reference date is capture date, not original publication date. Original bytes and SHA-256 preserved in the source receipt.
Accessed copy ↗ - MCP 2025-06-18: Tools Model Context Protocol · 2026-11-16 · Primary protocol specification
Supports human ability to deny tool invocations and treatment of annotations from untrusted servers as untrusted. Tool descriptions do not constitute the proposed application enforcement. Exact inspected path: docs/specification/2025-06-18/server/tools.mdx. Commit ac00313ff7f5e9f47b0e0d1ebdf9c0ad6411380b. Reference date is capture date, not original publication date. Original bytes and SHA-256 preserved in the source receipt.
Accessed copy ↗ - OpenAI Agents SDK: Human-in-the-loop OpenAI · 2026-11-16 · Primary SDK documentation
Inspected needs_approval, interruptions, resumable RunState, per-call versus sticky approval, and the documented cross-agent scope of sticky local shell/file-edit decisions. Version-specific snapshot, not a live product test. Exact inspected path: docs/human_in_the_loop.md. Commit 64fbde5d02b42ae5f9db668eb0184cdb3fc9d775. Reference date is capture date, not original publication date. Original bytes and SHA-256 preserved in the source receipt.
Accessed copy ↗ - OpenAI Agents SDK: Guardrails OpenAI · 2026-11-16 · Primary SDK documentation
Inspected parallel versus blocking input guardrails, final output timing, and function-tool guardrail coverage. Does not claim all tool families use the same execution pipeline. Exact inspected path: docs/guardrails.md. Commit 64fbde5d02b42ae5f9db668eb0184cdb3fc9d775. Reference date is capture date, not original publication date. Original bytes and SHA-256 preserved in the source receipt.
Accessed copy ↗ - MCP 2025-06-18: Security Best Practices Model Context Protocol · 2026-11-16 · Primary security guidance
Inspected OAuth proxy confused-deputy scenario and per-client consent mitigation. Used as an identity-binding illustration, not evidence of a financial exploit. Exact inspected path: docs/docs/2025-06-18/tutorials/security/security_best_practices.mdx. Commit ac00313ff7f5e9f47b0e0d1ebdf9c0ad6411380b. Reference date is capture date, not original publication date. Original bytes and SHA-256 preserved in the source receipt.
Accessed copy ↗ - Reproducible local fixture: example.py Kymata Labs Research · 2026-11-16 · Original executable illustration
Python standard library only. Run python3 example.py to perform the assertions and write result.json. Local fictional scenario; no network, provider, model or payment calls. The publication reports the measured fixture result, not a production benchmark.
The full argument.
Yours to keep.
The developed analysis, evidence, counterarguments and practical framework, in one carefully designed white paper.
14 pages · 3 figures · 7 references · PDFDownload the white paper Free to read. No signup.