Governance framework that makes AI coding agents trustworthy
pip install soma-governance==1.5.1 Copy PIP instructions
Production-grade governance framework making AI coding agents trustworthy through observable, self-evolving constraints.
Soma replaces static, unverified prompt rules (.cursorrules, CLAUDE.md) with a closed-loop governance engine: JIT context injection, deterministic AST verification, and Wilson-bounded rule evolution. Rules prove their value or decay to zero.
flowchart LR A["Agent Action"] --> B["1. JIT Rule Injection
Relevant constraints & traps "] B --> C["Code Generation"] C --> D["2. Two-Layer Verification
Deterministic AST + Adversarial Arbiter "] D --> E["3. Ambient Telemetry
Trigger & outcome signals "] E --> F["Self-Evolving Lifecycle
Rules promote or decay "] F -.-> B 📖 Documentation Portal & Guides Explore deep-dive guides for production architecture, workflows, and specifications:
pip install soma-governance # Pure Python (3.9+), zero runtime dependencies soma init --yes # Auto-detects Gemini, Claude Code, Cursor, Copilot soma status # View active rules and fitness stats soma verify --layer1-only # Run Layer 1 deterministic AST checks MCP Server (Recommended) Add Soma to your agent's configuration (SOMA_WORKSPACE points to your project):
{ "mcpServers": { "soma": { "command": "python3", "args": ["-m", "soma_mcp"], "env": { "SOMA_WORKSPACE": "/path/to/project", "SOMA_EXECUTION_ENABLED": "1" } } } } Tier Available tools Read (default) soma_request_receipt, soma_scan, soma_list_cells, soma_grade, soma_coverage, soma_fitness, soma_audit_security, soma_audit_performance, soma_poll_verification, soma_list_rules, soma_rule_fitness Write (default; receipt required) soma_report_outcome, soma_capture_insight, soma_create_cell, soma_create_rule, soma_handoff Execute (opt-in; receipt required) soma_propose_change, soma_verify_changes, soma_checkpoint, soma_generate_manifest Receipt flow: Call soma_request_receipt with the operation and arguments to obtain a single-use, state-bound token (300s TTL). See MCP Gateway Guide.
from soma_sdk import Governance gov = Governance(project_root='.') print(gov.grade(), gov.fitness_landscape(bayesian=True)) 📐 Core Rules The system's foundational rules — 19 inherited behavioral defaults:
15 specialized skills coordinate complex behaviors via typed envelopes and file-buffered handoffs. See the Skill Graph Guide for schemas and coordination workflows.
Adaptive rules live in .soma/cells/ (wall, membrane, vacuole, chloroplast, plasmodesma). Rules evolve using Wilson-bounded fitness intervals and decay to zero when unreinforced. See the Cell Lifecycle Guide.
ai-governance agent-alignment evolutionary-rules code-review ai-coding-assistant token-optimization
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.




