In-process budget and loop guard for AI agents
Project description
TxVeto
TxVeto is an in-process budget and loop guard for AI agents. It is designed to stop runaway API spend and repeated tool-call loops before the next expensive call is made.
Why TxVeto
Agentic systems fail fast when guardrails are missing. A prompt injection, loop bug, or tool misuse can trigger expensive cascades in minutes.
TxVeto adds runtime safety primitives you can enforce locally:
- Hard budget ceilings per run
- Max-step loop circuit breakers
- Repeated tool-call detection
- MCP policy controls for guarded tool execution
What's included
txveto.guard.VetoGuardfor budget and loop enforcementtxveto.errorsfor typed safety exceptionstxveto.policy.BudgetPolicyfor MCP policy configuration- A browser playground in
txveto.web_demo - A JSON-RPC MCP server wrapper in
txveto.mcp_server - Pytest coverage for wallet-drain and infinite-loop scenarios
Install
Local development
pip install -e .[dev]
pytest
Package usage
# after publish
pip install txveto
Quick Start
python -m txveto.demo --mode both
python -m txveto.web_demo
Installed console scripts:
txveto-demo --mode bothtxveto-web-demotxveto-mcp
Python API Example
from txveto.guard import VetoGuard
guard = VetoGuard(max_usd=0.50, max_steps=10)
with guard:
guard.inspect_step(
model="claude-3-5-sonnet",
input_tokens=50_000,
output_tokens=2_000,
tool_name="fetch_web_data",
)
MCP Tools
The MCP server exposes policy-aware tools for inspection and runtime configuration. budget.configure updates the active per-session policy, budget.status returns the current spend and policy snapshot, and policy.evaluate lets clients simulate a step before executing it.
Launch Artifacts
- Changelog:
CHANGELOG.md - Release checklist:
RELEASE_CHECKLIST.md
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file txveto-0.1.0.tar.gz.
File metadata
- Download URL: txveto-0.1.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abf755b2202bf29635992c243af84cadf4d28bca61556c33c71e32477bbaece1
|
|
| MD5 |
8858dbc2329025c6c08a181bd8ba0240
|
|
| BLAKE2b-256 |
05866553936e109868642267916ca732879350ad6e7a1e0e69f91999375c4870
|
File details
Details for the file txveto-0.1.0-py3-none-any.whl.
File metadata
- Download URL: txveto-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f68c6bcb110149443cf20d63803df70d08276fe89baebfd96d204c0120ce34b
|
|
| MD5 |
b8bae9b770a62c2d2ca0b85e6bc619e9
|
|
| BLAKE2b-256 |
278a3731316e488390cc526a2d3ffde0891c1d3a1c85e357bdd5486469f6153e
|