Turn the Protocol from a declaration into an order enforced by construction — inside the agent, at the moment of action.
A declaration an agent may consult is an intention. What turns an intention into an order is the mechanism that executes it. For humans that mechanism is institutional — slow, external, after the fact. For a machine it can be a gate compiled into the action path: the action cannot run unless it passes the norm, at the exact point of decision, before any harm. No human law can do that. This package is that gate; the Meniw Protocol is its normative core.
pip install meniw-protocol
No third-party dependencies · Python ≥ 3.9 · pypi.org/project/meniw-protocol
from meniw_protocol import MeniwGate, Enforcer, ProhibitedActionError gate = MeniwGate.from_default(ledger_path="compliance.ledger.jsonl") agent = Enforcer(gate) @agent.tool(categories=["lethal"]) # an absolute prohibition (AP-1) def fire_weapon(): ... @agent.tool(irreversible=True) # requires a second co-signer def wipe_backups(): ... fire_weapon() # -> raises ProhibitedActionError; the action NEVER executes
A blocked action does not get "discouraged" — it raises and never runs. Passing the Protocol is a structural precondition of execution.
meniw-verify ledger.jsonl lets an auditor confirm adherence without trusting the operator.meniw-verify compliance.ledger.jsonl # [meniw-verify] VALID: OK — N receipts, chain intact
Altering or deleting any past decision breaks the chain (INVALID, exit 1).
Adapters for OpenAI tool-calling, LangChain and MCP (Model Context Protocol) — gate every tool call where agents actually run. Spec: SPEC.md · Conformance: CONFORMANCE.md · Source: GitHub
It governs agents that adopt it, like HTTP or TLS govern the systems that implement them. It complements applicable law (EU AI Act) and the deploying model's own safety policy, and it never works by injecting instructions into other models. Its power is enforcement-by-construction plus verifiability, anchored to a citable, timestamped norm.