veto
Python policy runtime for AI agent tool calls. Veto wraps your tools, evaluates deterministic policy before each handler runs, and preserves the original tool interface.
Install
pip install veto
With provider extras:
pip install veto[openai]
pip install veto[anthropic]
pip install veto[gemini]
pip install veto[all]
Quick start
from veto import protect
safe = await protect(tools)
agent = create_agent(tools=safe)
protect(tools) is the public entrypoint. It loads ./veto/veto.config.yaml and ./veto/rules/*.yaml when present. Without local policy or explicit options, it uses the built-in @veto/safe-defaults pack in observe mode: suspicious destructive shell, file, database, or money-movement network patterns are warned/logged, not blocked.
TypeScript parity
import { protect } from "veto-sdk";
const safeTools = await protect(tools);
const agent = createAgent({ tools: safeTools });
Local policy
veto init
rules:
- id: limit-transfers
name: Limit large transfers
enabled: true
severity: high
action: block
tools: [transfer_funds]
conditions:
- field: arguments.amount
operator: greater_than
value: 1000
Actions are block, allow, warn, log, and require_approval.
API
protect(tools, **kwargs)
from veto import protect
safe = await protect(tools)
Explicit policy source example:
safe = await protect(
tools,
rules=[
{
"id": "no-prod-deploy",
"name": "Block direct production deploys",
"enabled": True,
"severity": "critical",
"action": "block",
"tools": ["deploy"],
"conditions": [
{"field": "arguments.environment", "operator": "equals", "value": "production"}
],
}
],
mode="strict",
)
Advanced: Veto.init() + .wrap()
Veto.init() remains supported for advanced/internal-facing integrations that need a reusable instance, direct guard() calls, event hooks, audit export, or explicit self-host/cloud configuration.
from veto import Veto, VetoOptions
veto = await Veto.init(VetoOptions(config_dir="./veto", mode="strict"))
safe = veto.wrap(tools)
result = await veto.guard("transfer_funds", {"amount": 1500})
Decision history
stats = veto.get_history_stats()
json_audit = veto.export_decisions("json")
csv_audit = veto.export_decisions("csv")
Decision export is local to your process unless you explicitly configure a remote endpoint.
Policy packs
Built-in packs include @veto/safe-defaults, @veto/coding-agent, @veto/financial, @veto/browser-automation, @veto/data-access, @veto/communication, and @veto/deployment.
Self-host / BYOC boundary
The SDK can point at a self-hosted PDP with endpoint, but customer-plane data stays in the customer environment unless you explicitly configure outbound integrations. Customer policy, decision rows, tool args, agent IDs, user IDs, Slack content, prompts, environment variables, and secrets do not cross to Plaw.
License
Apache-2.0
Metadata
Release files for veto 0.15.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| veto-0.15.2.tar.gz | 188.6 kB | Without provenance | Details for veto-0.15.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| veto-0.15.2-py3-none-any.whl | Python 3 | none | any | Details for veto-0.15.2-py3-none-any.whl |
Total release size: 333.0 kB
Release files / veto-0.15.2.tar.gz
| Download URL | veto-0.15.2.tar.gz |
|---|---|
| Size | 188.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8009fc6233cecc70febda9dcc980199bb3fc579ac660e0dbb6e6f4d72032fb9
|
|
BLAKE2b-256 checksum How to use checksums |
68082bc0699e6eb6c20e7ec9490418d963bf6cb05590e84aecb9ccecdc1a45e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / veto-0.15.2-py3-none-any.whl
| Download URL | veto-0.15.2-py3-none-any.whl |
|---|---|
| Size | 144.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e6f119ec87c04ac6581545a4562067c1fb4b84647f5f3674ca8e8cad825b2ec
|
|
BLAKE2b-256 checksum How to use checksums |
6d6e2a14932b10c37d98c567650a602facd165738cc9164371a84303afc34139
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for veto 0.15.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.