Skip to main content

FideRail Python SDK

Non-custodial AI Agent payment control plane, pre-flight risk firewall, anti-sybil trust client, and concurrent SQLite WAL edge ledger.

  • Zero third-party dependencies (Python standard library only, Python >= 3.9)
  • 100% non-custodial (never holds private keys, session keys, or user funds)
  • 4 Chains x 2 Stablecoins: Base (USDC, EURC), Solana (USDC, USDT), Arbitrum (USDC, USDT0), and Polygon (USDC, USDT)
  • PEP 561 typed (py.typed included)

Installation

pip install fiderail

Quickstart

Pre-Flight Payment Guard & Trust Lookup

from fiderail import FideRailClient

client = FideRailClient(
    "https://api.fiderail.com",
    ledger_path="./edge-ledger.db",
    on_outage="fail-closed",
)

try:
    profile = client.get_trust("base", "0x7284d41b5b852f2bd4c99bdf95043d84452d299c")
    verdict = client.preflight_guard(
        chain="base",
        counterparty="0x7284d41b5b852f2bd4c99bdf95043d84452d299c",
        amount_usdc=0.05,
        policy={"maxSingleTxUsdc": 1.0, "maxDailyUsdc": 10.0, "minTrustScore": 40},
    )
    print(verdict["decision"], verdict["reasons"])
finally:
    client.close()

Guarded x402 Request

guarded_x402_request scans outbound requests for leaked secrets, checks the endpoint circuit breaker, parses HTTP 402 payment challenges, enforces host/agent policy clamps and mandate attenuation chains, reserves atomic daily budget holds in SqliteSpendLedger, and generates verifiable fiderail-sar-v2 delivery receipts.

result = client.guarded_x402_request(
    "https://api.example.com/paid-endpoint",
    preferred_chain="base",
    policy={"maxSingleTxUsdc": 0.25, "maxDailyUsdc": 5.0, "allowedAssets": ["USDC"]},
    signer=lambda option, guard: my_wallet_sign_x402(option),
)

Omit signer to run a dry-run pre-flight check without executing a payment.

Included Modules & Helpers

  • FideRailClient: get_health, get_trust, get_history, list_agents, discover_services, diagnose_endpoint, preflight_guard, guarded_x402_request, report_delivery_telemetry
  • SqliteSpendLedger: concurrent WAL-mode daily budget reservations, idempotency window, endpoint circuit breaker, mandate revocation/spend tracking, and TTL trust cache
  • Policy & cryptography helpers: clamp_policy, scan_outbound_secrets, validate_mandate_chain, create_salted_receipt_v2, verify_salted_receipt_v2, canonicalize_jcs, hash_jcs, parse_x402_challenge
  • Network registry: CHAIN_SPECS, ALL_CHAIN_KEYS, normalize_chain_name, normalize_chain_address, is_valid_address, get_asset_spec, get_primary_asset

License

MIT

Metadata

Release files for fiderail 2.3.1

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

Source distribution (sdist)

Source distribution for fiderail 2.3.1
File Size Uploaded Provenance Actions
fiderail-2.3.1.tar.gz 24.3 kB Without provenance Details for fiderail-2.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 45.3 kB

Release files / fiderail-2.3.1.tar.gz

Download URL fiderail-2.3.1.tar.gz
Size 24.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3bfe63ef1eed39e3bca732337057324269b0c641001c16d7f519d256ffe059e1
BLAKE2b-256 checksum
How to use checksums
b7390fd21ebc463bd64980031dd1fddd30c51126d8ba7401956792cdac2e7918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / fiderail-2.3.1-py3-none-any.whl

Download URL fiderail-2.3.1-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a275ede8c7c8506121fbaae841eaf3c34cee93e7bce4f96b659f8306e43debf
BLAKE2b-256 checksum
How to use checksums
53e59a4fee4b0c8e836e893166f3602296a844d6279a65113d3edf3bff340351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for fiderail 2.3.1

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.

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