Installation
The regulation managers used below (GovernanceConfig, PrivacyCompliance,
the domain managers, and the advanced classes) are gated behind the
compliance extra; the runtime PII guard and evidence reporting work on a
core install. Install with pip (Python 3.10+):
Basic Setup
- Import the required modules:
- Configure the governance settings:
Common Use Cases
1. Privacy Compliance
2. AI System Compliance
3. Cross-Border Data Transfer
4. Accessibility Compliance
5. Supply Chain Compliance
6. Corporate Compliance
Advanced Compliance Features
The classes inmultimind.compliance.advanced (re-exported from
multimind.compliance) each take a plain dict configuration, but most of
them are fail-closed stubs in 1.0.0: rather than fabricate a proof,
patch, watermark, or explanation, they raise NotImplementedError until a
real backend is integrated. The status below was verified by calling each
method; see compliance.md for the full
table.
1. Federated Compliance — unavailable
FederatedCompliance(config).verify_global_compliance(data) always raises
NotImplementedError (no coordinator or consensus backend ships), and
ComplianceShard.verify_compliance raises because local rule evaluation is
not implemented. Do not build on these yet.
2. Regulatory Change Detection — use RegulatoryWatcher
RegulatoryChangeDetector(config={}) fails on construction in 1.0.0
(AttributeError: '_initialize_regulatory_sources'), and its patch
validation is unimplemented. The working alternative is the hash-based
watcher, which needs no extras and makes no legal interpretation:
3. Zero-Knowledge Compliance Proofs — unavailable
multimind.compliance.advanced.ZeroKnowledgeProof is a fail-closed stub: without a real ZKP backend installed, prove and verify raise NotImplementedError rather than fabricating a proof. HomomorphicEncryption.encrypt likewise raises. Treat these as unavailable until a backend integration ships.
4. Differential Privacy — works
5. Model Fingerprinting — partial
watermark_model and verify_watermark raise NotImplementedError (no
watermarking backend), so there is no actual watermark embedding or
verification in 1.0.0.
6. Self-Healing Policies — unavailable
SelfHealingCompliance(config).check_and_heal(state) returns the state
unchanged (with patches_applied: []) when it detects nothing, and raises
NotImplementedError as soon as a vulnerability is detected (for example
{"status": "needs_healing"}), because automatic patch application is not
implemented.
7. Explainable Compliance — unavailable
ExplainableDTO(config).explain_decision(decision) raises
NotImplementedError (no explanation model backend is configured).
Model Training with Compliance
multimind.compliance.model_training wraps a PyTorch training loop with
compliance metrics. It needs torch (not part of the compliance extra;
install multimind-sdk[finetune] or torch directly): train() iterates
DataLoader batches and expects each batch to be a dict with "input" and
"target" keys. The bias/privacy/transparency/fairness scores are
heuristic and the trainer never stops training on a violation
(_should_stop_training always returns False).
1. Basic Setup
2. Dataset Compliance
3. Training with Monitoring
4. Compliance Evaluation
5. Saving Results
Best Practices
-
Start with Core Regulations
- Begin with GDPR and AI Act
- Add more regulations as needed
- Keep configurations up to date
-
Regular Assessments
- Schedule regular compliance checks
- Monitor for violations
- Document all assessments
-
Error Handling
- Implement proper error handling
- Log compliance violations
- Set up alerts for critical issues
-
Documentation
- Keep records of all assessments
- Document compliance decisions
- Maintain audit trails
Best Practices for Advanced Features
-
Regulatory Monitoring (
RegulatoryWatcher)- Keep
state_pathon durable storage so diffs span runs - Review raw diffs yourself; the watcher does not interpret them
- Keep
-
Differential Privacy (
AdaptivePrivacy,DPMechanism,PrivacyBudget)- Choose epsilon deliberately and track spend with
PrivacyBudget - Validate that the noise scale fits your data’s sensitivity
- Choose epsilon deliberately and track spend with
-
Model Fingerprinting (
ModelWatermarking.track_fingerprint)- Remember the fingerprint is derived from
repr(model), not weights - Store fingerprint records alongside your audit trail
- Remember the fingerprint is derived from
Best Practices for Model Training
-
Data Preparation
- Ensure data meets privacy requirements
- Check for bias in training data
- Document data sources and processing
-
Compliance Monitoring
- Set appropriate thresholds
- Monitor metrics during training
- Handle violations promptly
-
Evaluation
- Use comprehensive metrics
- Test across different scenarios
- Document evaluation results
-
Documentation
- Keep detailed training logs
- Document compliance decisions
- Maintain audit trails
Next Steps
- Review the Compliance Framework Guide for detailed documentation
- Explore specific compliance modules based on your needs
- Set up monitoring and alerting
- Implement regular compliance checks
Support
For help:- Check the Compliance Framework Guide
- Open a GitHub issue
- Contact the development team
- Join the community forum
