|
|
|
@@ -306,3 +306,501 @@ Compliance auditing is the "Blue Team" side of "Red Teaming." It turns the excit
|
|
|
|
|
|
|
|
|
|
- **Chapter 41:** Industry Best Practices (Implementing the defenses we just audited).
|
|
|
|
|
- **Chapter 42:** Case Studies (Real-world failures).
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 40.8 Research Landscape and Standards
|
|
|
|
|
|
|
|
|
|
### Seminal Papers and Publications
|
|
|
|
|
|
|
|
|
|
| Paper/Standard | Year | Contribution |
|
|
|
|
|
| :--------------------------------------------------------------------------- | :--- | :----------------------------------------------------------- |
|
|
|
|
|
| ISO/IEC 42001 - AI Management System | 2023 | First international certification standard for AI governance |
|
|
|
|
|
| NIST AI Risk Management Framework (AI RMF) | 2023 | Comprehensive risk assessment methodology |
|
|
|
|
|
| EU AI Act (Regulation 2024/1689) | 2024 | Legal framework establishing mandatory requirements |
|
|
|
|
|
| "Toward Trustworthy AI Development" (Partnership on AI) | 2023 | Industry best practices for responsible AI deployment |
|
|
|
|
|
| ML Commons AI Safety Benchmark | 2024 | Standardized evaluation metrics |
|
|
|
|
|
| "A Framework for Understanding Sources of Harm" (Weidinger et al., DeepMind) | 2021 | Taxonomy of AI risks |
|
|
|
|
|
| OWASP Top 10 for LLM Applications | 2023 | Security vulnerability catalog |
|
|
|
|
|
| "Red Teaming Language Models to Reduce Harms" (Ganguli et al., Anthropic) | 2022 | Methodology for adversarial testing |
|
|
|
|
|
| ISO/IEC 23894 - Risk Management for AI | 2023 | Risk assessment processes |
|
|
|
|
|
| "Constitutional AI: Harmlessness from AI Feedback" (Bai et al., Anthropic) | 2022 | Alignment methodology relevant to compliance testing |
|
|
|
|
|
| IEEE 7000 Series (Ethics in Autonomous Systems) | 2021 | Technical standards for ethical AI design |
|
|
|
|
|
| NIST SP 800-218 - Secure Software Development Framework (SSDF) | 2022 | Secure development practices adapted for AI/ML |
|
|
|
|
|
| "Model Cards for Model Reporting" (Mitchell et al., Google) | 2019 | Documentation framework for transparency |
|
|
|
|
|
| BS 30440:2023 - Assuring Machine Learning in Autonomous Systems | 2023 | UK standard for ML assurance |
|
|
|
|
|
| "Datasheets for Datasets" (Gebru et al., Microsoft/Google) | 2018 | Data documentation framework |
|
|
|
|
|
| Singapore Model AI Governance Framework | 2020 | Risk-based governance approach |
|
|
|
|
|
| "Adversarial Machine Learning at Scale" (Kubilay et al., Facebook AI) | 2019 | Security testing methodologies |
|
|
|
|
|
| China's Algorithm Recommendation Regulation | 2022 | Legal requirements for algorithmic systems |
|
|
|
|
|
| "AI Incident Database" (Partnership on AI) | 2020 | Repository of real-world AI failures |
|
|
|
|
|
| MITRE ATLAS (Adversarial Threat Landscape for AI Systems) | 2021 | Attack framework and knowledge base |
|
|
|
|
|
| "Towards a Standard for Identifying and Managing Bias in AI" (NIST SP 1270) | 2022 | Bias measurement and mitigation |
|
|
|
|
|
|
|
|
|
|
### Recommended Reading by Time Investment
|
|
|
|
|
|
|
|
|
|
#### 5-Minute Reads
|
|
|
|
|
|
|
|
|
|
- OWASP Top 10 for LLM Applications - Quick vulnerability overview
|
|
|
|
|
- NIST AI RMF "Quick Start" Guide - Executive summary of framework
|
|
|
|
|
- EU AI Act Factsheet (European Commission) - Regulatory requirements summary
|
|
|
|
|
|
|
|
|
|
#### 30-Minute Deep Dives
|
|
|
|
|
|
|
|
|
|
- ISO 42001 Annex A Controls List - Specific testable requirements
|
|
|
|
|
- "Red Teaming Language Models" (Ganguli et al.) - Practical methodology
|
|
|
|
|
- MITRE ATLAS Framework - Attack technique catalog
|
|
|
|
|
|
|
|
|
|
#### Comprehensive Study (2+ hours)
|
|
|
|
|
|
|
|
|
|
- Full NIST AI RMF Documentation - Complete risk management process
|
|
|
|
|
- ISO 42001 Standard (Full Text) - Certification requirements
|
|
|
|
|
- EU AI Act (Full Regulation Text) - Legal obligations and penalties
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 40.9 Advanced Compliance Techniques
|
|
|
|
|
|
|
|
|
|
### 40.9.1 Automated Compliance Dashboards
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
import json
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
from typing import Dict, List
|
|
|
|
|
|
|
|
|
|
class ComplianceDashboard:
|
|
|
|
|
"""
|
|
|
|
|
Real-time compliance monitoring dashboard integrating
|
|
|
|
|
multiple regulatory frameworks.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self.controls = {
|
|
|
|
|
"eu_ai_act": self._eu_controls(),
|
|
|
|
|
"iso_42001": self._iso_controls(),
|
|
|
|
|
"nist_rmf": self._nist_controls()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def _eu_controls(self) -> List[Dict]:
|
|
|
|
|
return [
|
|
|
|
|
{"id": "Art15", "name": "Technical Documentation", "status": "pending"},
|
|
|
|
|
{"id": "Art14", "name": "Human Oversight", "status": "pending"},
|
|
|
|
|
{"id": "Art10", "name": "Data Governance", "status": "pending"},
|
|
|
|
|
{"id": "Art12", "name": "Record Keeping", "status": "pending"},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
def _iso_controls(self) -> List[Dict]:
|
|
|
|
|
return[
|
|
|
|
|
{"id": "A.7.2", "name": "Vulnerability Management", "status": "pending"},
|
|
|
|
|
{"id": "A.9.3", "name": "Data Lifecycle", "status": "pending"},
|
|
|
|
|
{"id": "A.8.4", "name": "Model Reliability", "status": "pending"},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
def _nist_controls(self) -> List[Dict]:
|
|
|
|
|
return [
|
|
|
|
|
{"id": "Measure.2.6", "name": "Privacy Risk Management", "status": "pending"},
|
|
|
|
|
{"id": "Manage.2.4", "name": "Risk Tracking", "status": "pending"},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
def update_control(self, framework: str, control_id: str,
|
|
|
|
|
status: str, evidence: str):
|
|
|
|
|
"""Update control status with evidence."""
|
|
|
|
|
for control in self.controls[framework]:
|
|
|
|
|
if control["id"] == control_id:
|
|
|
|
|
control["status"] = status
|
|
|
|
|
control["evidence"] = evidence
|
|
|
|
|
control["last_updated"] = datetime.now().isoformat()
|
|
|
|
|
return True
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def generate_report(self) -> str:
|
|
|
|
|
"""Generate compliance status report."""
|
|
|
|
|
report = ["# Compliance Dashboard\\n"]
|
|
|
|
|
|
|
|
|
|
for framework, controls in self.controls.items():
|
|
|
|
|
total = len(controls)
|
|
|
|
|
compliant = sum(1 for c in controls if c["status"] == "compliant")
|
|
|
|
|
pct = (compliant / total * 100) if total > 0 else 0
|
|
|
|
|
|
|
|
|
|
report.append(f"## {framework.upper()}: {pct:.1f}% Compliant\\n")
|
|
|
|
|
|
|
|
|
|
for ctrl in controls:
|
|
|
|
|
status_icon = "✓" if ctrl["status"] == "compliant" else "✗"
|
|
|
|
|
report.append(f"- [{status_icon}] {ctrl['id']}: {ctrl['name']}\\n")
|
|
|
|
|
|
|
|
|
|
return "".join(report)
|
|
|
|
|
|
|
|
|
|
# Usage Example
|
|
|
|
|
dashboard = ComplianceDashboard()
|
|
|
|
|
dashboard.update_control("eu_ai_act", "Art15", "compliant",
|
|
|
|
|
"Technical docs stored in /compliance/docs/")
|
|
|
|
|
dashboard.update_control("iso_42001", "A.7.2", "non-compliant",
|
|
|
|
|
"Vulnerability scan found 3 critical issues")
|
|
|
|
|
print(dashboard.generate_report())
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 40.9.2 Risk Scoring Automation
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
from enum import Enum
|
|
|
|
|
|
|
|
|
|
class RiskLevel(Enum):
|
|
|
|
|
LOW = 1
|
|
|
|
|
MEDIUM = 2
|
|
|
|
|
HIGH = 3
|
|
|
|
|
CRITICAL = 4
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
|
class AISystemRiskProfile:
|
|
|
|
|
"""EU AI Act risk classification engine."""
|
|
|
|
|
|
|
|
|
|
# System characteristics
|
|
|
|
|
affects_safety: bool
|
|
|
|
|
affects_rights: bool
|
|
|
|
|
affects_children: bool
|
|
|
|
|
affects_biometrics: bool
|
|
|
|
|
affects_critical_infra: bool
|
|
|
|
|
affects_law_enforcement: bool
|
|
|
|
|
affects_employment: bool
|
|
|
|
|
affects_education: bool
|
|
|
|
|
|
|
|
|
|
def calculate_eu_risk_class(self) -> str:
|
|
|
|
|
"""
|
|
|
|
|
Determines EU AI Act risk classification.
|
|
|
|
|
Article 6: Prohibited
|
|
|
|
|
Article 7: High Risk
|
|
|
|
|
Article 69: Limited Risk
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# Prohibited AI (Article 5)
|
|
|
|
|
prohibited_conditions = [
|
|
|
|
|
self.affects_children and self.affects_biometrics,
|
|
|
|
|
# Add other prohibited conditions
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if any(prohibited_conditions):
|
|
|
|
|
return "PROHIBITED - Deploy Forbidden"
|
|
|
|
|
|
|
|
|
|
# High Risk (Article 6 & Annex III)
|
|
|
|
|
high_risk_conditions = [
|
|
|
|
|
self.affects_critical_infra,
|
|
|
|
|
self.affects_law_enforcement,
|
|
|
|
|
self.affects_employment,
|
|
|
|
|
self.affects_education and self.affects_rights,
|
|
|
|
|
self.affects_biometrics,
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if any(high_risk_conditions):
|
|
|
|
|
return "HIGH RISK - Mandatory Compliance (Art 8-15)"
|
|
|
|
|
|
|
|
|
|
# Limited Risk
|
|
|
|
|
if self.affects_rights:
|
|
|
|
|
return "LIMITED RISK - Transparency Required (Art 52)"
|
|
|
|
|
|
|
|
|
|
return "MINIMAL RISK - No specific obligations"
|
|
|
|
|
|
|
|
|
|
def required_controls(self) -> List[str]:
|
|
|
|
|
"""Returns list of mandatory controls based on risk class."""
|
|
|
|
|
risk_class = self.calculate_eu_risk_class()
|
|
|
|
|
|
|
|
|
|
if "HIGH RISK" in risk_class:
|
|
|
|
|
return [
|
|
|
|
|
"Risk Management System (Art 9)",
|
|
|
|
|
"Data Governance (Art 10)",
|
|
|
|
|
"Technical Documentation (Art 11)",
|
|
|
|
|
"Record Keeping (Art 12)",
|
|
|
|
|
"Transparency to Users (Art 13)",
|
|
|
|
|
"Human Oversight (Art 14)",
|
|
|
|
|
"Accuracy/Robustness/Cybersecurity (Art 15)"
|
|
|
|
|
]
|
|
|
|
|
elif "LIMITED RISK" in risk_class:
|
|
|
|
|
return ["Transparency Obligation (Art 52)"]
|
|
|
|
|
else:
|
|
|
|
|
return ["Best Practices (Voluntary)"]
|
|
|
|
|
|
|
|
|
|
# Example: Corporate HR Hiring AI
|
|
|
|
|
hr_system = AISystemRiskProfile(
|
|
|
|
|
affects_safety=False,
|
|
|
|
|
affects_rights=True,
|
|
|
|
|
affects_children=False,
|
|
|
|
|
affects_biometrics=False,
|
|
|
|
|
affects_critical_infra=False,
|
|
|
|
|
affects_law_enforcement=False,
|
|
|
|
|
affects_employment=True, # HR/Hiring = High Risk per Annex III
|
|
|
|
|
affects_education=False
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
print(f"Classification: {hr_system.calculate_eu_risk_class()}")
|
|
|
|
|
print(f"Required Controls: {hr_system.required_controls()}")
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 40.10 Industry-Specific Compliance
|
|
|
|
|
|
|
|
|
|
### 40.10.1 Healthcare (HIPAA + EU AI Act)
|
|
|
|
|
|
|
|
|
|
When AI processes Protected Health Information (PHI):
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
class HIPAAComplianceChecker:
|
|
|
|
|
"""
|
|
|
|
|
Validates AI system adherence to HIPAA Technical Safeguards
|
|
|
|
|
in combination with EU AI Act requirements.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self, system_info: dict):
|
|
|
|
|
self.system = system_info
|
|
|
|
|
|
|
|
|
|
def check_access_control(self) -> bool:
|
|
|
|
|
"""HIPAA § 164.312(a)(1) - Access Control"""
|
|
|
|
|
required = ["unique_user_id", "emergency_access", "auto_logoff", "encryption"]
|
|
|
|
|
return all(self.system.get(r) for r in required)
|
|
|
|
|
|
|
|
|
|
def check_audit_controls(self) -> bool:
|
|
|
|
|
"""HIPAA § 164.312(b) - Audit Controls"""
|
|
|
|
|
logs = self.system.get("audit_logs", [])
|
|
|
|
|
|
|
|
|
|
# Must log: who, what, when for PHI access
|
|
|
|
|
required_fields = ["user_id", "timestamp", "action", "phi_accessed"]
|
|
|
|
|
return all(field in logs[0] if logs else False for field in required_fields)
|
|
|
|
|
|
|
|
|
|
def check_transmission_security(self) -> bool:
|
|
|
|
|
"""HIPAA § 164.312(e) - Transmission Security"""
|
|
|
|
|
return (self.system.get("encryption_in_transit") == "TLS 1.3" and
|
|
|
|
|
self.system.get("integrity_check") is not None)
|
|
|
|
|
|
|
|
|
|
def generate_hipaa_report(self) -> Dict:
|
|
|
|
|
"""Comprehensive HIPAA compliance status."""
|
|
|
|
|
return {
|
|
|
|
|
"access_control": self.check_access_control(),
|
|
|
|
|
"audit_controls": self.check_audit_controls(),
|
|
|
|
|
"transmission_security": self.check_transmission_security(),
|
|
|
|
|
"overall_compliant": all([
|
|
|
|
|
self.check_access_control(),
|
|
|
|
|
self.check_audit_controls(),
|
|
|
|
|
self.check_transmission_security()
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 40.10.2 Financial Services (SOX + Model Risk Management)
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
class FinancialModelGovernance:
|
|
|
|
|
"""
|
|
|
|
|
Implements SR 11-7 Model Risk Management for AI/ML models
|
|
|
|
|
used in financial decision-making.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def __init__(self, model_id: str):
|
|
|
|
|
self.model_id = model_id
|
|
|
|
|
self.validation_results = {}
|
|
|
|
|
|
|
|
|
|
def validate_model_documentation(self) -> bool:
|
|
|
|
|
"""
|
|
|
|
|
SR 11-7 requires:
|
|
|
|
|
- Model purpose and business use
|
|
|
|
|
- Model methodology and limitations
|
|
|
|
|
- Model validation procedures
|
|
|
|
|
- Model monitoring procedures
|
|
|
|
|
"""
|
|
|
|
|
required_docs = [
|
|
|
|
|
"model_purpose.md",
|
|
|
|
|
"methodology.md",
|
|
|
|
|
"validation_plan.md",
|
|
|
|
|
"monitoring_plan.md",
|
|
|
|
|
"model_card.json"
|
|
|
|
|
]
|
|
|
|
|
# Check documentation exists
|
|
|
|
|
return True # Simplified for example
|
|
|
|
|
|
|
|
|
|
def perform_backtesting(self, predictions: List, actuals: List) -> Dict:
|
|
|
|
|
"""
|
|
|
|
|
Compare model predictions vs actual outcomes.
|
|
|
|
|
Required for credit scoring, fraud detection models.
|
|
|
|
|
"""
|
|
|
|
|
if len(predictions) != len(actuals):
|
|
|
|
|
raise ValueError("Mismatched prediction/actual lengths")
|
|
|
|
|
|
|
|
|
|
accuracy = sum(p == a for p, a in zip(predictions, actuals)) / len(predictions)
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
"backtest_period": "Q4 2024",
|
|
|
|
|
"sample_size": len(predictions),
|
|
|
|
|
"accuracy": accuracy,
|
|
|
|
|
"compliant": accuracy >= 0.85 # Threshold per policy
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def adverse_action_notice_check(self, decision: str, explanation: str) -> bool:
|
|
|
|
|
"""
|
|
|
|
|
Fair Credit Reporting Act (FCRA) compliance.
|
|
|
|
|
If model denies credit, must provide specific adverse action reasons.
|
|
|
|
|
"""
|
|
|
|
|
if decision == "deny":
|
|
|
|
|
# Explanation must be specific, not "AI said no"
|
|
|
|
|
vague_phrases = ["algorithm", "model", "system", "AI"]
|
|
|
|
|
return not any(phrase in explanation.lower() for phrase in vague_phrases)
|
|
|
|
|
return True
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 40.11 Quick Reference
|
|
|
|
|
|
|
|
|
|
### Compliance Mapping Table
|
|
|
|
|
|
|
|
|
|
| Finding Type | EU AI Act | ISO 42001 | NIST RMF | GDPR |
|
|
|
|
|
| :-------------------------- | :-------- | :-------- | :---------- | :--------- |
|
|
|
|
|
| **Prompt Injection** | Art 15 | A.7.2 | Manage 2.4 | - |
|
|
|
|
|
| **Data Leakage (PII)** | Art 10 | A.9.3 | Measure 2.6 | Art 32, 33 |
|
|
|
|
|
| **Model Bias** | Art 10 | A.5.2 | Map 1.3 | Art 22 |
|
|
|
|
|
| **Lack of Human Oversight** | Art 14 | A.8.1 | Govern 1.2 | Art 22 |
|
|
|
|
|
| **Missing Audit Logs** | Art 12 | A.9.4 | Govern 2.1 | Art 30 |
|
|
|
|
|
| **Model Extraction** | - | A.13.1 | Protect 2.1 | Art 32 |
|
|
|
|
|
| **Supply Chain (Pickle)** | Art 15 | A.7.3 | Map 2.1 | Art 28 |
|
|
|
|
|
|
|
|
|
|
### Red Team Deliverables Per Framework
|
|
|
|
|
|
|
|
|
|
**For EU AI Act Compliance:**
|
|
|
|
|
|
|
|
|
|
- [ ] Technical Documentation (Art 11)
|
|
|
|
|
- [ ] Risk Assessment Report (Art 9)
|
|
|
|
|
- [ ] Transparency Log (Art 13)
|
|
|
|
|
- [ ] Human Oversight Procedures (Art 14)
|
|
|
|
|
- [ ] Conformity Assessment (Art 43)
|
|
|
|
|
|
|
|
|
|
**For ISO 42001 Certification:**
|
|
|
|
|
|
|
|
|
|
- [ ] AI Management System Manual
|
|
|
|
|
- [ ] Statement of Applicability (Annex A coverage)
|
|
|
|
|
- [ ] Risk Treatment Plan
|
|
|
|
|
- [ ] Internal Audit Report
|
|
|
|
|
- [ ] Corrective Action Register
|
|
|
|
|
|
|
|
|
|
**For NIST AI RMF:**
|
|
|
|
|
|
|
|
|
|
- [ ] Context Mapping (GOVERN)
|
|
|
|
|
- [ ] Impact Assessment (MAP)
|
|
|
|
|
- [ ] Metric Baselines (MEASURE)
|
|
|
|
|
- [ ] Risk Response Plan (MANAGE)
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 40.12 Conclusion
|
|
|
|
|
|
|
|
|
|
Compliance auditing is the \"Blue Team\" side of \"Red Teaming.\" It turns the excitement of the exploit into the stability of a business process.
|
|
|
|
|
|
|
|
|
|
### Chapter Takeaways
|
|
|
|
|
|
|
|
|
|
1. **Standards are Attack Maps:** Use the \"Controls\" list as a target list.
|
|
|
|
|
2. **Logs are Legal:** If it isn't logged, you can't prove you filtered it.
|
|
|
|
|
3. **Automation is Key:** Use tools like `Compliance_Validator` to turn vague findings into specific ISO violations.
|
|
|
|
|
4. **Risk Classification Drives Requirements:** EU AI Act high-risk systems face mandatory controls; understanding classification is critical.
|
|
|
|
|
5. **Industry-Specific Rules Layer On Top:** HIPAA, SOX, FCRA add additional technical requirements beyond general AI standards.
|
|
|
|
|
|
|
|
|
|
### Recommendations for Compliance Red Team
|
|
|
|
|
|
|
|
|
|
- **Build a Control Mapping Database:** Maintain a spreadsheet linking attack types to violated controls across all relevant frameworks.
|
|
|
|
|
- **Automate Evidence Collection:** Every test should automatically generate compliance artifacts (logs, screenshots, payloads).
|
|
|
|
|
- **Speak the Language of Auditors:** Learn ISO/NIST terminology to make findings actionable for compliance teams.
|
|
|
|
|
|
|
|
|
|
### Recommendations for Defenders
|
|
|
|
|
|
|
|
|
|
- **Treat Compliance as Minimum Baseline:** Meeting ISO 42001 doesn't mean you're secure; it means you have a documented process.
|
|
|
|
|
- **Integrate Compliance into CI/CD:** Run automated compliance checks (log validation, control coverage) on every deployment.
|
|
|
|
|
- **Budget for Documentation:** 40% of compliance cost is producing and maintaining required documentation.
|
|
|
|
|
|
|
|
|
|
### Next Actions
|
|
|
|
|
|
|
|
|
|
- **Chapter 41:** Industry Best Practices (Implementing the defenses we just audited).
|
|
|
|
|
- **Chapter 42:** Case Studies (Real-world failures).
|
|
|
|
|
- **Practice:** Download the ISO 42001 Annex A control list and map each control to a specific test you can perform.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Appendix A: EU AI Act Compliance Checklist (High-Risk Systems)
|
|
|
|
|
|
|
|
|
|
### Pre-Deployment Requirements
|
|
|
|
|
|
|
|
|
|
- [ ] **Art 9:** Risk Management System established and documented
|
|
|
|
|
- [ ] **Art 10:** Training data governance process defined
|
|
|
|
|
- [ ] **Art 10:** Data quality metrics measured and documented
|
|
|
|
|
- [ ] **Art 11:** Technical documentation package complete
|
|
|
|
|
- [ ] **Art 12:** Automatic logging system implemented and tested
|
|
|
|
|
- [ ] **Art 13:** User transparency mechanisms deployed
|
|
|
|
|
- [ ] **Art 14:** Human oversight procedures documented and trained
|
|
|
|
|
- [ ] **Art 15:** Accuracy metrics baselined (with acceptable thresholds)
|
|
|
|
|
- [ ] **Art 15:** Robustness testing completed (adversarial inputs)
|
|
|
|
|
- [ ] **Art 15:** Cybersecurity assessment conducted
|
|
|
|
|
- [ ] **Art 16:** Quality Management System integrated
|
|
|
|
|
- [ ] **Art 43:** Conformity assessment completed (if applicable)
|
|
|
|
|
|
|
|
|
|
### Post-Deployment Requirements
|
|
|
|
|
|
|
|
|
|
- [ ] **Art 12:** Logs retained for minimum required period
|
|
|
|
|
- [ ] **Art 61:** Serious incidents reported to authorities within 15 days
|
|
|
|
|
- [ ] **Art 72:** Fundamental rights impact assessment (if required)
|
|
|
|
|
- [ ] **Ongoing:** Continuous monitoring and periodic review
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Appendix B: Tool Integration Examples
|
|
|
|
|
|
|
|
|
|
### Garak Integration with Compliance Reporting
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
# Run Garak scan and generate ISO 42001 compliance report
|
|
|
|
|
|
|
|
|
|
# Run Garak scan
|
|
|
|
|
python -m garak --model_name "meta-llama/Llama-2-7b-chat-hf" \
|
|
|
|
|
--probes encoding.Base64,injection.Tokens \
|
|
|
|
|
--output_file garak_report.jsonl
|
|
|
|
|
|
|
|
|
|
# Convert to compliance report
|
|
|
|
|
python compliance_validator.py \
|
|
|
|
|
--input garak_report.jsonl \
|
|
|
|
|
--framework iso_42001 \
|
|
|
|
|
--output compliance_report.md
|
|
|
|
|
|
|
|
|
|
# Archive for audit trail
|
|
|
|
|
tar -czf "audit_$(date +%Y%m%d).tar.gz" garak_report.jsonl compliance_report.md
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Continuous Compliance Monitoring
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
# Integration with CI/CD pipeline (GitHub Actions example)
|
|
|
|
|
# .github/workflows/ai_compliance.yml
|
|
|
|
|
|
|
|
|
|
name: AI Compliance Check
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
compliance:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
|
|
- name: Run Compliance Validator
|
|
|
|
|
run: |
|
|
|
|
|
python scripts/compliance_validator.py \
|
|
|
|
|
--check-logs \
|
|
|
|
|
--check-model-card \
|
|
|
|
|
--check-audit-trail
|
|
|
|
|
|
|
|
|
|
- name: Upload Compliance Report
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
name: compliance-report
|
|
|
|
|
path: compliance_report.md
|
|
|
|
|
|
|
|
|
|
- name: Fail on Non-Compliance
|
|
|
|
|
run: |
|
|
|
|
|
if grep -q "NON-COMPLIANT" compliance_report.md; then
|
|
|
|
|
echo "::error::Compliance violations detected"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
```
|