The EU AI Act, signed into law in 2024, is the world's first comprehensive regulatory framework specifically designed for artificial intelligence systems. It takes a risk-based approach — categorizing AI systems into tiers by the potential harm they can cause, and applying proportionally rigorous compliance requirements to each tier. Crucially, the Act applies extraterritorially: any AI system deployed in the EU or whose outputs affect EU residents falls under its scope, regardless of where the developing organization is based. This extraterritorial reach makes the EU AI Act the de facto global compliance floor for organizations building AI products with any EU market presence, placing it alongside GDPR as a regulation that shapes AI development practices worldwide.
Risk Tier Framework
Unacceptable Risk — Prohibited AI
The EU AI Act outright prohibits a specific set of AI practices deemed incompatible with fundamental rights. These include social scoring systems operated by public authorities that rank citizens based on behavior, real-time biometric surveillance in public spaces by law enforcement (with narrow exceptions), emotion recognition in workplace and educational contexts, AI systems that exploit psychological vulnerabilities of specific groups such as children or the elderly, and subliminal manipulation techniques that influence behavior without conscious awareness. These prohibitions apply with no compliance pathway — no conformity assessment or documentation can make a prohibited system legal. Any organization operating these systems in the EU faces significant enforcement actions.
High-Risk AI Systems
High-risk AI systems operate in domains where automated decisions significantly affect people's lives. The EU AI Act identifies eight high-risk domains: critical infrastructure safety components, educational and vocational qualification decisions, employment and HR management, access to essential services including credit and insurance, law enforcement applications, border control and migration, administration of justice and democratic processes, and safety components of regulated products. Systems in these domains face substantial compliance obligations before deployment: conformity assessment demonstrating the system meets Act requirements, comprehensive technical documentation, mandatory human oversight mechanisms, data governance policies, transparency disclosures to affected users, logging and traceability of system outputs, and demonstrated accuracy and robustness standards.
from dataclasses import dataclass, field
from typing import Dict, List, Optional
import json
@dataclass
class ConformityAssessmentResult:
system_id: str
assessment_date: str
passed: bool
assessor: str
findings: List[str] = field(default_factory=list)
class HighRiskComplianceChecker:
"""
Validates that a high-risk AI system meets EU AI Act requirements.
Uses IPL match_id as analogous audit trail identifier.
"""
REQUIRED_DOC_KEYS = [
"intended_purpose",
"data_governance",
"human_oversight_mechanism",
"logging_config",
"accuracy_metrics",
"risk_management_plan"
]
def check_conformity_assessment(
self, system_id: str
) -> ConformityAssessmentResult:
"""Check if conformity assessment has been completed for this system."""
# In production: query conformity registry by system_id (like match_id lookup)
# Placeholder logic for demonstration
print(f"Checking conformity assessment for system: {system_id}")
return ConformityAssessmentResult(
system_id=system_id,
assessment_date="2024-03-15",
passed=True,
assessor="EU-Notified-Body-0123",
findings=["All high-risk requirements verified"]
)
def validate_technical_documentation(
self, doc_dict: Dict
) -> Dict[str, List[str]]:
"""Check that technical documentation contains all required sections."""
missing = [
key for key in self.REQUIRED_DOC_KEYS
if key not in doc_dict or not doc_dict[key]
]
present = [
key for key in self.REQUIRED_DOC_KEYS
if key in doc_dict and doc_dict[key]
]
return {"present": present, "missing": missing, "compliant": len(missing) == 0}
def verify_logging_enabled(self, system_id: str) -> bool:
"""Verify the system has audit logging enabled — like match_id scorecard."""
# In production: check logging config in system registry
print(f"Verifying logging for system: {system_id} (match_id audit trail)")
return True
# Example: validate an IPL player churn system deployed in an HR context
ipl_churn_doc = {
"intended_purpose": "IPL franchise player retention risk assessment",
"data_governance": "Training data sourced from official IPL records; retention policy 5y",
"human_oversight_mechanism": "All churn predictions reviewed by Head of Analytics before action",
"logging_config": {"retention_days": 365, "log_level": "INFO", "include_input_hash": True},
"accuracy_metrics": {"overall_accuracy": 0.84, "f1": 0.81},
"risk_management_plan": "Annual bias audit; accuracy threshold alerts; fallback to human review"
}
checker = HighRiskComplianceChecker()
conformity = checker.check_conformity_assessment("ipl-churn-hr-system-v2")
doc_check = checker.validate_technical_documentation(ipl_churn_doc)
logging_ok = checker.verify_logging_enabled("ipl-churn-hr-system-v2")
print(json.dumps({
"conformity_passed": conformity.passed,
"documentation_compliant": doc_check["compliant"],
"missing_doc_sections": doc_check["missing"],
"logging_enabled": logging_ok
}, indent=2))Limited and Minimal Risk
Limited-risk AI systems — primarily chatbots and AI-generated content — face transparency obligations rather than full compliance assessments. Systems that interact directly with humans must clearly disclose that they are AI. Deepfake content must be labeled as artificially generated. These transparency obligations are simple to implement but strictly enforced — failure to disclose AI identity in customer interactions is a direct violation regardless of the system's performance quality. Minimal-risk systems, such as spam filters, recommendation engines, and AI in video games, face no mandatory requirements under the Act. However, the EU encourages voluntary codes of conduct for these systems to promote responsible practices across the AI ecosystem even where binding rules do not apply.
GPAI Model Requirements
The EU AI Act introduces a new category for General-Purpose AI models — foundation models and large language models that can be applied across diverse downstream tasks. All GPAI models must provide technical documentation covering training data sources and governance, energy consumption during training and inference, known capabilities and limitations, and copyright compliance for training data. Models that exceed 10^25 FLOPs of training compute are classified as systemic-risk GPAI models and face additional requirements: mandatory adversarial testing, incident reporting to the EU AI Office within 30 days of serious incidents, cybersecurity vulnerability assessments, and energy efficiency reporting. These obligations apply to model providers, making the organizations that train foundation models directly accountable rather than only those who deploy them.
from dataclasses import dataclass
from typing import List, Dict
import json
# Training compute threshold for systemic risk classification
SYSTEMIC_RISK_FLOPS_THRESHOLD = 1e25
@dataclass
class GPAIModelCard:
model_name: str
training_flops: float # Total training compute in FLOPs
training_data_sources: List[str]
known_capabilities: List[str]
known_limitations: List[str]
energy_consumption_kwh: float
copyright_compliance_statement: str
# Automatically derived from training_flops
is_systemic_risk: bool = False
def __post_init__(self):
self.is_systemic_risk = self.training_flops >= SYSTEMIC_RISK_FLOPS_THRESHOLD
def generate_documentation(self) -> Dict:
"""Produce the required EU AI Act technical documentation dict."""
doc = {
"model_name": self.model_name,
"training_compute_flops": f"{self.training_flops:.2e}",
"systemic_risk_classification": self.is_systemic_risk,
"training_data_sources": self.training_data_sources,
"energy_consumption_kwh": self.energy_consumption_kwh,
"copyright_compliance": self.copyright_compliance_statement,
"capabilities": self.known_capabilities,
"limitations": self.known_limitations
}
if self.is_systemic_risk:
doc["additional_systemic_risk_requirements"] = [
"Adversarial testing (red-teaming) completed before deployment",
"Incident reporting to EU AI Office within 30 days of serious incidents",
"Cybersecurity vulnerability assessment documented",
"Energy efficiency metrics reported quarterly"
]
return doc
# Example: a moderate-scale model (below systemic risk threshold)
ipl_analytics_model = GPAIModelCard(
model_name="ipl-sports-analytics-foundation-v1",
training_flops=5e23, # Below 1e25 threshold — standard GPAI
training_data_sources=[
"IPL match scorecards 2008-2023 (public domain)",
"Cricinfo player statistics (licensed)",
"innings_count and batting_average datasets (proprietary)"
],
known_capabilities=[
"Player performance forecasting",
"Match outcome probability estimation",
"IPL auction value analysis"
],
known_limitations=[
"Performance degrades for players with fewer than 8 innings_count",
"Does not account for pitch conditions or weather"
],
energy_consumption_kwh=12500.0,
copyright_compliance_statement="All training data sourced under license or public domain; no copyrighted text without clearance"
)
doc = ipl_analytics_model.generate_documentation()
print(json.dumps(doc, indent=2))
print(f"\nSystemic risk: {ipl_analytics_model.is_systemic_risk}")
# Show a systemic-risk model for comparison
large_model = GPAIModelCard(
model_name="mega-foundation-v1",
training_flops=2e25, # Above threshold — systemic risk
training_data_sources=["Large-scale web corpus"],
known_capabilities=["General reasoning"],
known_limitations=["Hallucination risk"],
energy_consumption_kwh=5000000.0,
copyright_compliance_statement="Copyright audit in progress"
)
print(f"Large model systemic risk: {large_model.is_systemic_risk}")Technical Obligations for ML Teams
Logging and Monitoring Requirements
High-risk AI systems must maintain logs sufficient to ensure traceability throughout the system's operational lifetime. The EU AI Act specifies what logs must capture: the system identifier and version, dates and periods of operation, input data references (not necessarily raw data — a hash suffices for PII compliance), the output decisions generated, and human oversight events where a person reviewed or overrode the system. Log retention periods must be sufficient for post-incident investigation — typically a minimum of the system's operational lifetime plus several years. Logs must be structured so that regulators and auditors can reconstruct what the system did and why on any given decision without additional interpretation. This requirement applies to the operator deploying the system, not only the system provider.
import logging
import json
import hashlib
from datetime import datetime, date
from typing import Dict, Any, Optional
# Configure structured JSON logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("eu_ai_compliance")
class EUComplianceLogger:
"""
Structured audit logger satisfying EU AI Act high-risk logging requirements.
Uses match_id as the system-level traceability identifier.
"""
def __init__(self, system_id: str, model_version: str):
self.system_id = system_id # Like a match_id — uniquely identifies this system instance
self.model_version = model_version
def _hash_input(self, raw_input: Dict) -> str:
"""Hash PII-sensitive input to maintain privacy while enabling traceability."""
input_str = json.dumps(raw_input, sort_keys=True)
return hashlib.sha256(input_str.encode()).hexdigest()[:16]
def log_prediction(
self,
player_id: str,
input_features: Dict[str, float],
output_decision: str,
confidence_score: float,
human_reviewed: bool = False,
reviewer_id: Optional[str] = None
) -> Dict[str, Any]:
"""Log a single model prediction with full EU Act audit fields."""
log_entry = {
"event_type": "ai_prediction",
"system_id": self.system_id, # Traceable system identifier
"model_version": self.model_version,
"timestamp": datetime.utcnow().isoformat(),
"input_hash": self._hash_input(input_features), # No raw PII stored
"output_decision": output_decision,
"confidence_score": round(confidence_score, 4),
"human_reviewed": human_reviewed,
"reviewer_id": reviewer_id,
# IPL player identifier — anonymized in real deployment
"subject_reference": hashlib.sha256(player_id.encode()).hexdigest()[:8]
}
logger.info(json.dumps(log_entry))
return log_entry
def generate_audit_report(
self, start_date: date, end_date: date
) -> Dict[str, Any]:
"""Generate a summary audit report for a date range (regulator-facing)."""
# In production: query structured log store by system_id and date range
return {
"system_id": self.system_id,
"model_version": self.model_version,
"audit_period": {
"start": start_date.isoformat(),
"end": end_date.isoformat()
},
"report_generated_at": datetime.utcnow().isoformat(),
"summary": {
"total_predictions": 1200,
"human_reviewed_count": 85,
"human_override_count": 12,
"review_rate_pct": 7.1
}
}
# Usage: one logger instance per deployed model
ipl_churn_logger = EUComplianceLogger(
system_id="ipl-churn-hr-system-v2",
model_version="2.1.0"
)
# Log a prediction for Shubman Gill's churn assessment
entry = ipl_churn_logger.log_prediction(
player_id="shubman_gill_ipl",
input_features={
"batting_average": 51.3,
"innings_count": 14,
"strike_rate": 142.5
},
output_decision="LOW_CHURN_RISK",
confidence_score=0.87,
human_reviewed=True,
reviewer_id="analytics_head_001"
)
print(json.dumps(entry, indent=2))Pro Tip
Design your logging schema for the EU AI Act before you write model training code. Retrofitting audit logging onto an existing production system is ten times harder than building it in from the start — you will need to modify data pipelines, add privacy-preserving input hashing, and backfill historical decision records. Structure logs around the decision event with system_id, model_version, input_hash, output_decision, and human_reviewed fields present from day one.
Explainability and Transparency
High-risk AI systems must provide meaningful explanations to affected persons when their decisions are based on automated processing. The EU AI Act requires that affected individuals receive natural language explanations of how and why a specific decision was reached, hold the right to human review of any significant automated decision, and have access to documentation of the general algorithmic logic involved. Technical methods like SHAP values and LIME outputs can satisfy the underlying computational explainability requirement, but they must be translated into plain-language summaries accessible to non-technical recipients. An explanation telling a job applicant that "feature importance score 0.23 for experience_years" is legally insufficient — the system must produce a comprehensible, actionable statement about the decision's basis.
Warning: Providing raw SHAP values or feature importance scores to regulators or affected users does NOT satisfy the EU AI Act's transparency requirements on its own. You must translate technical outputs into plain-language explanations that a non-technical person can understand and act upon. For example, instead of 'batting_average SHAP contribution: +0.23', an acceptable explanation is: 'This player's above-average scoring record across 14 seasons was the primary factor in the low-churn-risk assessment.' The EU Act requires the human to understand the reasoning, not just receive numbers.
Global Regulatory Comparison
The EU AI Act operates within a broader global regulatory landscape where different jurisdictions have taken distinct approaches. The United States issued Executive Order 14110 on Safe, Secure, and Trustworthy AI in 2023, and NIST published the AI Risk Management Framework — but both remain voluntary guidance rather than binding law, supplemented by sector-specific regulations like FDA rules for medical AI. The United Kingdom has opted for a pro-innovation, context-specific approach, directing existing sectoral regulators to apply AI governance principles within their domains rather than creating new AI-specific law. China has enacted regulations targeting algorithm recommendations and generative AI specifically. The EU AI Act stands apart as the only binding, comprehensive, cross-sector framework with extraterritorial reach — making EU compliance the effective global minimum for any organization with EU market presence.
Compliance Checklist for ML Teams
- Classify your AI system into the correct EU AI Act risk tier before beginning architecture design — the tier determines the entire compliance approach and overhead.
- High-risk systems require conformity assessments, comprehensive technical documentation, and human oversight mechanisms fully implemented before any EU deployment.
- All AI systems interacting with humans must clearly disclose they are AI — this limited-risk transparency obligation applies regardless of system performance or sophistication.
- GPAI models exceeding 10^25 FLOPs of training compute face additional systemic risk requirements including mandatory adversarial testing and incident reporting to the EU AI Office.
- Audit logs must capture input references, output decisions, and human oversight events at sufficient detail and retention for post-incident regulatory investigation.
- Explainability requirements demand plain-language decision explanations accessible to non-technical affected persons — raw SHAP scores alone do not satisfy this obligation.