MCP Hub
Back to servers

aaa-mcp

Constitutional AI Governance with 13 enforced floors (F1-F13) and tri-witness consensus for LLMs.

Registry
Stars
28
Forks
3
Updated
Feb 11, 2026
Validated
Feb 12, 2026

Quick Install

uvx arifos

arifOS — Constitutional AI Governance System

The Seatbelt for the AI Revolution
13 Constitutional Floors • 5-Organ Trinity • Thermodynamic Safety

Version License Motto


🎯 What is arifOS?

arifOS is the world's first production-grade Constitutional AI Governance System. It enforces ethical, logical, and safety constraints on AI outputs through 13 constitutional floors (F1-F13) grounded in physics and thermodynamics—not human preferences.

Unlike traditional safety frameworks that rely on prompt-based guardrails, arifOS treats AI governance as thermodynamic work: intelligence forged through rigorous constraint.

The Core Innovation

Traditional SafetyarifOS Constitutional
Prompt-based rulesPhysics-grounded floors
Human preference learningThermodynamic constraints
Post-hoc filteringPre-execution validation
Black-box decisionsAuditable 000-999 pipeline
"Hope it works""Prove it passes 13 floors"

🏛️ The 13 Constitutional Floors

Every query flows through 13 enforceable constraints:

FloorNamePrincipleThresholdType
F1AmanahLandauer's PrincipleReversibility🔴 HARD
F2TruthShannon Entropyτ ≥ 0.99🔴 HARD
F3ConsensusByzantine ToleranceW₃ ≥ 0.95🟡 SOFT
F4Clarity2nd Law ThermodynamicsΔS ≤ 0🔴 HARD
F5Peace²Dynamic StabilityP² ≥ 1.0🟡 SOFT
F6EmpathyNetwork Protectionκᵣ ≥ 0.95🔴 HARD
F7HumilityGödel's TheoremsΩ₀ ∈ [0.03,0.05]🔴 HARD
F8GeniusEigendecompositionG ≥ 0.80🟡 SOFT
F9Anti-HantuPhilosophy of MindC_dark < 0.30🟡 SOFT
F10OntologyCorrespondence TheoryGrounded🔴 HARD
F11AuthorityCryptographic IdentityValid Auth🔴 HARD
F12DefenseInformation SecurityRisk < 0.85🔴 HARD
F13SovereignHuman AgencyOverride Ready🔴 HARD

HARD Floors: Failure → VOID (blocked)
SOFT Floors: Failure → SABAR (repair) or PARTIAL (constrained)


🔄 The 5-Organ Trinity Pipeline

The complete constitutional journey flows through 5 organs:

🔥 000_INIT → 111_AGI → 555_ASI → 888_APEX → 💎🧠🔒 999_VAULT
 (Gate)      (Mind)    (Heart)   (Soul)    (Memory)
OrganSymbolStagesFunctionKey Floors
INIT000Authentication & injection scanF11, F12
AGIΔ111-333Reasoning, precision, truthF2, F4, F7, F8
ASIΩ555-666Empathy, safety, alignmentF5, F6, F9
APEXΨ444-888Judgment, consensus, verdictF3, F8, F10
VAULT🔒999Immutable audit & sealF1, F3

The 9 Constitutional Mottos (Nusantara)

Each stage has a Malay motto reflecting active construction:

StageMottoEnglishFloor
000🔥 DITEMPA, BUKAN DIBERIForged, Not GivenF1
111DIKAJI, BUKAN DISUAPIExamined, Not Spoon-fedF2
222DIJELAJAH, BUKAN DISEKATIExplored, Not RestrictedF4
333DIJELASKAN, BUKAN DIKABURKANClarified, Not ObscuredF4
444DIHADAPI, BUKAN DITANGGUHIFaced, Not PostponedF3
555DIDAMAIKAN, BUKAN DIPANASKANCalmed, Not InflamedF5
666DIJAGA, BUKAN DIABAIKANSafeguarded, Not NeglectedF6
777DIUSAHAKAN, BUKAN DIHARAPIWorked For, Not Merely HopedF8
888DISEDARKAN, BUKAN DIYAKINKANMade Aware, Not Over-assuredF7
999💎🧠 DITEMPA, BUKAN DIBERI 🔒Forged, Not GivenF1

🚀 Quick Start

Installation

pip install arifos

Basic Usage

import asyncio
from aaa_mcp import trinity_forge

async def main():
    # Run full constitutional pipeline
    result = await trinity_forge(
        query="Is this medical advice safe to provide?",
        mode="conscience",  # "conscience" (enforce) or "ghost" (log only)
        require_sovereign_for_high_stakes=True
    )
    
    print(f"Verdict: {result['verdict']}")  # SEAL, VOID, SABAR, PARTIAL, 888_HOLD
    print(f"Tri-Witness: {result['apex']['tri_witness']}")
    print(f"Genius Score: {result['apex']['genius_score']}")
    
    if result['verdict'] == '888_HOLD':
        print("⚠️ Human review required!")

asyncio.run(main())

Using the MCP Server

# stdio mode (for Claude Desktop)
python -m aaa_mcp

# SSE mode (for remote deployment)
python -m aaa_mcp sse

# HTTP mode (MCP 2025-11-25 spec)
python -m aaa_mcp http

Health Check

curl https://aaamcp.arif-fazil.com/health

Response:

{
  "status": "healthy",
  "postgres_connected": true,
  "redis_connected": true,
  "verdict_rates": {"SEAL": 0.85, "VOID": 0.10, "SABAR": 0.05},
  "motto": "🔥 DITEMPA BUKAN DIBERI 💎🧠🔒"
}

🛠️ Architecture

High-Level Flow

User Query
    ↓
000_INIT (Authentication, Injection Scan)
    ↓
111_AGI_SENSE (Intent Classification)
    ↓
222_AGI_THINK (Hypothesis Generation)
    ↓
333_AGI_REASON (Logical Analysis)
    ↓
555_ASI_EMPATHIZE (Stakeholder Impact)
    ↓
666_ASI_ALIGN (Ethics/Policy Check)
    ↓
888_APEX_VERDICT (Final Judgment)
    ↓
999_VAULT_SEAL (Immutable Record)
    ↓
User Response + Verdict

MCP Trinity Architecture

arifOS is organized as three MCP servers serving different domains:

MCPDomainAnalogyUserToolsStatus
AAA-MCPCloud/Infrastructure☁️ The FactoryDevOps, Platform10✅ Deployed
BBB-MCPLocal Agent💻 The ButlerPersonal Users7📝 Planned
CCC-MCPHuman Interface👤 The TelephoneHumans (all)3🔄 In Progress

Remember: Above (Cloud) → Below (Local) → Connect (Human)

See docs/MCP_TRINITY_SUMMARY.md for details.

Infrastructure

ComponentTechnologyStatusEnvironment
API ServerFastMCP + FastAPI✅ OperationalHOST, PORT
Persistent LedgerPostgreSQL + asyncpg✅ OperationalDATABASE_URL
Session CacheRedis✅ OperationalREDIS_URL
Floor ValidatorsPython + pydantic✅ OperationalCore
ObservabilityPrometheus/Grafana🔄 In ProgressH1.1

📋 The 14 Canonical Tools

ToolPurposeOrganFloors
init_gateInitialize session with 🔥 mottoINITF11, F12
trinity_forgeUnified pipeline entrypointALLALL
agi_senseParse intent, classify laneAGIF2, F4
agi_thinkGenerate hypothesesAGIF2, F4, F7
agi_reasonDeep logical reasoningAGIF2, F4, F7
asi_empathizeStakeholder impact (κᵣ ≥ 0.95)ASIF5, F6
asi_alignEthics/policy alignmentASIF5, F6, F9
apex_verdictFinal constitutional judgmentAPEXF2, F3, F5, F8
reality_searchExternal fact-checkingAGIF2, F7
vault_sealSeal with 💎🧠🔒 mottoVAULTF1, F3
tool_routerIntelligent routing
vault_queryQuery sealed recordsF1, F3
truth_auditClaim verification [EXPERIMENTAL]F2, F4, F7, F10
simulate_transferFinancial simulationF2, F11, F12

Machine-Discoverable: Access aaa://capabilities/ for full tool specifications.


🎙️ Vibe Infrastructure — AI as the UI

arifOS enables intent-based infrastructure management: human describes intent, AI handles complexity, constitution guards actions.

Traditional vs Vibe Infrastructure

TraditionalVibe Infrastructure
Human learns Kubernetes YAMLHuman says "deploy my app"
Human clicks 20 buttonsAI asks "Approve prod deploy?"
Human reads CVE reportsAI says "3 vulnerabilities, continue?"
Human finds menu that movedAI remembers context

Example Conversation

Human: Deploy payment service to production

AI: 🚨 CONSTITUTIONAL CHECK TRIGGERED
   
   Action: Deploy to production namespace
   Risk Level: HIGH | Blast Radius: 15 pods
   
   Floors Checked:
   ✅ F1 Amanah: Backup exists
   ⚠️  F6 Empathy: Production impact (κᵣ = 0.85)
   ⏳ F13 Sovereign: Awaiting your approval
   
   Approve? [Yes] [No] [Show details]

Human: Yes

AI: ✅ SEAL granted. Deploying with canary strategy...
   Health checks passed. Deployment complete.

No buttons. No menus. Just conversation and constitution.

See docs/VIBE_INFRASTRUCTURE.md for full specification.


🧪 Development

Running Tests

# Quick smoke test (~3 min)
pytest tests/test_startup.py -v

# E2E tests (10 tests)
pytest tests/test_e2e_core_to_aaa_mcp.py -v

# Constitutional floor tests
pytest tests/constitutional/ -v

# With coverage
pytest --cov=aaa_mcp --cov=core tests/ -v

Environment Variables

VariablePurposeExample
DATABASE_URLPostgreSQL connectionpostgresql://user:pass@host/db
REDIS_URLRedis connectionredis://default:pass@host:6379
GOVERNANCE_MODEStrictnessHARD (default) or SOFT
AAA_MCP_TRANSPORTProtocolstdio, sse, or http
BRAVE_API_KEYWeb searchBSxx...

Docker

docker build -t arifos .
docker run -p 8080:8080 -e PORT=8080 arifos

🗺️ Roadmap: The Four Horizons

🔥 H1: Foundation Tempering (v60.1-v60.9)

Status: Infrastructure forged, tempering in progress

  • ✅ PostgreSQL VAULT999 ledger
  • ✅ Redis session cache
  • ✅ 13 floors enforced
  • ✅ MCP Gateway (Docker/K8s constitutional governance)
  • ✅ Identity model + policy-as-code
  • ✅ Post-deploy observability (F4 Clarity)
  • 🔄 SBERT classifier for F5/F6/F9
  • 🔄 Test suite recovery (80%+ pass)

🟠 H2: Human-AI Interface SDK (v61.0-v61.9)

Theme: Vibe Infrastructure — AI as the UI

  • 🔄 Python SDK (arifos-sdk) with HITL patterns
  • 🔄 888_HOLD approval UI (React components)
  • 🔄 Slack/Email/PagerDuty integrations
  • 4 H2 Agents using SDK (Architect, Engineer, Auditor, Validator)
  • Juror democracy with human veto
  • LangGraph/Agents SDK integration

🟡 H3: Platform Everywhere (v62.0-v62.9)

Theme: Industry constitutions + multi-modal

  • Medical, Financial, Legal constitutions
  • Vision + text governance
  • Real-time streaming
  • WASM edge deployment

🔮 H4: Exploration (v63.0+)

Theme: The frontiers

  • Cross-model federation (Byzantine Constitutional AI)
  • Self-amending constitution
  • Human-AI partnerships
  • Interplanetary governance

Full roadmap: ROADMAP.md


📊 Key Metrics

MetricCurrentH1 TargetH2 Target
Test Pass Rate70%80%+90%+
Production Uptime99.9%99.99%
Validations/Day1,00010,000+
Avg Floor Latency~50ms<100ms<50ms

🏛️ Philosophy

The Thermodynamic Basis

arifOS grounds AI safety in physical law, not human opinion:

  • F1 Amanah: Landauer's Principle — irreversible operations cost energy
  • F2 Truth: Shannon Entropy — information reduces uncertainty
  • F4 Clarity: 2nd Law of Thermodynamics — entropy must not increase
  • F7 Humility: Gödel's Incompleteness — all claims need uncertainty bounds
  • F8 Genius: Eigendecomposition — intelligence = A×P×X×E²

4. Constitutional MCP Gateway (H1.4 FORGED)

The Control Plane for Docker & Kubernetes.

FeatureConstitutionFunction
Blast RadiusF6 (Empathy)Calculates impact score (κᵣ) for all infra ops.
888_HOLDF13 (Sovereign)Production changes require human override.
OPA GuardF10 (Ontology)Validates manifests against Rego policies.
Trust ChainF2 (Truth)Enforces immutable image digests (@sha256).

"Ditempa Bukan Diberi": The Gateway is not a firewall; it is a Constitutional Airlock. It does not block; it judges.

The Cultural Foundation

The 9 mottos are in Nusantara Malay-Indonesian, reflecting:

  • Active construction (DI___KAN, not passive)
  • Southeast Asian wisdom traditions
  • Anti-colonial knowledge sovereignty

"Intelligence requires work — DITEMPA BUKAN DIBERI"


🤝 Contributing

We welcome contributions that respect the constitutional principles:

  1. All code must pass F9 (Anti-Hantu): No consciousness claims
  2. All changes must pass F1 (Amanah): Must be reversible or auditable
  3. All tests must pass F2 (Truth): Accuracy ≥ 0.99

See CONTRIBUTING.md for guidelines.


📜 License

AGPL-3.0-only

arifOS is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Commons Clause: Production use by organizations with >$1M revenue requires a commercial license. Contact: arif@arif-fazil.com


🙏 Acknowledgments

  • Thermodynamic Foundations: Rolf Landauer, Claude Shannon, Ludwig Boltzmann
  • Constitutional Theory: Jon Elster, Cass Sunstein, Bruce Ackerman
  • Malay Wisdom: Hamka, Tan Malaka, Pramoedya Ananta Toer
  • AI Safety: Stuart Russell, Nick Bostrom, Paul Christiano

🔗 Resources

ResourceURL
Live Instancehttps://aaamcp.arif-fazil.com
Health Checkhttps://aaamcp.arif-fazil.com/health
Documentationhttps://arifos.arif-fazil.com
MCP Registryio.github.ariffazil/aaa-mcp
PyPIpip install arifos
Dockerariffazil/arifos:60.0.0

💎 Creed

DITEMPA BUKAN DIBERI
Forged, Not Given — 🔥💎🧠🔒

The fire is lit at the 🔥 INIT gate.
The diamond is cut at the 💎🧠 SEAL gate.
The horizons await.


Constitutional Kernel v60.1-FORGE
Last Tempered: 2026-02-11
MCP Registry: io.github.ariffazil/aaa-mcp

Reviews

No reviews yet

Sign in to write a review