1. Install
z3-solver, httpx, pydantic, jsonschema, and PyYAML. Requires Python 3.11+.
2. Declare a Guard
policyselects the compliance preset ("default","hipaa","sox","legal_privilege").permissionsis the capability ceiling for this guard. A child agent’s permissions must be a subset.budget_centsis the spending ceiling. Each verified call deducts its declared cost.
3. Wrap a tool and call it
@guard.wrap runs guard.verify(...) before the function body. On success the function executes; on a block it raises CertiorBlocked without calling the function.
4. Trigger a block
permissions=["network:http:read"] does not cover filesystem:write, so Z3 returns UNSAT and the wrap raises CertiorBlocked. The function body never ran.
5. Inspect the audit log
verify() (whether via wrap or direct call) appends an entry of shape {tool, allowed, violations: int, pii_count: int, latency_ms, time} to guard.audit_log. The full violations list and the signed VerifiedCertificate itself are on the returned VerifyResult - the audit log keeps only counts and timing.
What’s next
- How it works - the three gates, the Z3 runtime, the Lean policy model.
- Bring your own framework - LangChain, CrewAI, OpenClaw, MCP, or a custom orchestration loop.
- Compliance policies - what HIPAA / SOX /
legal_privilegeactually enforce.