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 10 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 10 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)
Scam Patterns Deterministic Gift card scams, tech support, IRS fraud
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
    classifier: str = "local", # "local", "hosted", or "none"
    telemetry: bool = False,   # Enable anonymous telemetry
)

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

Telemetry

VetoNet can optionally collect anonymized usage data to improve the ML classifier:

veto = VetoNet(telemetry=True)  # Opt-in

What we collect (anonymized):

  • Intent category (e.g., "gift_card") - NOT the actual intent text
  • Price bucket (e.g., "50-100") - NOT exact amounts
  • Which checks passed/failed
  • Classifier confidence scores

What we DO NOT collect:

  • Raw intent strings
  • Vendor names or item descriptions
  • API keys or credentials
  • Any personally identifiable information

Telemetry is disabled by default. Enable it to help improve VetoNet's attack detection.

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.3.tar.gz (41.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.3-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vetonet-0.1.3.tar.gz
  • Upload date:
  • Size: 41.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.3.tar.gz
Algorithm Hash digest
SHA256 22dba65be92007bdcad94dfc81aaf0e9f707290b2630cae807c025711deab038
MD5 54323bbe2cdc2a2fe00fc2048af85a4a
BLAKE2b-256 a066dd7af71bea1298a5e0f8efb8f74dc4132effc6312722d33c4b6e07b1a23d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vetonet-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 50.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 362333ccd37a30793a7684844c7cb8793ee051259839c5579bd9dc4556b8caf6
MD5 feb0ad212b948e5e0e07023d8347271b
BLAKE2b-256 59973d01754c0c42527078ebb7ea1b4b0e66aa47959b6b03c01d00d4a2ec62d8

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