The OpenAI Agents SDK gives you guardrails that validate inputs and outputs, handoffs that move work between agents, and runs that keep going until the work is done. What it does not give you is a dollar figure anywhere in that loop.
The short answer
Treat SDK guardrails as validation, not as a budget. Add the money controls at the call path: every model and tool call passes an authorisation check carrying the agent's identity and an estimated cost, against per-agent daily and monthly ceilings. Cap each run as well as each agent — handoffs mean a single run can spend under several identities — and route tool calls with external side effects to approval. The SDK decides what the agent does next; the gateway decides whether it is allowed to pay for it.
Check your own setup as you read: run the free Spend Guard self-check or test a policy in the playground — five minutes, no signup, and the gaps it names map to the controls below.
Worked example: the triage agent whose handoffs hid the bill
Casa Verde Hotels, a fictional 40-room independent group, built a guest-message triage agent on the Agents SDK: a triage agent handed booking questions to a reservations agent and complaints to a service agent. Each agent looked cheap in isolation — none exceeded $8 on any day in the provider view the team watched. What nobody totalled was the run: a single confusing guest thread was handed off 340 times in one night as each agent decided another owned it, generating 2,180 model calls and $74.60 for one conversation.
The fix kept every handoff and added two ceilings. Each run now carries a $3 budget: the call that would cross it is refused and the thread is escalated to the front desk with a summary. Each agent keeps a daily cap — triage $12, reservations $20, service $15 — so a busy day across many threads still stops before it becomes a bill. In the first month the run cap fired 11 times, every one a genuine handoff loop, at an average stopped cost of $2.91 instead of the $74.60 the first loop reached.
Guardrails validate; they do not ration
Input and output guardrails answer 'is this allowed content, in the right shape'. They run alongside the agent's work and can trip a run, but they know nothing about cumulative spend, and a run can pass every guardrail while spending a fortune doing legitimate-looking work. Keep them — they are good at their job — and stop expecting them to do a budget's job. Rationing needs state: a running total per agent and per run, updated on every call, which lives naturally in the authorisation layer rather than in validation hooks.
Budget the run, not only the agent
Handoffs break per-agent accounting: a run is a relay, and its total cost is the sum across every agent it visited. If you only cap agents, a pathological run distributes its spend so no single cap fires — exactly what happened at Casa Verde, where three agents each stayed under $8 while one thread cost $74.60. Give every run a budget identity of its own, decremented on each call regardless of which agent makes it, and escalate the run to a human when the budget ends.
Tool calls are where side effects and spend meet
Model calls cost tokens; tool calls can cost money and change the world — sending the email, charging the card, booking the room. Route tool calls through the same authorisation check with their own estimated costs, and put the irreversible ones behind approval regardless of cost. A $0.02 tool call that refunds the wrong guest is a bigger incident than a $40 model loop, and your policy should be able to say so.
Trace ids make the audit log readable
Carry the SDK's run and trace identifiers into every authorisation request. When finance or an incident review asks what happened, you can then walk one thread from first call to refusal, across every handoff, in order, with the policy decision recorded at each step. Without that threading, multi-agent incidents dissolve into three separate logs and a meeting.
A worked sizing exercise for your first run budget
Take your last hundred completed runs and price them honestly, including every handoff. Sort them. The median is your normal; the 95th percentile is your generous; anything beyond three times the 95th percentile is almost certainly a malfunction rather than a workload. Set the run budget between the second and third of those numbers, and log every run that reaches even half of it for the first month — those near-misses are your calibration data, showing whether real work is creeping toward the line or the line sits safely above it. Do the same per agent for daily caps. Teams that skip this exercise tend to pick round numbers, and round numbers are how a $3 problem becomes a $300 one while every individual figure looked reasonable.
Five actions to add spend guardrails to an Agents SDK app
- Keep SDK guardrails for validation, and add a separate per-call authorisation check that carries identity and estimated cost.
- Set per-agent daily and monthly ceilings for every agent in the system, including orchestrators.
- Give every run its own budget, decremented across all handoffs, with escalation to a human when it ends.
- Route irreversible tool calls to approval regardless of their dollar cost.
- Pass run and trace ids into the authorisation log so one thread can be reconstructed end to end.
Source note and related guides
Figures in the worked example are illustrative, drawn from a fictional company created for this guide; the controls, failure patterns and procedures described are the gateway's documented behaviour — see the Agent Auth Gateway documentation and the policy patterns in allowlists vs denylists, spend caps and the agent kill switch. Reviewed by the Ingenious AI team, 2026-11-14.
Sources
- OpenAI API documentation — Rate limits and spend limits, on how provider-side usage and spend limits are defined at organization and project level: platform.openai.com, 2026
- NIST AI Risk Management Framework (AI RMF 1.0), the voluntary framework for managing AI risk across design, development and use: nist.gov, 2023
- OWASP Top 10 for Large Language Model Applications, the OWASP GenAI Security Project's risk list for LLM and agent systems: owasp.org, 2025