Spend Control for SmolAgents
SmolAgents are small, fast, and cheap to run — which invites scale, and scale is where spend sneaks up. A guard tool keeps the fleet honest.
Why SmolAgents fleets overspend
Cheap agents are easy to spawn in volume — 100 agents × 100 tool calls each is real money.
Code agents can execute arbitrary tool calls, including paid ones.
Retry logic in the agent loop re-invokes paid tools.
How it works
Add sipi_guard to the agent's tools. Each spend attempt goes through a deterministic APPROVED / BLOCKED / FLAGGED decision before the purchase.
Rules that fit SmolAgents workloads
Per-agent daily ceiling for fleet control.
Merchant allowlist for paid tools.
Velocity limit to stop retry loops.
Guard tool
from smolagents import CodeAgent, tool
from sipi_guard import sipi_guard
agent = CodeAgent(tools=[sipi_guard], model=model)
# decision = sipi_guard(amount=120, merchant="api.vendor.com", category="api")
One tool, one policy, applied fleet-wide.
FAQ
Does this work with the code executor?
Yes — the guard is a tool like any other; the code executor can call it before triggering a payment.
What latency does it add?
About 5 ms per check, no model in the path.
Can I set a fleet-wide budget?
Yes — a shared daily ceiling across agents is exactly what the firewall enforces.
Related
Stop the next $12,400 night.
One API call (or MCP tool) in front of every agent transaction — APPROVED, BLOCKED, or FLAGGED, deterministic, ~5 ms, fully logged.
See plans — from $99/mo Try a live check