Skip to main content

HDP (Human Delegation Provenance) — cryptographic authorization provenance for LlamaIndex agents

Project description

llama-index-callbacks-hdp

HDP (Human Delegation Provenance) integration for LlamaIndex — cryptographic authorization provenance for agents and RAG pipelines.

HDP answers the question that observability tools like Arize Phoenix and Langfuse cannot: who authorized this agent run, under what scope, and can you prove it offline?

Every tool call, retrieval step, and LLM invocation is recorded in a tamper-evident, cryptographically signed delegation chain. The chain is fully verifiable offline — no network calls, no central registry.

Installation

pip install llama-index-callbacks-hdp

Usage

Option 1 — Modern instrumentation dispatcher (LlamaIndex ≥0.10.20)

from llama_index.callbacks.hdp import HdpInstrumentationHandler, HdpPrincipal, ScopePolicy

HdpInstrumentationHandler.init(
    signing_key=ed25519_private_key_bytes,
    principal=HdpPrincipal(id="alice@corp.com", id_type="email"),
    scope=ScopePolicy(
        intent="Research pipeline",
        authorized_tools=["web_search", "retriever"],
        max_hops=10,
    ),
    on_token_ready=lambda token: print(token["header"]["token_id"]),
)

Option 2 — Legacy CallbackManager

from llama_index.callbacks.hdp import HdpCallbackHandler, HdpPrincipal, ScopePolicy
from llama_index.core import Settings
from llama_index.core.callbacks import CallbackManager

handler = HdpCallbackHandler(
    signing_key=ed25519_private_key_bytes,
    principal=HdpPrincipal(id="alice@corp.com", id_type="email"),
    scope=ScopePolicy(intent="Research pipeline"),
)
Settings.callback_manager = CallbackManager([handler])

Option 3 — Node postprocessor (inline retrieval enforcement)

from llama_index.callbacks.hdp import HdpNodePostprocessor

postprocessor = HdpNodePostprocessor(
    signing_key=ed25519_private_key_bytes,
    strict=False,
    check_data_classification=True,
)
query_engine = index.as_query_engine(node_postprocessors=[postprocessor])

Verifying a token

from llama_index.callbacks.hdp import verify_chain

result = verify_chain(token_dict, public_key_bytes)
if result.valid:
    print(f"Chain verified: {result.hop_count} hops")

What makes HDP different from Arize/Langfuse?

Capability Arize / Langfuse HDP
Records what happened
Records who authorized it
Cryptographically signed
Verifiable offline
Scope enforcement
No central registry n/a

License

Apache-2.0

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

llama_index_callbacks_hdp-0.1.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

llama_index_callbacks_hdp-0.1.1-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_callbacks_hdp-0.1.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_callbacks_hdp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 17bb818189dada5f1f1cbaa1ae93f75b7b8d9b96867fa62b4199a9cdd426b128
MD5 e6d59389bee380485e6345d6e6aa2876
BLAKE2b-256 27b9af339c13cda62e98cb984ff22abd13d6e5b27cbe632d273a6b80d5b76a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_callbacks_hdp-0.1.1.tar.gz:

Publisher: release.yml on Helixar-AI/HDP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llama_index_callbacks_hdp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_callbacks_hdp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2b65adbf025284c1d508b700a6cc5cddaab31f91ef37fd0e02645749e71679a
MD5 2f41c2f230875b1d25d507d1e92c25d6
BLAKE2b-256 c97fb440cb6aa873c5358fa556e4bd1bf99ee2ff1d67bfbf3cc41dcbe23a012d

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_callbacks_hdp-0.1.1-py3-none-any.whl:

Publisher: release.yml on Helixar-AI/HDP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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