Ed25519 signed receipts for LlamaIndex agent tool calls
Project description
scopeblind-llamaindex
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:
on_event_start: captures tool name + args, evaluates policyon_event_end: signs the decision (allow/deny) with Ed25519, chains to previous receipt- Receipt is appended to the chain with
tool_input_hashandoutput_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da19143987bab606e207e779cdb304ef8009e149c19f2127111828cc5e7ec88e
|
|
| MD5 |
e81d3d9d966c7c8971ac5e03184fab3d
|
|
| BLAKE2b-256 |
a975e8f23254263a3b4169aa8409b96ed45faae645633b7ac6d68e302107cb98
|
File details
Details for the file scopeblind_llamaindex-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scopeblind_llamaindex-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1ba62283a83df061a34ea0290676a0426559766e001c78cdf9cff1c620c80af
|
|
| MD5 |
a66c5445f226fa842b5b71e683948896
|
|
| BLAKE2b-256 |
d08032221ecce80638b636fe159f5a19efce57c46709c344cadb4619dc2ce788
|