Skip to main content

Verdifax Python SDK

Cryptographic attestation for AI inference. Three lines: send a payload, get a signed manifest hash you can give to an auditor.

Install

pip install verdifax

Quickstart

import verdifax

receipt = verdifax.attest(
    payload="hello verdifax",
    program_id="a" * 64,
    route_id="route-test",
    registry_record_hash="b" * 64,
)
print(receipt.manifest_hash)

That's it. The receipt's manifest_hash is a 64-char SHA-256 that seals every input, every kernel execution ID, the hardware attestation, the ZK transcript, the formal verifier status, and the final VFA. You can later ask the server to re-derive it from the run's stored manifest with verify_run(receipt.run_id); see Verification.

Configuration

By default the SDK talks to the production API at https://api.verdifax.com. Override with environment variables (for example, to point at a local orchestrator):

export VERDIFAX_API_URL=https://api.verdifax.example.com
export VERDIFAX_API_KEY=your-api-key

Or construct a client explicitly:

from verdifax import VerdifaxClient

client = VerdifaxClient(base_url="https://api.verdifax.example.com", api_key="...")
receipt = client.attest(payload="...", program_id="...", route_id="...", registry_record_hash="...")

Async

import asyncio
from verdifax import AsyncVerdifaxClient

async def main():
    async with AsyncVerdifaxClient() as client:
        receipt = await client.attest(
            payload="hello verdifax",
            program_id="a" * 64,
            route_id="route-test",
            registry_record_hash="b" * 64,
        )
        print(receipt.manifest_hash)

asyncio.run(main())

Verification

Ask the server to re-derive a recorded run's manifest hash and compare it with the recorded seal:

result = client.verify_run(receipt.run_id)
assert result.verified, result

verify_run calls GET /runs/{run_id}/verify with your API key. The server loads the run's stored manifest fields, recomputes the manifest hash from them, and compares it with the hash it recorded when the run was sealed. It does not re-run the pipeline, and it is a check performed by Verdifax. For an independent offline check of the sealed audit bundle, use the open-source verdifax-verify CLI. It recomputes the section hashes, the bundle hash, the pre-anchor digest and the anchored leaf; it does not recompute the manifest hash itself.

verdifax.verify_run(run_id) and AsyncVerdifaxClient.verify_run(run_id) do the same thing.

verify() raises as of 0.6.0

verify() used to call attest() again with the same inputs and compare manifest hashes. That comparison can never match in production: every run seals its own admission clock, nonce, and public-log entry into its manifest hash. It now raises verdifax.UnsupportedOperationError explaining this. Use verify_run(run_id) for a recorded run, or verdifax.research.verify_determinism(...) to check that the pipeline replays deterministically under a pinned clock and nonce.

Request signing

Request signing is optional. A client with no signing key sends the same requests as before.

You can register an Ed25519 public key on your API key, so that each run must also be signed with a private key that only you hold. The key pair is created on your machine, and Verdifax receives only the public key. Signing needs the cryptography package:

pip install "verdifax[signing]"
import verdifax
from verdifax import VerdifaxClient

# Run once, then store private_key as a secret. It is 32 raw bytes.
private_key = verdifax.generate_request_key().private_key

client = VerdifaxClient(signing_key=private_key)
client.register_request_key()  # sends the public key with its proof

# attest, execute, the provider helpers and verify_determinism now sign.
receipt = client.attest(
    payload="first signed attestation",
    program_id="a" * 64,
    route_id="route-test",
    registry_record_hash="b" * 64,
)

client.clear_request_key()  # stops requiring signatures on this API key

AsyncVerdifaxClient takes the same signing_key and has the same two methods. verdifax.attest and the provider helpers accept signing_key= when they build their own client, and verdifax shadow takes --signing-key-file, a file holding the base64 private key.

Registering a key changes that API key for every client that uses it: the server then refuses a run without a valid signature, so every caller on the key needs the private key. Each request carries the time and a fresh random nonce. The server refuses a repeated nonce and a time more than five minutes from its own clock.

The signature shows the holder of the key requested the run. It does not show the key holder accepted the outcome.

import verdifax

receipt = verdifax.attest_claude_response(
    prompt="What is the boiling point of water?",
    response="100 °C at sea level.",
    program_id="a" * 64,
    route_id="claude-route",
    registry_record_hash="b" * 64,
)

There is also verdifax.attest_openai_response(...) with the same signature.

License

MIT

Metadata

Release files for verdifax 0.7.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 verdifax 0.7.0
File Size Uploaded Provenance Actions
verdifax-0.7.0.tar.gz 53.2 kB With provenance Details for verdifax-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 94.7 kB

Release files / verdifax-0.7.0.tar.gz

Download URL verdifax-0.7.0.tar.gz
Size 53.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f3691a6c25fc2ddb9e44f112b2fb9ab0359deb97dbbb963cbda26d99ee7cd5b
BLAKE2b-256 checksum
How to use checksums
8442e17d2cd44b36317e762b7570482f39d0a7a64e3d7bbd5361a35bd9d062dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / verdifax-0.7.0-py3-none-any.whl

Download URL verdifax-0.7.0-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce59bae05d574aa7a8e3d74cee1556547d2f562b42560c88b0b998fa37fe26d1
BLAKE2b-256 checksum
How to use checksums
6923917de6ca99ed04b874e9db693b50ced7ff4c3090a60cdd1363d497a29ab7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for verdifax 0.7.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for verdifax-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

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.7.0 This release

2 release files Full 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