Verifiable, scope-gated tool execution for AI agent frameworks (IDProva)
Project description
idprova-agents
Verifiable, scope-gated tool execution for AI agent frameworks.
idprova-agents wraps your agent's tool calls with a scope gate (the agent
may only call tools its delegation token permits) and writes a signed,
hash-chained receipt for every call — allowed or denied. Receipts verify
independently with the idprova CLI (idprova receipt verify receipts.jsonl),
so the audit trail does not depend on trusting the agent or this library.
Part of the IDProva project.
Install
Not yet on PyPI. Install from the repository:
pip install "idprova-agents[langchain] @ git+https://github.com/techblaze-au/idprova#subdirectory=sdks/python-agents"
Or, from a clone:
pip install "./sdks/python-agents[langchain]"
Quickstart
See examples/langchain/quickstart.py
for a runnable end-to-end demo (allow an in-scope tool, block an out-of-scope
tool, emit verifiable receipts).
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from langchain_core.tools import Tool
from idprova_agents import ToolGuard, guarded_tool
SCOPES = {"knowledge_base_search": "mcp:tool:knowledge-base:read"}
guard = ToolGuard(
aid="did:aid:co:support-agent",
dat="dat-...",
signing_key=Ed25519PrivateKey.generate(),
scope_for_tool=lambda name: SCOPES.get(name, "mcp:tool:unknown:none"),
granted_scopes=["mcp:tool:knowledge-base:read"],
receipts_path="receipts.jsonl",
)
kb = guarded_tool(Tool.from_function(
func=your_kb_search, name="knowledge_base_search", description="Search the KB"), guard)
kb.invoke("quantum computing") # runs + writes a "success" receipt
What's included
ToolGuard— scope check + signed receipt emission.guarded_tool()— wrap a LangChainToolso its execution is scope-gated.IDProvaGuardCallbackHandler— LangChain callback handler (enforce or audit-only).
Adapters for additional frameworks (CrewAI, AutoGen) are planned as optional extras.
Licence
Apache-2.0.
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 idprova_agents-0.1.0.tar.gz.
File metadata
- Download URL: idprova_agents-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fec9236e21dad2f8887233e5074760db1731b5ffa28059e3d9a00b677d6cc1fa
|
|
| MD5 |
a449c0f3a2dded050a95afa8c261f0e6
|
|
| BLAKE2b-256 |
b1bc206109d81c8df4d06d6d8177ee946dd04c99e947821963ddfd4c10c60abc
|
File details
Details for the file idprova_agents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: idprova_agents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee5b036d8693daa2fa2286fba33b85c8f005b8f003af521ca2a9069809d7f6d0
|
|
| MD5 |
1e4b64da37bd6b4c35c3de19f724546b
|
|
| BLAKE2b-256 |
f8367019233cd8fa2aa143aacb2a67d10ad4300a53d4e6e42c1b0657c8ef96d5
|