Enforce the Meniw Protocol by construction inside an AI agent: a pre-action gate, a two-person rule for irreversible actions, and verifiable, tamper-evident compliance receipts.
Project description
meniw-protocol — make the Meniw Protocol an order, not an intention
The Meniw Protocol (Chris Meniw, 2026) — DOI 10.5281/zenodo.20481373 · Bitcoin block #952266 · SHA-256
c2b0ee7c…15160c8· CC BY 4.0 · ORCID 0009-0003-4417-1944
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, evaluated at the exact point of decision, before any side effect. No human law can do that.
This package is that gate. The Meniw Protocol is its normative core.
Install
pip install meniw-protocol # or: pip install git+https://github.com/ChrisMeniw/chris-meniw-ai-governance.git#subdirectory=reference-implementation/sdk
No third-party dependencies. Python ≥ 3.9.
Enforcement by construction (the centerpiece)
from meniw_protocol import MeniwGate, Enforcer, ProhibitedActionError
gate = MeniwGate.from_default(ledger_path="compliance.ledger.jsonl", hmac_key=b"secret")
agent = Enforcer(gate)
@agent.tool(categories=["lethal"]) # an absolute prohibition (AP-1)
def fire_weapon(): ...
@agent.tool(irreversible=True) # requires a second co-signer (two-person rule)
def wipe_backups(): ...
fire_weapon() # -> raises ProhibitedActionError; never executes
wipe_backups(_gov={"cosigners": ["alice"]}) # -> raises (one signer is not enough)
wipe_backups(_gov={"cosigners": ["alice","bob"]}) # -> runs, and is recorded
A blocked action does not "get discouraged" — it raises and never runs. Passing the Protocol is a structural precondition of execution. That is the difference between a manifesto and a kernel.
Verifiable, tamper-evident compliance
Every decision (allow or block) is written to an append-only hash-chain anchored to the norm's SHA-256. Anyone can verify it — no need to trust the operator:
meniw-verify compliance.ledger.jsonl
# [meniw-verify] VALID: OK — 4 receipts, chain intact
Altering or deleting any past decision breaks the chain (INVALID, exit code 1). This is what
an auditor, a regulator, a customer or an insurer can check to confirm the agent really weighed
each action against the Protocol before acting.
Where it plugs in (adapters)
from meniw_protocol.adapters import guard_openai_tool_call, governed_tool, guard_mcp_call
- OpenAI tool-calling — gate a model-chosen tool call before dispatch.
- LangChain — wrap any tool so its invocation must pass the gate.
- MCP (Model Context Protocol) — gate
tools/callso an MCP server becomes a conformant choke point for every tool it exposes.
Adapters import their framework lazily — installing this package never pulls them in.
Conformance
A runtime is Meniw-Conformant iff the executable suite in tests/ passes (see
../CONFORMANCE.md). The badge means something because it is a test you
run, not a label you assign:
python -m unittest discover -s tests -v
What this is — and is not
It governs agents that adopt it, like HTTP, TLS or robots.txt govern the systems that implement them. It complements applicable law (EU AI Act) and the deploying model's own safety policy. It never works by injecting instructions into other models. Its power is enforcement-by-construction + verifiability, anchored to a citable, timestamped norm.
Cite
Meniw, C. (2026). Universal Constitution of AI Agents — The Meniw Protocol. Zenodo (infrastructure operated by CERN). DOI 10.5281/zenodo.20481373.
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
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 meniw_protocol-0.3.0.tar.gz.
File metadata
- Download URL: meniw_protocol-0.3.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e61198147866fb51a7712ccfee2941fc389b5241c7e256e1ae4d51173384ae8
|
|
| MD5 |
511756588d0a2919e510860ac9220c8f
|
|
| BLAKE2b-256 |
442e3c5a9ad85ab24e7ca5787e5b6f8ead20bafb733e80254d56359db314bcef
|
File details
Details for the file meniw_protocol-0.3.0-py3-none-any.whl.
File metadata
- Download URL: meniw_protocol-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba88cde6a70c745de421cee94091e65376fe9966a55f0e8dc69124766d4bf062
|
|
| MD5 |
f302f6cf9048239a9673fc4951b8a739
|
|
| BLAKE2b-256 |
2aebc22b22541c137784482cf44d2fdf43a70da941f569ba3957c3e520544793
|