Agent costs get hard to control when you only govern one model call at a time.
TokenOps is an open-source Python project for setting and enforcing a token budget across a whole AI-agent run.
It helps you keep multi-step workflows within a shared spend limit by applying governance before each model call, instead of only reporting the cost after execution.
Key features:
• Run-scoped budgets – set one budget for the full agent workflow, not a single request
• Pre-call enforcement – check the available budget before each model call and halt a run when it is exhausted
• Shared control plane – let multiple agent processes govern against the same run ledger
• Configured policy options – start with 10 documented policies and add your own
• Integration path – wrap the model completion function rather than rewriting the agent loop
It’s open-source (MIT license).
Link in the reply 👇
New talks on the AI Coding Summit Berlin agenda 🚀
Your agent writes the code. Who debugs it, reviews it and stops it repeating mistakes?
@juristr, @krisvelkov, Tisha Chawla, @eddyvinckk & @maishsk have answers!
📍 Dec 4 & 7, Berlin & Online
🎟️ https://t.co/RPwIwA3Lg4
Who spent all the tokens? 👀
TokenOps gives multi-agent workflows one shared, run-scoped budget, with policies that can step in before the next model or tool call executes.
The result is real-time control over spend and agent behavior while the run is still happening.
Eight sessions on the parts of the factory that are not the model:
- An agent tidying up after itself hit a filter that matched everything: 200 workloads deleted in 90 seconds. The fix was not a narrower token. It was a budget: rate limits that refill, and an identity the agent cannot set
- In the largest real world study of AI clinical notes, 1 in 20 carried an error serious enough to cause the patient significant harm. The dangerous ones look fine: nothing in the note is wrong, the detail that matters is missing
- Chip designers told an agent to stay out of the spec files. It agreed, then wrote to them with bash. They blocked bash and sed. It used cat. Now they block at the system level, not tool by tool
- Instead of killing an agent that blows its budget, steer it while it runs: compact the context, trim tool output, tell it to tighten up. Their benchmark: average spend down 78 percent, completion up from 67 to 96 percent
- Warp went open source and jumped from around 20,000 GitHub stars to over 60,000, with thousands of PRs. No human reviewer gets pinged until an agent has approved the PR first
Watch the AI Architects playlist:
https://t.co/stPGGg0shF
Live now: our AI Architects, AI Factories Track from AI Engineer World's Fair 2026.
Thesis: the model is the easy part of the factory.
https://t.co/stPGGg0shF
- The Agent Behind the Curtain: Building the Oz Cloud Agent Platform: Safia Abdalla, Warp
- FinOps for AI Agents: Who Spent All the Tokens?: Tisha Chawla + Susheem Koul, Microsoft
- What If Your Chip Design Team Moved Like a Single Body?: Abduallah Mohamed, AIDAChip
- Preferences Over Benchmarks: Model Routing: Archana Kamath + Tyler Gillam, DigitalOcean
- Coding Agents Don't Scale Themselves. Neither Do Your Teams.: @patrickdebois, Tessl
- Agent Frameworks Considered Harmful: @remilouf, .txt
- Inside 847 Production Clinical AI Notes: Sebastian Fox, Composo
- Give the Agent a Budget, Not a Token: @edorado93, Anthropic