Metadata-Version: 2.4
Name: txveto
Version: 0.1.0
Summary: In-process budget and loop guard for AI agents
Author: TxVeto
License-Expression: MIT
Project-URL: Homepage, https://txveto.com
Project-URL: Repository, https://github.com/hedigardi/TxVeto
Project-URL: Issues, https://github.com/hedigardi/TxVeto/issues
Project-URL: Documentation, https://github.com/hedigardi/TxVeto#readme
Keywords: ai,agent,budget,guardrails,mcp,safety,runtime
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"

# 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.VetoGuard` for budget and loop enforcement
- `txveto.errors` for typed safety exceptions
- `txveto.policy.BudgetPolicy` for 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

```bash
pip install -e .[dev]
pytest
```

### Package usage

```bash
# after publish
pip install txveto
```

## Quick Start

```bash
python -m txveto.demo --mode both
python -m txveto.web_demo
```

Installed console scripts:

- `txveto-demo --mode both`
- `txveto-web-demo`
- `txveto-mcp`

## Python API Example

```python
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
