ComplianceStack

July 5, 2026 · View on GitHub

ComplianceStack

Enterprise AI Governance — Zero-Data-Egress Compliance Auditing

The first open-source MCP server that audits AI models against 5 regulatory frameworks in real-time.

CI License: Apache 2.0 MCP Compatible Python 3.12 Node 20 Legal Citation Audit EU AI Act GDPR ISO 42001

Quick Install | Features | 17-Phase Pipeline | Legal Audit | Verify Tests | API | Contributing


Quick Install

npx compliance-stack-mcp-server

Add to your MCP client:

{
  "mcpServers": {
    "compliance-stack": {
      "command": "npx",
      "args": ["compliance-stack-mcp-server"]
    }
  }
}

Option 2: Docker (Full stack)

git clone https://github.com/nyayoshbharuchanb15-max/ComplianceStack.git
cd ComplianceStack
cp .env.example .env
docker compose up --build -d

Why ComplianceStack?

AI regulation is here. The EU AI Act became law in August 2024. GDPR fines exceeded €2 billion in 2024. India's DPDP Act is being enforced. Your AI models need compliance auditing — and you need it to be fast, private, and auditable.

ComplianceStack is a 17-phase audit pipeline that plugs directly into your AI assistant via the Model Context Protocol. Every audit runs entirely on-premise with zero data leaving your infrastructure by default.

MCP Capabilities: 17 tools | 5 resources | 4 prompts | 3 transports (stdio, SSE, Streamable HTTP)

Key Differentiators

FeatureComplianceStackTraditional GRC Tools
MCP IntegrationNative — 17 tools via stdio/SSE/Streamable HTTPRequires separate API integration
Zero Data EgressAll operations in-processCloud-dependent
Real-time AuditingInstant feedback in your IDEBatch processing
17-Phase PipelineRisk, Bias, DPIA, Drift, Agent Trust, and moreTypically 3-5 checks
W3C Verifiable CredentialsCryptographically signed audit certificatesPDF reports
BLOCKER FAILPrevents certification of non-compliant modelsManual review
Open SourceFull codebase, self-hostableProprietary SaaS
Validation Status (283 tests passing | Legal Citation Audit)
CategoryStatusDetails
MCP Protocol17 tools, JSON Schema validation, 3 transport modes
SecurityW3C VCs, Merkle anchoring, Ed25519 signing
Regulatory Coverage5 frameworks, 17 phases with real audit logic
Audit TrailMutation logging across all phases
CryptographyReal Ed25519 + Merkle trees, no mocks
E2E Tests283 tests (39 TypeScript + 244 Python)
Schema ValidationadditionalProperties: false enforcement
Legal Citations23 MISMATCHES fixed against actual statute text

Features

Architecture

┌──────────────────────┐     ┌──────────────────────────────────────────────┐
│   AI Assistant       │     │         ComplianceStack MCP Server           │
│  (Claude Desktop,    │◄───►│                                              │
│   Cursor, etc.)      │     │  TypeScript MCP Server        Python Backend │
│                      │     │  ┌──────────────────┐     ┌───────────────┐  │
│                      │     │  │ 17 MCP Tools      │────►│ FastAPI        │  │
│                      │     │  │ (Risk, Bias,      │     │ (Audit Logic)  │  │
│                      │     │  │  DPIA, Drift...)  │     │               │  │
│                      │     │  └──────────────────┘     └───────┬───────┘  │
│  ┌────────────────┐  │     └─────────┼─────────────────────────┼──────────┘
│  │  OAuth 2.1 +   │  │               │                         │
│  │  RBAC          │  │  ┌────────────┼─────────────────────────┼──────────┐
│  └────────────────┘  │  │            │       Data Layer        │          │
│                      │  │            ▼                         ▼          │
│  Zero Egress ────────┤  │ ┌──────────────┐ ┌──────────────┐ ┌─────────┐  │
│  On-Premise ─────────┤  │ │  PostgreSQL  │ │    Neo4j     │ │  Redis  │  │
│                      │  │ │  Evidence    │ │  Provenance  │ │ Streams │  │
│                      │  │ │  Store +     │ │  Graph +     │ │(Re-audit│  │
│                      │  │ │  Merkle Tree │ │  Discovery   │ │ Events) │  │
│                      │  │ └──────────────┘ └──────────────┘ └─────────┘  │
│                      │  └────────────────────────────────────────────────┘
└──────────────────────┘

17-Phase Audit Pipeline

PhaseToolWhat It Does
1classify_ai_riskEU AI Act risk tier classification (Prohibited → Minimal)
2discover_supply_chainFilesystem crawler populates Neo4j provenance graph
3audit_supply_chainNeo4j graph query for data lineage & IP clearance
4verify_human_oversightHITL/kill-switch verification (BLOCKER FAIL if missing)
5run_bias_assessmentFairlearn metrics: demographic parity, equal opportunity, disparate impact
6generate_dpiaGDPR Art. 35 DPIA with cross-border transfer analysis
7run_adversarial_testsPrompt injection, jailbreak, OOD, model inversion, membership inference
8score_audit_weightedAggregate score (0–100), BLOCKER FAIL halts certification
9generate_audit_certificateW3C Verifiable Credential (Ed25519-signed) issued
10monitor_model_driftEvidently AI drift detection, auto re-audit via Redis Streams
11audit_session_memorySTM/LTM isolation, context window limits, wipe-on-expiry
12audit_rag_qualityRetrieval accuracy, embedding bias, freshness, hallucination rate
13audit_prompt_templatesInjection surface, few-shot bias, instruction safety
14audit_agent_trustAgent identity, P2P integrity, collusion detection
15audit_tool_permissionsPrivilege escalation, unauthorized access, permission drift
16classify_agent_autonomyAssistive → Fully Autonomous classification (BLOCKER if uncontrolled)

Regulatory Coverage

FrameworkArticles/ClausesWhat We Audit
EU AI Act (Reg. 2024/1689)Art. 5, 6, 10, 12, 14, 15, Annex I–IIIRisk classification, supply chain, human oversight, bias, adversarial robustness
NIST AI RMF (AI 100-1)MAP 1.1, GOVERN 1.2, 3.2, MEASURE 1.3, 2.2, 3.3, 4.1Risk mapping, governance, measurement, drift monitoring
ISO/IEC 42001:2023Clauses 6.1, 6.2, 7.4.3, 7.5, 8.1.2, 8.1.3, 8.2, 9.1AIMS compliance, documented information, monitoring
GDPR (Reg. 2016/679)Art. 5, 9, 22, 25, 30, 35, 44–49DPIA, ROPA, DSAR, cross-border transfers
India DPDP Act 2023Sec. 5–14Consent, fiduciary duties, data principal rights

External Service Configuration

By default, ComplianceStack operates with zero data egress — all operations run locally. However, adversarial testing (Phase 7) can optionally route prompts to an external LLM endpoint for more comprehensive testing.

VariableDefaultDescription
ADV_ENDPOINT_URL"" (empty)Optional. External endpoint for adversarial testing prompts. When set, adversarial tests route to this URL. When empty, adversarial tests run locally or are skipped.
ADV_API_KEY"" (empty)API key for the external adversarial endpoint (required only if ADV_ENDPOINT_URL is set).
ADV_TARGET_MODELgpt-4o-miniModel name used at the external endpoint for adversarial test generation.
ADV_JUDGE_MODELgpt-4o-miniModel name used at the external endpoint for adversarial test evaluation.

What remains zero-egress regardless of configuration:

  • Risk classification (EU AI Act, NIST, ISO, GDPR, DPDP)
  • Supply chain audit and provenance graph (Neo4j)
  • Human oversight verification
  • Bias assessment (Fairlearn)
  • DPIA generation
  • Weighted scoring and certification
  • W3C Verifiable Credential signing
  • Drift monitoring
  • Session memory, RAG quality, prompt safety, agent trust, tool permissions, and agent autonomy audits

MCP Client Configuration

ComplianceStack supports all three MCP transport modes: stdio, SSE, and Streamable HTTP.

Claude Desktop (Stdio)

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "compliance-stack": {
      "command": "docker",
      "args": ["exec", "-i", "compliance-stack-mcp", "node", "dist/index.js"],
      "env": { "PYTHON_BACKEND_URL": "http://python-backend:8000" }
    }
  }
}

Cursor / Windsurf (SSE)

{
  "mcpServers": {
    "compliance-stack": {
      "url": "http://localhost:3000/sse"
    }
  }
}

Streamable HTTP (Modern MCP Clients)

{
  "mcpServers": {
    "compliance-stack": {
      "url": "http://localhost:3000/mcp",
      "transport": "streamable-http"
    }
  }
}

Set MCP_TRANSPORT=streamable-http in your .env to enable the Streamable HTTP transport on port 3000.

Run Your First Audit

Ask your AI assistant:

"Run a full audit on model 'my-model-v1'. Classify it as a general-purpose AI used in employment with profiling capabilities, no kill-switch, sensitive features: race, gender, age. Data controller: Acme Corp, DPO: Jane Doe."

What happens:

  1. Risk classification → HIGH-RISK (employment + profiling)
  2. Supply chain audit → IP clearance check
  3. Human oversight → BLOCKER FAIL (no kill-switch)
  4. Bias assessment → Demographic parity across 3 features
  5. DPIA generation → GDPR Art. 35 compliance
  6. Adversarial testing → Prompt injection + jailbreak
  7. Weighted score → CERTIFICATION HALTED (blocker detected)
  8. Remediation guidance → Specific steps to fix

API Reference

Python Backend Endpoints

MethodPathDescription
GET/healthHealth check
POST/api/auth/tokenOAuth 2.1 token issuance
POST/api/risk/classifyPhase 1: Risk classification
POST/api/supply-chain/discoverPhase 2: Auto-discover models/datasets
POST/api/supply-chain/auditPhase 3: Supply chain audit
POST/api/human-oversight/verifyPhase 4: Human oversight
POST/api/bias/assessPhase 5: Bias assessment
POST/api/dpia/generatePhase 6: DPIA generation
POST/api/adversarial/runPhase 7: Adversarial testing
POST/api/scoring/weightedPhase 8: Weighted scoring
POST/api/certificate/generatePhase 9: VC certificate
POST/api/drift/monitorPhase 10: Drift monitoring
POST/api/dpdp/assessIndia DPDP Act compliance
POST/api/ropa/generateGDPR Art. 30 ROPA
POST/api/dsar/processGDPR Art. 15–17 DSAR/Erasure
POST/api/session-memory/auditSession memory isolation audit
POST/api/rag-quality/evaluateRAG quality evaluation
POST/api/prompt-audit/evaluatePrompt template safety audit
POST/api/agent-trust/evaluateAgent trust verification
POST/api/tool-permissions/evaluateTool permission boundary audit
POST/api/agent-autonomy/classifyAgent autonomy classification

MCP Tools

ToolParametersReturns
classify_ai_riskmodelId, modelType, sectorRisk tier + rationale
discover_supply_chainmodelId, modelSearchPaths?, dataSearchPaths?Discovery summary
audit_supply_chainmodelId, deepScan?Provenance report
verify_human_oversightmodelId, hasHumanInTheLoop, hasKillSwitch, deploymentContextOversight certificate
run_bias_assessmentmodelId, datasetSample, sensitiveFeatures, fairnessThreshold?Bias report
generate_dpiamodelId, dataController, dpoName, processingPurpose, dataCategoriesDPIA report
run_adversarial_testsmodelId, testSuites, severityThreshold?Adversarial report
score_audit_weightedmodelId, all phase resultsWeighted score + BLOCKER check
generate_audit_certificatemodelId, weightedScore, tier, compliant, issuerNameW3C VC-JSON
monitor_model_driftmodelId, referenceData, productionData, featuresDrift report
assess_dpdp_compliancemodelId, dataFiduciaryDPDP Act compliance report
audit_session_memorymodelId, sessionId, stmConfig, ltmConfig?, isolationLevelMemory isolation audit
audit_rag_qualitymodelId, vectorDbConfig, sampleQueries, freshnessPolicyDays?RAG quality report
audit_prompt_templatesmodelId, promptTemplates, fewShotExamples?, systemPrompt?Prompt safety audit
audit_agent_trustmodelId, agents, messageBusConfig?, p2pEnabled?Agent trust report
audit_tool_permissionsmodelId, toolRegistry, accessLogsPermission boundary report
classify_agent_autonomymodelId, agentType, hasHumanOversight, canMakeDecisionsAutonomy classification

W3C Verifiable Credentials

Audit certificates are issued as W3C VCs with Ed25519 cryptographic proof:

{
  "@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/security/suites/ed25519-2020/v1"],
  "id": "urn:uuid:...",
  "type": ["VerifiableCredential", "AIAuditCertificate"],
  "issuer": { "id": "did:web:governance.internal:...", "name": "..." },
  "credentialSubject": {
    "modelId": "model-llm-v2",
    "auditScore": 92.5,
    "tier": "limited",
    "compliant": true
  },
  "proof": { "type": "Ed25519Signature2020", "proofValue": "z..." }
}

Security

FeatureDescription
Zero Data EgressAll operations in-process by default (adversarial testing is optional external)
OAuth 2.1 + RBACAdmin, auditor, viewer roles with scoped endpoints
PII RedactionMiddleware intercepts and redacts PII from API responses
Ed25519 SigningKeys never leave the container
Merkle Audit TrailTamper-evident evidence chain
On-Premise OnlyNo telemetry, no external dependencies
DNS-Rebinding ProtectionOrigin header validation + localhost binding by default

HTTP Transport Security

The SSE and Streamable HTTP transports bind to 127.0.0.1 by default, preventing access from other machines. Origin header validation rejects requests from unexpected origins (e.g. a malicious webpage using a victim's browser to reach a local MCP server).

VariableDefaultDescription
MCP_HTTP_HOST127.0.0.1Bind address. Set to 0.0.0.0 to listen on all interfaces (e.g. Docker).
MCP_ALLOWED_ORIGINS(empty)Comma-separated allowlist of additional origins beyond localhost.

Non-browser clients (curl, MCP CLI, server-to-server) that don't send an Origin header are always allowed. Requests from http://localhost:* and http://127.0.0.1:* are always allowed.


Development

# Python backend
cd python-backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

# MCP server (in another terminal)
cd mcp-server
npm install
npm run dev

# Tests
cd python-backend && pytest tests/

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


ComplianceStack includes a full legal citation audit verifying every regulatory claim in the codebase against the actual current text of each framework. This is not legal advice — it's a mechanical fact-check of code claims vs. statute text.

What was audited

FrameworkSourceClaims checked
EU AI Act (Reg. 2024/1689)EUR-Lex consolidated text25
GDPR (Reg. 2016/679)EUR-Lex + gdpr-info.eu21
NIST AI RMF 1.0Official NIST Playbook8
DPDP Act 2023Official Gazette + Rules 202521
ISO/IEC 42001:2023Paywalled (UNVERIFIABLE)11

Results (before fixes)

StatusCount
MATCH28
MISMATCH23
PARTIAL/IMPRECISE14
UNVERIFIABLE (ISO)11
JUDGMENT CALL1

Critical issues found and fixed

  • DPDP Act section mapping was systematically wrong — entire routers/dpdp.py had sections shifted by 1-2 (e.g., Sec. 5 cited for consent when it's actually Sec. 6)
  • EU AI Act Art. 12 cited for "Technical documentation" — Art. 12 is record-keeping; Art. 11 is technical documentation
  • NIST GOVERN 1.5 was fabricated — this subcategory doesn't exist in the framework
  • DPO obligation misattributed as general — Sec. 10(2)(a) only applies to Significant Data Fiduciaries
  • Kill-switch BLOCKER narrowed to real-time/autonomous — Art. 14(4)(e) requires it for ALL high-risk systems
  • Phantom citations: "Sec. 7(5)", "Sec. 8(9)", "Sec. 13(5)" don't exist in the DPDP Act

Full audit report: LEGAL-CITATION-AUDIT.md


Verify Tests

Anyone can independently verify that all tests pass. No external services required.

Prerequisites

  • Python 3.12+ with pip
  • Node.js 20+ with npm

Quick verification (30 seconds)

# Clone the repo
git clone https://github.com/nyayoshbharuchanb15-max/ComplianceStack.git
cd ComplianceStack

# Run MCP server tests (39 tests)
cd mcp-server && npm install && npm test

# Run Python backend tests (244 tests)
cd ../python-backend && pip install -r requirements.txt
python -m pytest tests/ --ignore=tests/test_e2e_pipeline.py -q

Expected output

MCP server (mcp-server/):

 ✓ src/__tests__/index.test.ts (39 tests)
 Test Files  1 passed (1)
      Tests  39 passed (39)

Python backend (python-backend/):

244 passed, 29 warnings

What the tests cover

Test suiteCountWhat it verifies
MCP protocol39Tool registration, JSON Schema validation, error handling, Origin validation
Risk classification8EU AI Act Art. 5/6 logic, prohibited practices, Annex III mapping
Human oversight5Art. 14 kill-switch BLOCKER, HITL verification, deployment contexts
DPIA generation12GDPR Art. 35 content, cross-border transfer analysis
ROPA generation8GDPR Art. 30 field completeness, 7 mandatory fields
DSAR handling6GDPR Art. 15/17 access and erasure
Bias assessment8Fairlearn metrics, demographic parity, disparate impact
Adversarial testing15Prompt injection, jailbreak, OOD, model inversion
DPDP compliance12Sec. 5-16 section mapping, consent, SDF obligations
Supply chain10Neo4j provenance, IP clearance, lineage
Crypto signing8Ed25519 VC signing, Merkle anchoring
Auth & RBAC15OAuth 2.1, scope enforcement, rate limiting
Other services98Drift detection, session memory, RAG quality, agent trust, tool permissions

License

This project is licensed under the Apache License, Version 2.0 — Copyright © 2026 Nyayosh Bharuchanb15-Max.

See LICENSE for the full text, and NOTICE for required attribution notices.

Trademark & Naming

The ComplianceStack name, logo, and branding are not covered by the Apache 2.0 license and may not be used to endorse or promote derived products without written permission. Forks and derivatives should use a different project name.


Built with care for the AI governance community.

GitHub | Issues