Skip to main content

rio-receipt-protocol

Cryptographic proof for AI actions. Open standard. Zero required dependencies.

Generate tamper-evident receipts, maintain hash-chained ledgers, and verify AI action audit trails — all with nothing more than the Python standard library.

Installation

pip install rio-receipt-protocol

For Ed25519 signature support (optional):

pip install rio-receipt-protocol[signing]

Quick Start

from rio_receipt_protocol import (
    hash_intent, hash_execution, generate_receipt, verify_receipt, create_ledger
)

# 1. Hash the intent
intent_hash = hash_intent(
    intent_id="i-001",
    action="send_email",
    agent_id="agent-1",
    parameters={"to": "user@example.com", "subject": "Hello"},
    timestamp="2026-04-01T00:00:00.000Z",
)

# 2. Hash the execution
execution_hash = hash_execution(
    intent_id="i-001",
    action="send_email",
    result="sent",
    connector="smtp",
    timestamp="2026-04-01T00:00:01.000Z",
)

# 3. Generate a receipt
receipt = generate_receipt(
    intent_hash=intent_hash,
    execution_hash=execution_hash,
    intent_id="i-001",
    action="send_email",
    agent_id="agent-1",
)

# 4. Verify it
result = verify_receipt(receipt)
assert result["valid"] is True

# 5. Append to a tamper-evident ledger
ledger = create_ledger()
entry = ledger.append(
    intent_id="i-001",
    action="send_email",
    agent_id="agent-1",
    status="executed",
    detail="Email sent",
    receipt_hash=receipt["hash_chain"]["receipt_hash"],
)

# 6. Verify the chain
chain = ledger.verify_chain()
assert chain["valid"] is True

API Reference

The Python package mirrors the Node.js API exactly:

Function Description
sha256(data) SHA-256 hash of a string
hash_intent(...) Hash an intent object
hash_execution(...) Hash an execution record
hash_governance(...) Hash a governance decision (optional)
hash_authorization(...) Hash an authorization record (optional)
generate_receipt(...) Generate a v2.2 receipt
verify_receipt(receipt) Verify a receipt's hash chain
create_ledger(file_path=None) Create a tamper-evident ledger
verify_receipt_standalone(receipt) Independent receipt verification
verify_chain(entries) Verify a ledger hash chain
verify_receipt_batch(receipts) Batch-verify multiple receipts

License

Dual-licensed under MIT and Apache 2.0.

Metadata

Release files for rio-receipt-protocol 2.3.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 rio-receipt-protocol 2.3.0
File Size Uploaded Provenance Actions
rio_receipt_protocol-2.3.0.tar.gz 11.2 kB Without provenance Details for rio_receipt_protocol-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rio-receipt-protocol 2.3.0
File Interpreter ABI Platform Actions
rio_receipt_protocol-2.3.0-py3-none-any.whl Python 3 none any Details for rio_receipt_protocol-2.3.0-py3-none-any.whl

Total release size: 20.7 kB

Release files / rio_receipt_protocol-2.3.0.tar.gz

Download URL rio_receipt_protocol-2.3.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7d4c27cb6a2648d64788d20abfd32e3d40e05ae515516520b94080eb754b4044
BLAKE2b-256 checksum
How to use checksums
e43b279de3a7eb569a759d77b23c6b66f2e54766c5a6a77ac5077c04dfe2ee2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / rio_receipt_protocol-2.3.0-py3-none-any.whl

Download URL rio_receipt_protocol-2.3.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf6acc16644c29fb52baea026cba0eee06f40a800066f8010d1f7bb13587f746
BLAKE2b-256 checksum
How to use checksums
d68cb5cf56f601143829f4fac81c719f5f11df021d73e37c80f466f966fdac40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Security for rio-receipt-protocol 2.3.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

2.3.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