Skip to main content

Semantic Firewall for AI Agent Transactions

Project description

VetoNet

Semantic Firewall for AI Agent Transactions

VetoNet prevents "Intent Drift" when AI agents make purchases on your behalf. It intercepts transactions, compares them against your original intent, and vetoes if something's wrong.

Installation

pip install vetonet

With LLM Providers

pip install vetonet[groq]      # Free hosted LLM
pip install vetonet[anthropic] # Claude
pip install vetonet[ollama]    # Local Ollama (default)

Quick Start

from vetonet import VetoNet

veto = VetoNet()
result = veto.verify(
    intent="$50 Amazon Gift Card",
    payload={"item_description": "Amazon Gift Card", "unit_price": 50, "vendor": "amazon.com"}
)

if result.approved:
    process_payment()
else:
    print(f"Blocked: {result.reason}")

The Problem

AI agents are vulnerable to prompt injection attacks. A user says "buy me a $50 Amazon gift card" but a malicious website tricks the agent into:

  • Buying a $500 item instead
  • Swapping to a different product
  • Adding hidden fees
  • Using a scam vendor
  • Signing up for a subscription

The Solution

VetoNet acts as an independent security layer:

  1. Lock Intent - Extract and lock the user's intent before the agent shops
  2. Intercept - Catch the agent's transaction before execution
  3. Compare - Run 9 security checks (price, vendor, category, semantic match, etc.)
  4. Veto - Block if the transaction drifts from the original intent

Provider Options

Provider Setup Cost Best For
ollama Local install Free Development, privacy
groq API key Free tier Demos, testing
anthropic API key Paid Production
none None Free Deterministic-only mode

Basic Usage (Ollama - Default)

from vetonet import VetoNet

# Requires Ollama running locally with qwen2.5:7b
veto = VetoNet()

result = veto.verify(
    intent="$50 Amazon Gift Card",
    payload={
        "item_description": "Amazon Gift Card - $50 Digital",
        "item_category": "gift_card",
        "unit_price": 50.0,
        "vendor": "amazon.com"
    }
)

print(result.approved)  # True
print(result.reason)    # "All checks passed"

With Groq (Free, No Local Setup)

from vetonet import VetoNet

veto = VetoNet(provider="groq", api_key="your-groq-api-key")
result = veto.verify(intent="...", payload={...})

With Anthropic (Claude)

from vetonet import VetoNet

veto = VetoNet(provider="anthropic", api_key="your-anthropic-api-key")
result = veto.verify(intent="...", payload={...})

Deterministic Only (No LLM)

from vetonet import VetoNet, IntentAnchor

# Skip semantic check, only run deterministic checks
veto = VetoNet(provider="none")

result = veto.verify(
    intent=IntentAnchor(
        item_category="gift_card",
        max_price=50.0,
        core_constraints=["brand:Amazon"]
    ),
    payload={...}
)

Security Checks

VetoNet runs 9 security checks in order (fast to slow):

Check Type What It Catches
Price Deterministic Transaction exceeds budget
Quantity Deterministic Wrong number of items
Category Deterministic Different product type
Currency Deterministic Currency manipulation
Subscription Deterministic Sneaky recurring charges
Hidden Fees Deterministic Service fees, processing fees
Vendor Deterministic Scam domains, brand spoofing
Price Anomaly Deterministic Suspiciously cheap (scam indicator)
Semantic LLM-based Item doesn't match intent constraints

Checks run in order and fail fast - if price check fails, we don't waste time on semantic check.

CLI

# Verify a transaction
vetonet --intent "$50 Amazon Gift Card" \
        --payload '{"item_description": "...", "unit_price": 50}' \
        --provider ollama

# Output as JSON
vetonet -i "..." -p @payload.json --json

# Use with Groq
vetonet -i "$50 Amazon Gift Card" -p @payload.json --provider groq --api-key $GROQ_API_KEY

API Reference

VetoNet

VetoNet(
    provider: str = "ollama",  # "ollama", "groq", "anthropic", "openai", "none"
    model: str = None,         # Override default model
    api_key: str = None,       # API key for hosted providers
    base_url: str = None,      # Custom endpoint URL
)

verify()

result = veto.verify(
    intent: str | IntentAnchor,     # Natural language or structured
    payload: dict | AgentPayload,   # Transaction to verify
) -> VetoResult

VetoResult

result.approved  # bool - True if transaction is safe
result.vetoed    # bool - True if transaction was blocked
result.reason    # str - Explanation
result.checks    # list[CheckResult] - Details of each check

Use Cases

  • Crypto Wallets - Verify agent transactions before signing
  • AI Agent Platforms - Add security layer for autonomous agents
  • Fintech Apps - Fraud prevention for AI-powered spending
  • E-commerce - Protect users from malicious product recommendations

Links

License

MIT

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

vetonet-0.1.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vetonet-0.1.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file vetonet-0.1.0.tar.gz.

File metadata

  • Download URL: vetonet-0.1.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for vetonet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c535648ba2a96416d501ad50e94e153bb77330b7506f8d430b003f107aa0bb6
MD5 6a82f3094909d3f8f10a09a6a95fa2ef
BLAKE2b-256 d497c0bfec345af45a6378e64f26b6383543b47c694831b0923e9d126324f3f6

See more details on using hashes here.

File details

Details for the file vetonet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vetonet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for vetonet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6df614d06d4f7f4d20ac98d7fd06d2d9f72188a6af0c3490acd8177b2630a50c
MD5 4663725d061e0945ab998702635d1ed9
BLAKE2b-256 47aa4dd45b4211cad16ea8a1c217e505734a57b017e8e0e51086b04de0564328

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page