ledgerproof-llamaindex
LedgerProof callback handler for LlamaIndex. Emits cryptographically signed, Bitcoin-anchorable EU AI Act Article 50 transparency receipts for RAG queries, chat sessions, and agent workflows — without modifying your LlamaIndex response payload.
Status: v0.1.0 — MVP. APIs may change before v1.0.
What this is
LedgerProof is an open cryptographic protocol that:
- Emits a signed receipt for every AI-touched interaction.
- Batches receipts into a Merkle tree.
- Anchors the tree root to Bitcoin via OP_RETURN.
- Verifies offline from Bitcoin chain + protocol public key + receipt alone.
This package wires LedgerProof into LlamaIndex via the standard CallbackManager interface. Receipts emit to a side channel (log, queue, or webhook) — your LLM/RAG response is byte-for-byte unchanged.
What this is NOT
Read this carefully before deploying.
- No claim of regulator endorsement. Neither the EU AI Office, ENISA, nor any Member State authority has endorsed this adapter or the LedgerProof protocol.
- No Article 40 presumption of conformity. LedgerProof is not a harmonised standard. Use of this adapter does not create a presumption of conformity with the AI Act.
- Scope is narrow. This adapter provides an evidence layer for Article 50 (transparency obligations for providers and deployers of certain AI systems). It does NOT cover:
- Article 9 (risk management system)
- Article 10 (data and data governance)
- Article 13 (transparency and provision of information to deployers)
- Article 15 (accuracy, robustness, cybersecurity)
- Article 72 (post-market monitoring)
- No LlamaIndex Inc. affiliation. This is an independent integration. LlamaIndex is a registered trademark of LlamaIndex, Inc.
Install
pip install ledgerproof-llamaindex
For the RAG examples:
pip install "ledgerproof-llamaindex[examples]"
5-minute quickstart (RAG)
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
from llama_index.core.callbacks import CallbackManager
from llamaindex_ledgerproof import LedgerProofCallbackHandler
from llamaindex_ledgerproof.emitter import LogEmitter
from llamaindex_ledgerproof.signer import Ed25519Signer
handler = LedgerProofCallbackHandler(
deployer_id="acme-bank-eu",
signer=Ed25519Signer.ephemeral(), # production: HSM-backed
emitter=LogEmitter(),
article="50(1)", # disclosure: user interacting with AI
)
Settings.callback_manager = CallbackManager([handler])
docs = SimpleDirectoryReader("./data").load_data()
index = VectorStoreIndex.from_documents(docs)
query_engine = index.as_query_engine()
response = query_engine.query("What is the refund policy?")
print(response) # response payload is UNCHANGED
# Receipt has been emitted to the configured side channel.
C1–C8 protocol discipline
This adapter respects the LedgerProof protocol invariants:
| Invariant | Enforcement here |
|---|---|
| C1 No regulator-endorsement claims | Documented above; no marketing copy in code paths |
| C4 Local verification only | Adapter never phones home to LedgerProof servers in normal operation |
| C6 Stream-aware signing | Transcript hash committed on event-start, signed on event-end. Streaming bodies are not buffered |
| C7 Side-channel emission | The LlamaIndex response object is never mutated. Receipts emit to log/queue/webhook only |
Emitters
from llamaindex_ledgerproof.emitter import LogEmitter, WebhookEmitter, QueueEmitter
LogEmitter() # writes JSON to a Python logger
WebhookEmitter("https://receipts.acme.eu/v1") # POSTs canonical CBOR
QueueEmitter(my_queue) # puts onto any queue.Queue
Receipt schemas
rag_chatbot_session/v1— Article 50(1) RAG chatbot disclosure with retrieval-context hash.generated_content/v1— Article 50(2) generated-content marking.rag_synthesized_response/v1— Article 50(1) synthesized response with source attribution.
See llamaindex_ledgerproof/schema.py.
Production hardening checklist
The MVP ships with ephemeral signing keys. Before production:
- Replace
Ed25519Signer.ephemeral()with HSM-backed key (AWS KMS / GCP Cloud HSM / on-prem Luna). - Move from
LogEmittertoQueueEmitterorWebhookEmitterwith retry + dead-letter. - Configure your Merkle-batcher + Bitcoin anchorer (separate service; not part of this adapter).
- Run GDPR DPIA on
deployer_idand anysubject_pseudonymfields. - Pin
ledgerproof-llamaindexandllama-index-coreversions in your lockfile.
License
Apache License 2.0. See LICENSE.
Foundation
LedgerProof is stewarded by the LedgerProof Foundation — a US 501(c)(3) Delaware non-profit (in formation) with a Dutch Stichting EU subsidiary (in formation). The protocol specification and reference adapters are open-source.
Contact: engineering@ledgerproof.org
Metadata
Release files for llamaindex-ledgerproof 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llamaindex_ledgerproof-0.1.1.tar.gz | 23.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llamaindex_ledgerproof-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.4 kB
Release files / llamaindex_ledgerproof-0.1.1.tar.gz
| Download URL | llamaindex_ledgerproof-0.1.1.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be5937f6fcbda4f598c69baefa1a861ed1d186b8d402e2d89c4809bd0b80e79b
|
|
BLAKE2b-256 checksum How to use checksums |
ec9ce442bf0255275551b087a1d99ab4a87b26024e4593e05c12abdfc2ef4505
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / llamaindex_ledgerproof-0.1.1-py3-none-any.whl
| Download URL | llamaindex_ledgerproof-0.1.1-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a43914a3a7e8dd8754bf80f29245e754f55fe2646bc229ba33bd245a309db861
|
|
BLAKE2b-256 checksum How to use checksums |
ac3348b398ad3b604b04d600775b746c8405e48a55afc24337ee470ea029b23c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for llamaindex-ledgerproof 0.1.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.