Skip to main content

MOSES Constitutional Governance Framework

Sovereign governance for AI agents — modes, postures, roles, SHA-256 audit chain, commitment conservation, lineage custody, and enterprise hardening.

© 2026 Ello Cello LLC. All rights reserved. Patent Pending: Serial No. 63/877,177

Overview

MOSES (Modular Open System for Executive Sovereignty) is a constitutional governance framework for AI agents. It provides real-time execution-path enforcement through blocking constitutional gates, cryptographic provenance, and semantic commitment conservation.

Three Interfaces, One Core

# Library
from commitgov import governed_step, GovernanceState, AuditLedger

# CLI
python -m commitgov.cli status
python -m commitgov.cli run-task "deploy app" "read config|build|deploy"

# MCP Server
python server.py  # FastMCP stdio — 40 tools

Architecture

Core Library (Phase 1-3A)

Module Purpose Tests
engine.py Modes, postures, roles, GovernanceState, action checking 80
audit.py SHA-256 chained audit ledger with Isnad provenance 32
commitment.py Commitment kernel extraction, Jaccard similarity, ghost tokens 44
lineage.py 3-layer custody chain, archival chain, instance hash 31
loop.py 6-gate ReAct loop, resilience monitoring 19
signing.py Governance-gated HMAC signing (no bypass path) 23
witness.py Moltbook external witness (blind envelopes) 14
oracle.py Grok API external verification (fail-safe) 11
swarm.py Primary→Secondary→Observer coordination 16
meta.py Constitution amendments, rollback, proposals 18
review.py Adversarial blind peer review + external referee 10
model_swap.py Cross-model kernel comparison 10
presence.py Nonce challenge/response liveness 11
handshake.py Inter-agent envelope pack/unpack/verify 11
progress.py Task tracking + recovery flags 10
patterns.py Ghost pattern registry + fingerprinting 14

Enterprise Modules (Phase 3B — 21 Grok Upgrades)

Module Component Dependencies
otel_tracing.py OTel Auto-Tracing opentelemetry-sdk (optional)
sinks.py Salesforce + Splunk + ConstitutionalCognitiveSink requests (optional)
envelope.py MissionEnvelope YAML PyYAML (optional)
gates.py ScriptedGates declarative checks —
obo.py OBO Claims (OAuth2 token exchange) requests (optional)
policy_bundle.py PII guard, rate limit, approval workflow —
flame_gateway.py DynamicFlameGateway (adaptive posture) —
trace.py SelfPayingConstitutionalTrace (Atomic Game Changer #1) —
royalty.py RoyaltyObligation webhook requests (optional)
omni_gateway.py IntentConservingOmniGateway (Atomic Game Changer #2) —
control_plane.py SovereignControlPlane —
passport.py ConstitutionalCognitivePassport —
playback.py ProvenanceAwareSessionPlayback —
config.py Enterprise YAML config PyYAML (optional)

MCP Server (Phase 4)

40 tools exposed via FastMCP:

  • Governance (6): set_mode, set_posture, set_role, check_action, get_status, assemble_context
  • Vault (3): load, list, clear
  • Audit (4): log, verify, recent, hash_session
  • Commitment (2): check_commitment, check_ghost_tokens
  • Lineage (2): verify, get_status
  • Loop (2): run_step, run_task
  • Signing (1): sign
  • Witness (1): witness_event
  • Oracle (1): oracle_verify
  • Swarm (1): run_swarm_round
  • Review (1): adversarial_review
  • Model Swap (1): model_swap_test
  • Presence (1): presence_challenge
  • Handshake (1): handshake
  • Progress (1): get_progress
  • Meta (6): list_amendments, propose, ratify, rollback, constitution_status, list_modes
  • Enterprise (5): load_envelope, check_gates, get_playback, emit_passport, control_plane
  • Resilience (1): resilience_report

CLI (Phase 5)

22 commands wrapping the core library for terminal usage.

Installation

# No external dependencies required (stdlib only)
pip install -e .

# Optional dependencies for enterprise features
pip install requests pyyaml opentelemetry-sdk

Quick Start

from commitgov import GovernanceState, governed_step, AuditLedger

# Set up governance
gs = GovernanceState(mode="High Security", posture="DEFENSE", role="Primary")

# Run a governed step through the 6-gate ReAct loop
result = governed_step(
    task="deploy application",
    action="write config file",
    step_num=1,
    total_steps=3,
    governance=gs,
    ledger_path="audit.jsonl",
    lineage_path="lineage.json",
    progress_path="progress.json",
)

print(f"Success: {result.success}")
print(f"Reason: {result.reason}")

Testing

# Run all 469 tests
python -m pytest tests/ -q

# Run specific module tests
python -m pytest tests/test_engine.py -q

# Run stress tests
python -m pytest tests/test_stress.py -q

Key Concepts

Six Fold Flame

Every action must pass all six constitutional gates before execution:

  1. Sovereignty — Traceable to a registered agent
  2. Compression — Substantive, high-signal (no filler)
  3. Purpose — Serves a constitutional function
  4. Modularity — Compatible with existing structure
  5. Verifiability — Outcome can be tested/verified
  6. Reciprocal Resonance — Produces value when mirrored

Conservation Law of Commitment

C(T(S)) ≈ C(S) — commitment is conserved under transformation. The Jaccard similarity between commitment kernels before and after transformation must stay above threshold.

Ghost Tokens

When commitment tokens leak, the pattern of leaked tokens is fingerprinted. If two agents produce the same fingerprint, it's a structural flaw, not extraction variance.

6-Gate ReAct Loop

  1. Lineage verify (anchor chain)
  2. Status load (governance state)
  3. Ghost token gate (cascade risk)
  4. Posture gate (SCOUT blocks, DEFENSE requires confirm, OFFENSE permits)
  5. Audit log (with Isnad)
  6. Progress write (continuity across context windows)

License

© 2026 Ello Cello LLC. All rights reserved. Patent Pending: Serial No. 63/877,177

Metadata

Release files for commitgov 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commitgov 1.0.0
File Size Uploaded Provenance Actions
commitgov-1.0.0.tar.gz 83.5 kB With provenance Details for commitgov-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for commitgov 1.0.0
File Interpreter ABI Platform Actions
commitgov-1.0.0-py3-none-any.whl Python 3 none any Details for commitgov-1.0.0-py3-none-any.whl

Total release size: 152.8 kB

Release files / commitgov-1.0.0.tar.gz

Download URL commitgov-1.0.0.tar.gz
Size 83.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a525cf2722547dda43953ba30d56f18b3c9f753aaf3a9edf2ed21bcd5ad9c337
BLAKE2b-256 checksum
How to use checksums
141a1ed23ecd9fb031eb9482e77f2ccfd848906a9f68747eae97c73d14d266bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / commitgov-1.0.0-py3-none-any.whl

Download URL commitgov-1.0.0-py3-none-any.whl
Size 69.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcefe7bc04091421e00260bd99a6e8ff2750a14b9625a1734a6cf77b2c0de111
BLAKE2b-256 checksum
How to use checksums
f109cf5fac8c19166d82516dc1bf1faac593076303ed093be0bb080854a7e226
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Security for commitgov 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for commitgov-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page