Skip to main content
This documentation covers the compliance monitoring and evaluation features in MultiMind.

Overview

MultiMind’s compliance package (multimind.compliance) has three layers:
  • Runtime guard (stdlib-only, no extras): PIIDetector, ComplianceGuard / guard(), AuditLog, and ComplianceViolationError. These power multimind serve (guard-proxy.md), the framework adapters (integrations.md), and the MCP server (mcp-server.md).
  • Evidence reporting (stdlib-only): build_evidence_report / EvidenceReport, and RegulatoryWatcher (content-hash change detection over regulatory web pages).
  • Regulation managers (need the compliance extra): GovernanceConfig, Regulation, PrivacyCompliance, GDPRCompliance, and the per-domain managers in multimind.compliance.ai_frameworks, data_transfer, accessibility, supply_chain, and corporate. See the quickstart for working examples.
The compliance monitoring CLI/API described below wraps the runtime guard and these managers. The “advanced” classes also exported from multimind.compliance (FederatedCompliance, ZeroKnowledgeProof, ModelWatermarking, SelfHealingCompliance, ExplainableDTO, RegulatoryChangeDetector) are fail-closed stubs in 1.0.0 — see Advanced features below before relying on any of them.

Installation

scan-text and report-evidence work on a core install. The monitoring commands (run-compliance, generate-report, dashboard, alerts, configure-alerts) import the gateway’s compliance API and need both extras: pip install "multimind-sdk[compliance,gateway]".

Usage

Command Line Interface

The compliance features can be accessed through the MultiMind CLI (multimind compliance --help lists every subcommand):
Known limitations in 1.0.0:
  • dashboard, alerts, and configure-alerts read an in-memory store that is filled by run-compliance calls made in the same process. From the CLI each command is its own process, so these three print nothing recorded. Use the /v1/compliance/* routes on a running multimind backend, where every POST /v1/compliance/monitor is recorded until the server restarts. The durable artifacts are the JSONL audit/cost logs consumed by multimind dashboard (dashboard.md) and report-evidence below.
  • run-example imports examples.compliance.* from the repository root, so it only works from a git checkout, not from a pip-installed package, and the example scripts import torch ([finetune] extra). The error message names which of the two is missing.

API Endpoints

The compliance API is a router mounted at /v1/compliance on the MultiMind Gateway (multimind/gateway/compliance_api.py):
Swagger UI is at /docs. The same router is also reachable under /gateway/v1/compliance/... when running multimind backend.

Available Endpoints

POST /v1/compliance/monitor
Run compliance monitoring against the implemented checkers. Missing evidence is reported as unverifiable, never as a pass. Request body (ComplianceConfig; all fields except metadata are required):
enabled_regulations must be Regulation enum names (GDPR, AI_ACT, HIPAA, SOC2, … — GET /v1/compliance/regulations lists them); unknown names return 400. What is actually evaluated:
  • metadata.text (if present) is run through PIIDetector → a pii_scan check with the detected types and a redact_or_block recommendation.
  • GDPR with metadata.purpose is evaluated with GDPRPolicy, using compliance_rules.data_retention_days (default 365).
  • Every other enabled regulation yields an unverifiable check. Threshold keys such as privacy_threshold are accepted but not evaluated.
Response:
status is checked (all checks clear), attention (findings or denied checks), or unverifiable (no checks, or any check unverifiable).
POST /v1/compliance/report
Same body as /monitor; returns the monitoring result plus a per-regulation enabled/disabled map. It does not compute a compliance score.
GET /v1/compliance/regulations, GET /v1/compliance/healthcare/use-cases
List the Regulation enum names and the healthcare use-case names.
GET /v1/compliance/dashboard
Parameters: organization_id (required), time_range (7d, 24h, …), use_case (optional). Returns a DashboardMetrics object: total_checks, passed_checks, failed_checks, unverifiable_checks, compliance_score (passed divided by passed plus failed), recent_issues (last five failed checks with description and severity), trend_data with one compliance_score series of 1.0/0.0 per decided check, and alerts. Every POST /v1/compliance/monitor on this server process is recorded under its organization_id: a checked result counts as passed, attention as failed and raises an active alert, unverifiable is counted separately. No privacy, fairness, or transparency score is invented. The store is in-memory and empties when the server restarts.
POST /v1/compliance/alerts/configure
Query parameter organization_id; body is the alert_rules dict. Stored on the organization’s in-memory shard; {"enabled": false} stops new alerts from being raised. No other rule keys are evaluated.
GET /v1/compliance/alerts
Parameters: organization_id (required), status (default active), severity (optional). Always returns [] in 1.0.0 for the same reason.

Configuration

Compliance Rules

compliance_rules is a free-form dict on the monitor/report request. The only key the 1.0.0 checkers read is data_retention_days (GDPR). Model training thresholds (bias_threshold, privacy_threshold, …) belong to multimind.compliance.model_training.ComplianceTrainer, documented in the quickstart.

Alert Rules

configure-alerts / POST /v1/compliance/alerts/configure accept any JSON object as alert_rules; no schema is enforced and no notification channel (email, Slack, PagerDuty) is implemented. Treat alert rules as not yet functional.

Advanced features

The classes exported from multimind.compliance.advanced are deliberately fail-closed: rather than fabricate a proof, patch, watermark, or explanation, they raise NotImplementedError until a real backend is wired in. Status in 1.0.0 (verified by calling each one): What does work for regulatory change detection is RegulatoryWatcher: hash-based monitoring of regulatory web pages with a raw unified diff and no legal interpretation.

Evidence reports

multimind compliance report-evidence turns the SDK’s JSONL artifacts — the ComplianceGuard audit trail, the CostTracker cost log, and an optional AI inventory scan — into a single auditor-shaped evidence document (Markdown or self-contained HTML). It works on core installs (stdlib-only, no extras) and is deterministic given the same inputs.
Report sections:
  1. Sources (which artifacts were provided; absent sources are stated, never inferred)
  2. Data protection (PII events by type, redaction strategy distribution, blocked requests, scanned-call share)
  3. Oversight and audit-trail continuity (first/last record, gaps over a configurable threshold, records by direction/method)
  4. Cost governance (spend by tag and model, budget-block events, estimated/unpriced call counts)
  5. AI asset inventory (providers in use, external data-flow providers, hardcoded-key findings)
  6. Framework control-theme mapping (EU AI Act Art. 12 record-keeping / Art. 50 transparency, SOC 2 monitoring / logical access, HIPAA 164.312(b) audit controls — phrased as “supports”, never “satisfies”)
  7. Disclaimer
What it is NOT: the report is technical evidence generated from runtime artifacts, not legal advice, a certification, or a compliance determination. It documents only what the artifacts record; an absent artifact means absent evidence, not absent risk. Every report carries this disclaimer. The same report is available programmatically:

Development

Running Tests

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the Apache License - see the LICENSE file for details.