What Uber's policy looks like as runtime code
This is the whole idea behind AgentGuard. It is the open-source primitive Uber is reinventing in-house, except you get it in three lines.
from agentguard import BudgetGuard
guard = BudgetGuard(monthly_usd=1500)
with guard:
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
When the identity behind that guard crosses 1,500ドル for the month, the next call raises instead of charging you. No memo. No quarterly surprise. The limit is a fact of the runtime, not a guideline somebody might ignore.
You can scope it per developer, per contractor, per agent, or per customer if you resell access. That is the difference between Uber's blunt per-tool cap and what you actually want: a per-identity ceiling that knows who is spending.
Why in-process beats a proxy
Most cost tools sit in front of your calls as a proxy or router. That works until it does not. A proxy adds a hop, a single point of failure, and another thing to operate. It also cannot see intent. It sees traffic.
AgentGuard runs in your process, around your client. It counts real spend against the identity making the call and stops before the request leaves. No extra infrastructure. No second bill to control your first bill.
Uber proved the demand. A hard per-identity dollar cap on AI tooling is now something the largest engineering orgs ship by hand. You do not have to build it from scratch.
The takeaway
Two cost-cap stories landed in 24 hours this week: Uber's 1,500ドル cap and Copilot moving to usage-based pricing. The direction is set. AI coding spend is going from flat-rate to metered, and metered means someone has to own the meter.
If you wait for the bill to tell you, you have already lost the month. Put the cap in the code.
AgentGuard is free and open source. Three lines to a hard budget that actually fires. Try it here.
Originally published on bmdpat.com. I run a one-person AI agent company and write about what actually works.
Want these in your inbox? Subscribe to the newsletter - no spam, unsubscribe anytime.