Charavyuha 0.12.0b1
Protecting Python tools
Shield.from_config loads the operator-owned file. Routine tools run after a signed authorization and need no review prompt. Sensitive tools need a second signature from the configured reviewer. Prohibited tools do not run.
Python
import time
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from quaspar_shield import Shield
from quaspar_shield.sample_tools import read_document
shield = Shield.from_config("shield.yaml")
now = int(time.time())
agent = Ed25519PrivateKey.generate()
shield.enroll_agent(shield.config.agent, agent.public_key(), not_before=now, not_after=now + 86400)
protected = shield.protect_tool(read_document, name="read_document")
arguments = {"document_id": "daily-note"}
signed = shield.sign_call("read_document", arguments, agent, workflow="daily", now=now)
print(protected(arguments, signed_request=signed, now=now))protect_tool is the trusted host's check before the handler. It is not an isolation boundary: code in the same process can call the original function or read the host's memory. Use the MCP gateway to put the check in another process.
Source of truth: the package documentation on PyPI .
