Skip to main content

veralayer (Python)

A payment guard for AI agents on Solana. Before your agent pays, veralayer does three things:

  • Scores the recipient with Vera, using the address's on-chain history.
  • Verifies the signature on that result locally.
  • Applies your spending policy and returns allow, review or block.
pip install veralayer

Guard a payment

from veralayer import VeraGuard, VeraBlockedError, VeraReviewRequiredError

guard = VeraGuard(policy={
    "min_tier": "medium",
    "tier_limits_sol": {"high": 50, "medium": 5},
    "daily_limit_sol": 20,
})

try:
    guard.authorize(to=recipient, amount_sol=1.5)   # raises unless allowed; records the spend
    send_sol(recipient, 1.5)                        # your existing code
except (VeraBlockedError, VeraReviewRequiredError) as e:
    print(e.decision["findings"])

To decide without recording anything, call guard.evaluate_payment(to, amount_sol). It returns {"action", "findings", ...}.

Score an address

from veralayer import Vera

vera = Vera()
r = vera.check("AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51")
r["attestation"]["score"], r["attestation"]["tier"]
vera.verify(r)   # {'valid': True, 'expired': False}, checked offline

CLI

veralayer check <address>
veralayer pay <address> 2.5 --min-tier medium --daily 20

Policy

The policy fields, defaults and finding codes are the same as in the JavaScript package, with the field names in snake_case. The policy engine is pure, so you can call evaluate_policy(outflows, recipients, spent_today_sol, policy) directly.

Field Default
min_tier "medium"
tier_limits_sol {"high": inf, "medium": 5, "low": 0}
max_sol_per_tx none
daily_limit_sol none
token_limits none
allow []
deny []
on_unknown "review"
on_check_error "block"

Trust

Results must be signed by Vera's production key, VERA_ISSUER, which is pinned in the package. A result for a different address than the one requested is rejected. NaN or negative amounts block. A policy with a typo raises ValueError. authorize is thread-safe, and release(decision) gives back the amount if the send fails.

Differences from the JavaScript package

  • No transaction decoding (yet). Python agents usually build payments themselves, so the guard works on planned payments: authorize, evaluate_payment and evaluate_outflows.
  • One dependency: cryptography, used for ed25519.

Docs: https://veraagent.io/docs · MIT · by VeraLayer

Metadata

Release files for veralayer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for veralayer 0.1.0
File Size Uploaded Provenance Actions
veralayer-0.1.0.tar.gz 11.9 kB Without provenance Details for veralayer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for veralayer 0.1.0
File Interpreter ABI Platform Actions
veralayer-0.1.0-py3-none-any.whl Python 3 none any Details for veralayer-0.1.0-py3-none-any.whl

Total release size: 24.6 kB

Release files / veralayer-0.1.0.tar.gz

Download URL veralayer-0.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
be93accdfe04712a0627be5ce406174e9507a43f29c3639dcfb798d201ff886e
BLAKE2b-256 checksum
How to use checksums
f8859fcbdb5e8d55af4ef9fbffc7d82b99998e58b6af9822481fe7549a6d8dca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / veralayer-0.1.0-py3-none-any.whl

Download URL veralayer-0.1.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
847f5161a36d1fde00774dab0d27d44c68d6be4ab1eba1303df55efba9763836
BLAKE2b-256 checksum
How to use checksums
1a8edbbe97fdddedc71d0e8ab2cd6de4f7bc43018f2f61570d572a53734765cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for veralayer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page