Every team running autonomous AI agents eventually meets the same surprise: the bill.
An agent that loops on a hard task, retries a failing tool, or wanders down an expensive path does not stop to ask whether it is being economical. It is goal-directed, and tokens are just fuel. Most of the time this is fine. Occasionally one workflow gets stuck and quietly spends ten or a hundred times what it should, and nobody notices until the usage dashboard catches up days later.
The usual answers are weak. Provider-level spend caps are org-wide and blunt: they tell you the whole account is over budget, long after the specific runaway workflow has done its damage, and they cannot tell one agent or one workflow from another. Watching a dashboard is not enforcement. And asking the model to "be efficient" is not a control, it is a suggestion.
So we built cost management into the layer that already sits in front of every agent action.
Token budgets, enforced at the decision point
Vorim already runs a pre-action check on sensitive agent actions: one call returns allow, deny, escalate, or a modified payload against your live policy. AI Cost Management extends that same path with a token budget.
You set a rolling budget scoped to an agent or a workflow: a token ceiling over a rolling window, for example two million tokens per workflow per day. From then on, before an action runs, Vorim checks the projected spend against the budget. If the action would push that agent or workflow over its ceiling, it is denied at the decision point, before the tokens are spent, not flagged afterwards on an invoice.
Because it rides the existing runtime decision path, a budget behaves like any other policy: the block is recorded on the same signed, tamper-evident decision trail, so you can see exactly which workflow hit its ceiling, when, and why.
Hard block or soft flag
Not every budget should slam the door. Each budget has an enforcement mode:
- Hard denies the over-budget action outright. Use it for the workflows where a runaway is genuinely expensive and there is no good reason to keep going.
- Soft allows the action but flags it, so you get the signal without stopping work. Use it while you are still learning what a normal workflow costs, or where a hard stop would do more harm than the overspend.
A denied action does not accrue spend. If the budget stops it, the tokens are never burned, so a single expensive attempt cannot wedge a workflow permanently over its own ceiling.
Spend you can actually see
Enforcement is only half the point. You also get real-time visibility: for every budget, the rolling spend in the current window, the remaining allowance, and the durable total for the month. So instead of reconstructing cost after the fact from provider logs, you can see which agents and which workflows are consuming your token budget as it happens, and attribute spend to the workflow that caused it.
How you turn it on
It is a few lines through the SDK. Set a budget, then pass the workflow and the action's token estimate on the pre-action check you are already making:
await vorim.setBudget({
scope: 'workflow',
scope_ref: 'nightly-summariser',
max_tokens: 2_000_000,
window_seconds: 86_400,
enforcement: 'hard',
});
// on each action, before it runs:
await vorim.beforeAction({
agentId,
actionType: 'llm_call',
workflowId: 'nightly-summariser',
estimatedTokens: promptTokens + maxOutputTokens,
});That is available now in the TypeScript and Python SDKs, and directly over the REST API. Budgets and live spend are also readable through the API for your own dashboards.
Why this belongs in the trust layer
Cost is a governance problem wearing a finance costume. The reason an agent overspends is the same reason it can overreach in other ways: it has been handed an objective and enough standing access to pursue it relentlessly. The discipline that contains one contains the other, a distinct identity for every agent, authority scoped to the task, enforcement that happens outside the model rather than as a polite request inside it, and a record you can check afterwards.
A token budget is that same discipline pointed at spend. Give an agent a ceiling, enforce it before the money moves, and keep the receipt.
You can set your first budget today. Start at vorim.ai, or reach us at team@vorim.ai.
Ready to build with agent identity?
Free plan: 10 agents, 10K auth events/month, full SDK access. No credit card.