Skip to main content

Ed25519 signed receipts for LlamaIndex agent tool calls

Project description

scopeblind-llamaindex

PyPI License: MIT

Ed25519 signed receipts for LlamaIndex agent tool calls. Every FUNCTION_CALL event produces a tamper-evident, hash-chained receipt verifiable offline.

Install

pip install scopeblind-llamaindex

Quick start

from llama_index.core.callbacks import CallbackManager
from scopeblind_llamaindex import ScopeBlindHandler, ReceiptSigner

signer = ReceiptSigner.generate()
handler = ScopeBlindHandler(signer=signer, agent_name="research-agent")
callback_manager = CallbackManager([handler])

# Attach to any LlamaIndex component
query_engine = index.as_query_engine(callback_manager=callback_manager)
# or
agent = OpenAIAgent.from_tools(tools, callback_manager=callback_manager)

# After execution
print(f"{handler.receipt_count} tool calls signed")
handler.export_receipts("receipts.jsonl")

Verify:

npx @veritasacta/verify receipts.jsonl --key $(python3 -c "from scopeblind_llamaindex import ReceiptSigner; s=ReceiptSigner.generate(); print(s.public_key_hex)")

How it works

The handler listens for CBEventType.FUNCTION_CALL events via LlamaIndex's CallbackManager. On each tool call:

  1. on_event_start: captures tool name + args, evaluates policy
  2. on_event_end: signs the decision (allow/deny) with Ed25519, chains to previous receipt
  3. Receipt is appended to the chain with tool_input_hash and output_hash

Compatible with all LlamaIndex callback integrations (Langfuse, Arize, W&B, etc.) since handlers compose in the CallbackManager.

With a policy

def no_web_scraping(tool_name, args):
    if tool_name == "web_scraper" and "competitor" in str(args):
        return (False, "scraping competitor sites not permitted")
    return (True, None)

handler = ScopeBlindHandler(signer=signer, policy=no_web_scraping)

Standards

  • Ed25519 (RFC 8032), JCS (RFC 8785), IETF draft-farley-acta-signed-receipts

License

MIT

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

scopeblind_llamaindex-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

scopeblind_llamaindex-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scopeblind_llamaindex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 da19143987bab606e207e779cdb304ef8009e149c19f2127111828cc5e7ec88e
MD5 e81d3d9d966c7c8971ac5e03184fab3d
BLAKE2b-256 a975e8f23254263a3b4169aa8409b96ed45faae645633b7ac6d68e302107cb98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scopeblind_llamaindex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1ba62283a83df061a34ea0290676a0426559766e001c78cdf9cff1c620c80af
MD5 a66c5445f226fa842b5b71e683948896
BLAKE2b-256 d08032221ecce80638b636fe159f5a19efce57c46709c344cadb4619dc2ce788

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