Skip to main content

LedgerProof adapter for Haystack 2.x — side-channel cryptographic receipts for EU AI Act Article 50 transparency.

Project description

ledgerproof-haystack

LedgerProof adapter for Haystack 2.x — side-channel cryptographic receipts for EU AI Act Article 50 transparency.

Apache 2.0 Python 3.10+

ledgerproof-haystack is the official LedgerProof Foundation adapter for Haystack 2.x — the open-source LLM orchestration framework built by deepset GmbH (Berlin). It plugs LedgerProof receipt emission into any Haystack Pipeline as a side-channel observer node, so that every RAG run, every generation, and every editorial review step produces a tamper-evident cryptographic receipt suitable for EU AI Act Article 50 disclosure obligations.


Strategic positioning: German enterprise RAG

Haystack is the de facto RAG orchestration layer in German enterprise (BMW, Siemens, Allianz, SAP-adjacent integrators) and across the broader DACH market. It is also the framework most frequently cited by CEN-CENELEC JTC 21 working participants for AI Act-aligned reference architectures.

This adapter is built to slot directly into existing Haystack 2.x pipelines without rewriting orchestration code — and it produces receipts that align to the rag_pipeline_session/v1 schema, the generated_content/v1 schema (Article 50(2) AI-generated content), and the editorial_pipeline_review/v1 schema (Article 50(4) public-interest text).


Article 50 obligation coverage

Obligation LedgerProof schema Haystack hook
50(1) — User-facing AI disclosure rag_pipeline_session/v1 Pipeline-level component
50(2) — AI-generated content marking generated_content/v1 Generator wrapper
50(4) — Editorial review for public-interest text editorial_pipeline_review/v1 Editorial pipeline node
Per-node trace (any component) haystack_node_receipt/v1 @component decorator

Installation

pip install ledgerproof-haystack

Requires Python 3.10+, haystack-ai>=2.0, cryptography>=41, cbor2>=5.0, pydantic>=2.0.


Quickstart

from haystack import Pipeline
from haystack.components.generators import OpenAIGenerator
from haystack_ledgerproof import LedgerProofComponent, load_or_generate_signing_key

key = load_or_generate_signing_key()

pipeline = Pipeline()
pipeline.add_component("llm", OpenAIGenerator(model="gpt-4o-mini"))
pipeline.add_component(
    "ledgerproof",
    LedgerProofComponent(
        signing_key=key,
        schema="generated_content/v1",
        deployer="acme-bank-de",
    ),
)
pipeline.connect("llm.replies", "ledgerproof.content")

result = pipeline.run({"llm": {"prompt": "Erklären Sie GDPR Artikel 7."}})
print(result["ledgerproof"]["receipt_id"])

The receipt is emitted as a side channel — the LLM reply itself is untouched. Verifiers download the public key from your Foundation-published location and validate the signature locally.


Design constraints (Foundation-mandated)

This adapter is governed by the LedgerProof Foundation constraint matrix. The following constraints are enforced in code:

  • C1 — No regulator endorsement, no Article 40 presumption. This software does not constitute legal advice, does not assert presumption of conformity under Article 40 of Regulation (EU) 2024/1689, and is not endorsed by the European Commission, the AI Office, ENISA, or any national competent authority.
  • C4 — Local verification only. No verifier network calls. All cryptographic verification happens locally against the signing public key. No phone-home, no telemetry.
  • C6 — Stream-aware signing. Streaming generators are supported via incremental hashing through lpr_pipeline_callback; receipts are emitted once the stream closes.
  • C7 — Side-channel emission. Receipts are emitted to the side-channel sink (filesystem, S3, OTel, your own emitter). The user-facing model output is never modified.

GDPR posture

The adapter does not transmit prompt content or generation output off-host by default. The default emitter writes a CBOR-encoded receipt to a configurable local path. The receipt contains a SHA-256 hash of the input/output, not the plaintext. If you choose to enable a payload-bearing schema field, the adapter runs Pydantic validators that refuse fields containing apparent PII (email, IBAN, BIC, German Steuer-ID, national ID patterns) unless gdpr_lawful_basis is explicitly set.


Foundation governance

This adapter is published by the LedgerProof Foundation (Stichting LedgerProof, Amsterdam, NL) — an independent non-profit. It is not a product of any single AI vendor. Issues and PRs at the Foundation repo.


License

Apache License 2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haystack_ledgerproof-0.1.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haystack_ledgerproof-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file haystack_ledgerproof-0.1.0.tar.gz.

File metadata

  • Download URL: haystack_ledgerproof-0.1.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for haystack_ledgerproof-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1d8087c339f006ae7a1adafc373ee27d80dc2003070c8501080541e858fbaf2
MD5 5f1f8294484cc310af7fc2a635d89148
BLAKE2b-256 8ca14c73402ef1042ba3d4ca8ce65f5a5fa019f7ba971c4b7d838119747920f5

See more details on using hashes here.

File details

Details for the file haystack_ledgerproof-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for haystack_ledgerproof-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c2d5c3dcfe1201adc92ccd8ed1d84f894e5633055c781d686fee3ae31d8c2f0
MD5 84997db69bad78c8d1d6fe35486435fb
BLAKE2b-256 2182f0ad992ec36d4d1d6982314ad1ebe50e20fb15153b0b5b3d67a34d0baa0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page