Real-time governance and human-in-the-loop approval for AI agents.
Project description
Veto SDK
🛡️ Stop AI Agents from going rogue. Add comprehensive governance and human-in-the-loop approval to your AI agents with one line of code.
Installation
pip install veto2
Quick Start
1. Initialize SDK
import veto2 as sdk
# Initialize with your API key (get from Dashboard → Settings)
sdk.init(
api_key="sk_live_...",
agent_name="MyAgent"
)
2. Protect Your Functions
@sdk.guard()
def delete_user(user_id):
# Your code here
db.delete(user_id)
return "Deleted"
# Function is now protected by Veto governance
3. Configure Policy in Dashboard
Navigate to Dashboard → Tools and configure the governance mode for your function:
- 🔴 BLOCK - Deny execution
- 🔵 SHADOW - Allow but log
- 🟡 HUMAN_APPROVAL - Require manual approval
- 🟣 MASKING - Redact PII in logs
- 🟠 FEEDBACK - Return helpful error messages
Policy Modes
All policy modes are configured via the Dashboard, not in code.
🔴 BLOCK Mode
Denies execution immediately.
@sdk.guard()
def dangerous_operation():
# Will raise PermissionDeniedError if policy is set to BLOCK
pass
🔵 SHADOW Mode
Allows execution but logs as warning. Perfect for monitoring.
@sdk.guard()
def beta_feature():
# Executes normally, logged in Activity Feed
pass
🟡 HUMAN_APPROVAL Mode
Pauses execution until approved via Dashboard.
@sdk.guard()
def large_refund(amount):
# SDK waits here for approval
return f"Refunded ${amount}"
The SDK will:
- Send request to backend
- Poll every 2 seconds
- Continue when approved
- Raise error if rejected
🟣 MASKING Mode
Redacts sensitive data in logs, uses original for execution.
Configure privacy fields in Dashboard:
- Privacy fields:
email, ssn, credit_card
@sdk.guard()
def send_notification(email, message):
# Email masked in audit logs as "***REDACTED***"
# Original email used for actual execution
return f"Sent to {email}"
🟠 FEEDBACK Mode
Returns helpful error message instead of just blocking.
@sdk.guard()
def sensitive_operation(data):
# Raises helpful error with guidance
pass
API Reference
sdk.init()
Initialize the SDK with your credentials.
sdk.init(
api_key: str, # Required: Your API key
agent_name: str, # Required: Agent identifier
base_url: str = None # Optional: Custom backend URL
)
@sdk.guard()
Decorator to protect functions with governance policies.
@sdk.guard(name: str = None)
# Parameters:
# - name: Optional custom tool name (default: function name)
Example:
@sdk.guard(name="user_deleter")
def delete_user(id):
db.delete(id)
sdk.ping()
Test connection to Veto backend.
if sdk.ping():
print("✅ Connected!")
else:
print("❌ Connection failed")
Dashboard Usage
Tools Page
Configure each tool's governance mode:
- Navigate to Tools
- Find your tool (auto-discovered on first use)
- Click Configure
- Select mode and privacy fields
- Click Save
Action Center
Approve/reject pending requests:
- Navigate to Dashboard
- See pending requests in Action Center
- Review parameters
- Click ✅ Approve or ❌ Reject
Activity Feed
Monitor all agent actions with color-coded status badges.
Best Practices
✅ Initialize once at application startup, not per request
✅ Use descriptive names for tools
✅ Set appropriate modes for different risk levels
✅ Handle errors gracefully with try/except
Example: Complete Application
import veto2 as sdk
import os
# Initialize SDK
sdk.init(
api_key=os.getenv("VETO_API_KEY"),
agent_name="CustomerSupportBot"
)
# Protect sensitive operations
@sdk.guard()
def issue_refund(customer_id, amount):
"""Requires HUMAN_APPROVAL in production"""
# Process refund
return {"status": "success", "amount": amount}
@sdk.guard()
def send_email(email, message):
"""Uses MASKING to redact email in logs"""
# Send email
return f"Sent to {email}"
@sdk.guard()
def view_customer_data(customer_id):
"""SHADOW mode for monitoring"""
# Return customer data
return {"id": customer_id, "name": "John Doe"}
# Use functions normally
try:
view_customer_data("123")
send_email("user@example.com", "Hello")
issue_refund("123", 50.00) # Waits for approval
except sdk.PermissionDeniedError as e:
print(f"Action blocked: {e}")
Error Handling
from veto2 import PermissionDeniedError
@sdk.guard()
def risky_action():
pass
try:
risky_action()
except PermissionDeniedError as e:
print(f"Action blocked: {e}")
# Handle gracefully
Billing & Limits
Basic Plan (Free)
✅ 2 distinct tools
✅ 1,000 logs/month
✅ All policy modes
❌ Slack integration
Pro Plan
✅ Unlimited tools
✅ Unlimited logs
✅ Slack notifications
✅ Priority support
Support
- Documentation: Full docs at
/docsin Dashboard - Dashboard: veto.example.com
- Email: support@veto.example.com
Built for secure AI agent deployment | © 2026 Veto
Project details
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 veto2-0.1.1.tar.gz.
File metadata
- Download URL: veto2-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e13a820b3c01c0145a4ac6e459b1754c1179f404991d387ad563fa3a62311d1c
|
|
| MD5 |
dc9654fd962f67468c3a9c1be93e6616
|
|
| BLAKE2b-256 |
6ac32ed1a6b011e3e340711527c9772eabd1a810824d6e4e646db654a8715182
|
File details
Details for the file veto2-0.1.1-py3-none-any.whl.
File metadata
- Download URL: veto2-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8d3dd2e57030ec0d029117bcac9086903adbeb63cb2f35f9627fc34d2ebae50
|
|
| MD5 |
59869fba4105645ca26f04ddd2cff5d9
|
|
| BLAKE2b-256 |
c5f46b0b10b8add8b4ef7d73a63ea0431730583c289c38c8fb05ceb6e08f2842
|