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.2.tar.gz (17.2 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.2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: veto_pay-0.6.2.tar.gz
  • Upload date:
  • Size: 17.2 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.2.tar.gz
Algorithm Hash digest
SHA256 60960c86d7dea17cf1cb0551b3da27ed87e2a6a43f323b1b6401583d825f5033
MD5 fc0d759d3743d06ae3b33b5be0df4aef
BLAKE2b-256 26783920b9ebd0447239e8f03b7a990850432a93655a7b24be469b68b5f6fd99

See more details on using hashes here.

File details

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

File metadata

  • Download URL: veto_pay-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 19.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2783eb047053c63af22b33a7b1e709ad2b3d2f642c56c827843edb4f65c6340d
MD5 df9984ba32d81257e74e4d38cb09e291
BLAKE2b-256 44d914f25f72cd6f4ba7da9e2d75bafc29bc56a6544e90383fa4f28c6e009c00

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