Skip to main content

One-line agent payments with Veto enforcement. Any rail.

Project description


Veto



One-line agent payments. Any rail.

pay() — authorize, sign, settle.
Veto runs the policy + risk engine; the rail does the rest.

PyPI license


Install

# Decision-only (no on-chain settlement) — lightest install
pip install veto-pay

# With EVM settlement (Base / Optimism / Arbitrum / Ethereum / Polygon)
pip install veto-pay[evm]

# With Solana settlement
pip install veto-pay[solana]

# Both
pip install veto-pay[all]

Quick start

from veto_pay import pay, VetoDenied

result = await pay(
    url="https://api.weather.x402.io/forecast",
    max_amount="$0.05",
    rail="auto",            # auto | evm | solana
)
print(result.tx_hash)       # on-chain tx hash on success
print(result.receipt)       # signed Veto receipt — verify offline if you want

If Veto denies, you get a typed exception:

try:
    await pay(url=url, max_amount="$10000")
except VetoDenied as e:
    print(e.reason_codes)   # ['AMOUNT_CAP_EXCEEDED']
    print(e.receipt)        # signed receipt explaining the deny

What it does

  1. AuthorizePOST /api/v1/authorize with the spend intent. Veto's 8-stage engine runs (policy / prompt-injection / typosquat / OFAC / address-poisoning / intent / anomaly / baseline / decision).
  2. Branch on decision:
    • deny → raises VetoDenied(reason_codes=...). No tx is made.
    • escalate → raises VetoDenied (escalations require human review before they can settle).
    • allow → continue.
  3. Settle on the rail:
    • EVM: calls VetoGuardedAccount.executeWithMandate(struct, sig, amount) on the agent's smart wallet.
    • Solana: builds a 2-instruction tx (Ed25519 verify + veto_guarded_program::execute_with_mandate) and submits to the Solana RPC.
  4. Returns the receipt + on-chain tx hash.

Configuration

Environment variables (or pass as kwargs):

Variable Required for Description
VETO_API_KEY always Bearer token from the Veto dashboard
VETO_AGENT_ID always UUID of the agent (created by veto agent init)
VETO_BASE_URL optional Override the Veto API base. Default https://veto-ai.com.
WALLET_PRIVATE_KEY EVM + Solana settle Agent's private key. EVM: 0x-hex. Solana: base58.
WALLET_CONTRACT EVM settle The deployed VetoGuardedAccount address. Set by veto agent init.
RPC_URL EVM settle EVM RPC endpoint. Auto-detected from chain= if unset.
SOLANA_RPC_URL Solana settle Solana RPC. Defaults to Devnet.
VETO_GUARDED_PROGRAM_ID Solana settle Program ID of the deployed Solana program.
VETO_RAIL optional evm or solana — overrides the auto detection.

Decision-only mode

For cooperative-mode integrations (no on-chain settlement, just verdict + receipt):

result = await pay(
    url=url, max_amount="$0.05", decision_only=True
)
# result.tx_hash is None; result.decision + result.receipt are populated.

Useful when:

  • The rail handles settlement upstream (e.g., pay.sh's hosted x402 facilitator)
  • You're running a dry-run before flipping enforcement on
  • You're auditing decisions without enforcing them

Tests

pip install -e .[dev,evm,solana]
pytest

Public artifacts

Artifact Repository
This package veto-protocol/veto-pay
Companion JS veto-protocol/veto-pay-js
Veto CLI veto-protocol/veto-cli
EVM contract veto-protocol/contracts
Solana program veto-protocol/solana-program
Off-chain verifier (TS) veto-protocol/mandate-verifier

License

MIT.


One line. Any rail. Safe transactions.
Built by Investech Global LLC · part of the veto-protocol family.

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

veto_pay-0.6.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

veto_pay-0.6.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file veto_pay-0.6.1.tar.gz.

File metadata

  • Download URL: veto_pay-0.6.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for veto_pay-0.6.1.tar.gz
Algorithm Hash digest
SHA256 3b37429c2a8560e41c5bff17738bfaf92bc8da8bcf475d985119a8951e81a960
MD5 9c1fcd0bb3b82e0a2312074c4bc21186
BLAKE2b-256 0958973ae558f37359035c3e42c66ad2064b95d88130c147668f8044b5e67c92

See more details on using hashes here.

File details

Details for the file veto_pay-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: veto_pay-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for veto_pay-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 878690ac0b25f5b47ca941d882c8470b5755b26c70a569e5d7bf80898f809d1c
MD5 ba52b02b67daf4e2d9844f1018d95d0c
BLAKE2b-256 93aaee714a52633812b6743108f8f9bb577936796dd13f5007985374886ca262

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