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

CC-BY-4.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.0.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.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_callbacks_hdp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c32298a94e28ce1723222ae10221dd69f866314f9b4c8b5e2c54b10cc7bca16
MD5 649244700aa6bc289afaae5fa39c436c
BLAKE2b-256 afec0d3f6713b4626876fb1b5d272bcb2c1f76b94debce016a99a4ded30180ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_callbacks_hdp-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_callbacks_hdp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9668a5763f0f026c6494274957fb6aeb81d652d8aa6be3a0d581fbb8e0f8b6e9
MD5 85def4355bb82db53a94f1d6052e2b38
BLAKE2b-256 be843452a9646387decb8d5c11b374f8170cff8040db85f9b8f2360efca92cca

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_callbacks_hdp-0.1.0-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