Skip to main content

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 LangChain Tool so 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idprova_agents-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

idprova_agents-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

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

Hashes for idprova_agents-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fec9236e21dad2f8887233e5074760db1731b5ffa28059e3d9a00b677d6cc1fa
MD5 a449c0f3a2dded050a95afa8c261f0e6
BLAKE2b-256 b1bc206109d81c8df4d06d6d8177ee946dd04c99e947821963ddfd4c10c60abc

See more details on using hashes here.

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

Hashes for idprova_agents-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee5b036d8693daa2fa2286fba33b85c8f005b8f003af521ca2a9069809d7f6d0
MD5 1e4b64da37bd6b4c35c3de19f724546b
BLAKE2b-256 f8367019233cd8fa2aa143aacb2a67d10ad4300a53d4e6e42c1b0657c8ef96d5

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