Spend governance
that never sleeps.

AgentGuard Spend evaluates policy in your process before a wrapped provider call is dispatched. In enforce mode it can block the call before the provider charges you. With signing keys configured, decisions can be recorded in an Ed25519-signed, hash-chained log.

Node.js
npm install @agentguard-run/spend
Python
pip install agentguard-spend
Start here
Quickstart
Install, wrap your provider client, and set a daily cap.
Capabilities
Every cap window, action, scope dimension, capability tier, and locale.
Workflows
One budget envelope, resumable checkpoints, and a signed chain for multi-step runs.
Integrations
Native provider bindings plus the framework adapters exported by the TypeScript package.
Outcome Builder Guide
Prompt-first setup for law, accounting, insurance, real estate, and e-commerce teams.
What AgentGuard does
Spend caps
Per-call, per-minute, per-hour, per-day, and per-month windows. Store-backed reservations can be atomic.
Block / downgrade / shadow
Hard block, route to a cheaper model, or just log. Per-cap configurable.
Configured scope
Build one policy scope key from tenant, team, user, agent, task, and provider dimensions.
Cryptographic receipts
Configure Ed25519 keys to append SHA-256 hash-chained records that verify offline.
Tamper-evident log
Use the exported in-memory or NDJSON decision-log stores, or implement the store interface.
en-US · es-419 · pt-BR
Native-locale error messages and blocked traces. Auto-detected.
Integrations
LangChain.js
An awaited callback handler runs policy preflight before model dispatch.
OpenRouter
Wrap an OpenAI-compatible client or guarded fetch call.
Vercel AI SDK
Middleware preflights generate and stream calls, then settles reported usage.
Hermes
Tool-event hooks enforce capability policy and record redacted metadata.
Claude Code
PreToolUse and PostToolUse hooks gate tools and record content-free metadata.
Hermes Kanban
Task envelopes, capability ceilings, per-task caps, and parent-linked DAG receipts.
Provider bindings
OpenAI-compatible chat completions, Anthropic Messages, and Bedrock InvokeModel.
Reference
npm package
@agentguard-run/spend · v0.16.0 · package license permits production up to 10,000 enforcement calls per calendar month. Patent-pending.
PyPI package
agentguard-spend · Python package reference.
GitHub
Source, issues, examples. Star to follow releases.
llms.txt
Full SDK reference in one file. Paste into Claude / Cursor / GPT.
Need something custom?
Need an integration that is not in the exported TypeScript surface? Request direct engineering contact.
Request access