Overview
MultiMind’s compliance package (multimind.compliance) has three layers:
- Runtime guard (stdlib-only, no extras):
PIIDetector,ComplianceGuard/guard(),AuditLog, andComplianceViolationError. These powermultimind serve(guard-proxy.md), the framework adapters (integrations.md), and the MCP server (mcp-server.md). - Evidence reporting (stdlib-only):
build_evidence_report/EvidenceReport, andRegulatoryWatcher(content-hash change detection over regulatory web pages). - Regulation managers (need the
complianceextra):GovernanceConfig,Regulation,PrivacyCompliance,GDPRCompliance, and the per-domain managers inmultimind.compliance.ai_frameworks,data_transfer,accessibility,supply_chain, andcorporate. See the quickstart for working examples.
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):
dashboard,alerts, andconfigure-alertsread an in-memory store that is filled byrun-compliancecalls 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 runningmultimind backend, where everyPOST /v1/compliance/monitoris recorded until the server restarts. The durable artifacts are the JSONL audit/cost logs consumed bymultimind dashboard(dashboard.md) andreport-evidencebelow.run-exampleimportsexamples.compliance.*from the repository root, so it only works from a git checkout, not from a pip-installed package, and the example scripts importtorch([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):
/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 asunverifiable, 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 throughPIIDetector→ apii_scancheck with the detected types and aredact_or_blockrecommendation.GDPRwithmetadata.purposeis evaluated withGDPRPolicy, usingcompliance_rules.data_retention_days(default 365).- Every other enabled regulation yields an
unverifiablecheck. Threshold keys such asprivacy_thresholdare accepted but not evaluated.
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 theRegulation 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 parameterorganization_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 frommultimind.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.
- Sources (which artifacts were provided; absent sources are stated, never inferred)
- Data protection (PII events by type, redaction strategy distribution, blocked requests, scanned-call share)
- Oversight and audit-trail continuity (first/last record, gaps over a configurable threshold, records by direction/method)
- Cost governance (spend by tag and model, budget-block events, estimated/unpriced call counts)
- AI asset inventory (providers in use, external data-flow providers, hardcoded-key findings)
- 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”)
- Disclaimer
Development
Running Tests
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
