sipi.bot › Learn › How to control AI agent spending
You gave an autonomous agent a way to pay — now how do you stop it spending on the wrong thing? Here are the five real approaches, honestly compared on what actually matters.
| Approach | Enforced BEFORE the spend | Controls real money (not just tokens/steps) | Granular rules (merchant / category / velocity) | Works across frameworks & agents | Human-in-the-loop approvals | Audit trail | Setup effort |
|---|---|---|---|---|---|---|---|
| Prompt / instruction limits | No | No | No | Yes | No | No | Trivial |
| Framework-native caps | Partly | No | No | No | No | Partly | Low |
| Virtual cards / provider caps | At auth | Yes | Limited | Yes | No | Partly | Medium |
| Build your own policy service | Yes | Yes | Yes | Yes | Depends | Depends | High |
| Dedicated agent spend firewall (sipi.bot) | Yes | Yes | Yes | Yes | Yes | Yes | Low |
No single approach is right for everyone: prompt limits are trivial but unenforced; framework caps stop runaway loops but not money; virtual cards give a hard but blunt cap; a dedicated firewall gives enforced, granular, cross-framework control at the cost of one call in the path.
Tell the agent its budget in the system prompt ("don't spend over $100").
Pros: Zero setup; Works with any model
Cons: Not enforced — the model can ignore, forget, or miscount; No hard stop before money moves; No audit trail
Use a framework's built-in limits (max iterations, token/step caps, tool-call limits) in LangChain, the OpenAI Agents SDK, CrewAI, etc.
Pros: Built into the framework; Good for runaway loops
Cons: Caps tokens/steps, not real-money spend; Per-framework — no view across agents; No merchant/category/velocity rules
Issue a virtual card (or set a provider spend cap) with a hard limit per agent.
Pros: Hard money cap at the card; Provider-enforced
Cons: Coarse — usually one limit, no per-merchant/category/velocity logic; Blocks are after-the-fact at authorization, not policy-aware pre-checks; Issuance/reconciliation overhead
Write and host your own pre-spend policy engine.
Pros: Fully custom; No third-party dependency
Cons: You build & maintain rules, storage, audit, approvals; Slow to ship; easy to get edge cases wrong; Ongoing engineering cost
The agent calls a policy engine (evaluate_spend) BEFORE it pays; it returns APPROVED / BLOCKED / FLAGGED against your rules — velocity, merchant allow/block, category limits, approval thresholds — across every framework, with an audit trail and human approval for FLAGGED items.
Pros: Enforced before the spend, in real money; Granular rules (merchant/category/velocity/approval threshold); One policy across all agents & frameworks (MCP / HTTP / CLI); Human-in-the-loop for FLAGGED; Full audit trail
Cons: Adds a sub-second call in the payment path; You must define your rules
The agent asks before it pays. Three surfaces, one decision:
curl -X POST https://sipi.bot/v1/transactions/evaluate \
-H "Authorization: Bearer $SIPI_KEY" -H "Content-Type: application/json" \
-d '{"amount": 750, "merchant": "unknown-gpu.ru", "category": "compute"}'
# -> {"decision": "BLOCKED", "reason": "..."}# In Claude Code / Cursor / Hermes: the agent calls the MCP tool # evaluate_spend(amount=750, merchant="unknown-gpu.ru", category="compute") # -> decision: APPROVED | BLOCKED | FLAGGED (respect BLOCKED/FLAGGED)
python -m spendfirewall.cli eval --amount 750 --merchant unknown-gpu.ru --category compute
This guide compares general approaches to controlling autonomous-agent spending as of 2026. Every team's needs differ; evaluate against your own stack and risk tolerance.