
Eu Ai Act Specialist
- 88 installs
- 451 repo stars
- Updated July 21, 2026
- borghei/claude-skills
EU AI Act Compliance Specialist is a Claude skill for Regulation (EU) 2024/1689 that classifies AI systems by risk tier and maps provider, deployer, and GPAI obligations.
About
EU AI Act Compliance Specialist supports Regulation (EU) 2024/1689 compliance. It classifies AI systems into prohibited, high-risk, limited-risk, and minimal-risk tiers, maps provider and deployer obligations including GPAI model requirements and conformity assessment, and runs gap analysis. A team uses it to inventory and classify AI systems, assign obligations and compliance owners, and prioritize remediation by deadline urgency and penalty severity.
- Classifies AI systems across the four EU AI Act risk tiers using the Art. 6 / Annex III decision tree
- Maps provider/deployer/GPAI obligations (Art. 9-15, conformity assessment, CE marking, post-market monitoring)
- Runs gap analysis via ai_compliance_checker.py and prioritizes remediation by deadline and penalty severity
Eu Ai Act Specialist by the numbers
- 88 all-time installs (skills.sh)
- Ranked #1,056 of 2,203 Security skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
eu-ai-act-specialist capabilities & compatibility
- Capabilities
- dora compliance expert · dpia assessment · data breach response
- Use cases
- security audit
- Pricing
- Free
What eu-ai-act-specialist says it does
EU AI Act (Regulation EU 2024/1689) compliance specialist. Use for AI system risk classification, provider/deployer obligations, GPAI model compliance, conformity assessments
The AI Act uses a risk-based approach with four tiers.
npx skills add https://github.com/borghei/claude-skills --skill eu-ai-act-specialistAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 88 |
|---|---|
| repo stars | ★ 451 |
| Last updated | July 21, 2026 |
| Repository | borghei/claude-skills ↗ |
What it does
Classify AI systems under the EU AI Act and map provider/deployer and GPAI obligations with gap analysis.
Who is it for?
Teams building or deploying AI systems that must classify risk and map EU AI Act obligations before launch.
Skip if: Making a binding legal determination of whether your entity or system falls under the Act - it provides classification frameworks, not legal rulings.
When should I use this skill?
Classifying an AI system's risk, mapping provider/deployer or GPAI obligations, or running an AI Act gap analysis.
What you get
A risk classification per system with mapped obligations, assigned compliance owners, and remediation prioritized by deadline and penalty.
- AI system inventory and classification
- mapped provider/deployer/GPAI obligations
- gap analysis
By the numbers
- 4 risk tiers (prohibited, high-risk, limited, minimal)
- 8 prohibited practices under Art. 5
- Annex III high-risk categories
Files
EU AI Act Compliance Specialist
Production-ready compliance patterns for Regulation (EU) 2024/1689 -- the EU Artificial Intelligence Act. Covers risk classification, provider/deployer obligations, GPAI model requirements, conformity assessment, and AI governance.
---
Clarify First
Before classifying or mapping obligations, confirm these inputs. If any is unknown or vague, ASK — do not assume:
- [ ] Intended purpose and domain — what the system does and its Annex III area (drives the risk classification and which obligations apply)
- [ ] Role — provider, deployer, GPAI provider, or importer (determines the obligation set)
- [ ] Biometric / GPAI characteristics — uses biometrics, is a GPAI model, or trained with >10^25 FLOPs (drives the prohibited / high-risk / systemic-risk path and the conformity-assessment route)
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the classification.
AI System Inventory and Classification Workflow
The agent classifies AI systems under the EU AI Act's risk-based framework and maps applicable obligations.
Workflow: Classify and Map Obligations
1. Inventory all AI systems -- for each system, document: name, provider/developer, description, intended purpose, deployment status, affected persons, geographic scope, data processed, and decision impact level. 2. Apply classification decision tree to each system:
- Does it meet the Art. 3(1) definition of an AI system? If no, document exclusion.
- Does it fall under a prohibited practice (Art. 5)? If yes, flag as UNACCEPTABLE RISK -- must be discontinued.
- Is it a safety component of an Annex I product? If yes, HIGH-RISK (product legislation path).
- Does it fall under an Annex III category? If yes, apply Art. 6(3) exception analysis. If exception does not apply, HIGH-RISK.
- Does Art. 50 transparency obligation apply? If yes, LIMITED RISK. Otherwise, MINIMAL RISK.
3. Map obligations based on classification -- assign compliance owners for each obligation. 4. Run gap analysis using scripts/ai_compliance_checker.py to identify compliance gaps. 5. Prioritize remediation by deadline urgency, penalty severity, and number of affected persons. 6. Validation checkpoint: Every AI system classified; prohibited practices flagged for immediate action; high-risk systems have assigned compliance owners and remediation timelines.
Example: AI System Classification Output
{
"system_name": "Resume Screener v2.1",
"provider": "Internal ML Team",
"intended_purpose": "Screen job applications and rank candidates for recruiter review",
"ai_act_classification": "HIGH-RISK",
"classification_rationale": "Annex III Category 4 - Employment: AI for recruitment and screening of job applicants",
"art_6_3_exception": false,
"exception_rationale": "System directly influences which candidates proceed to interview stage - not a narrow procedural task",
"applicable_obligations": [
"Risk management system (Art. 9)",
"Data governance (Art. 10)",
"Technical documentation (Art. 11)",
"Record-keeping / automatic logging (Art. 12)",
"Transparency and information to deployers (Art. 13)",
"Human oversight (Art. 14)",
"Accuracy, robustness, cybersecurity (Art. 15)",
"Quality management system (Art. 17)",
"Conformity assessment (Art. 43)",
"CE marking (Art. 48)",
"EU database registration (Art. 49)",
"Post-market monitoring (Art. 72)"
],
"compliance_deadline": "2026-08-02",
"assigned_owner": "Head of AI Governance"
}---
Risk Classification System
The AI Act uses a risk-based approach with four tiers.
Tier 1: Prohibited Practices (Art. 5) -- Banned from 2 February 2025
| Prohibited Practice | Article |
|---|---|
| Social scoring by public authorities | Art. 5(1)(c) |
| Real-time remote biometric identification in public spaces (with narrow exceptions) | Art. 5(1)(h) |
| Emotion recognition in workplace and education (except medical/safety) | Art. 5(1)(f) |
| Individual predictive policing based solely on profiling | Art. 5(1)(d) |
| Exploitation of vulnerabilities (age, disability, social/economic situation) | Art. 5(1)(b) |
| Subliminal manipulation causing significant harm | Art. 5(1)(a) |
| Untargeted facial image scraping for recognition databases | Art. 5(1)(e) |
| Biometric categorization by sensitive attributes (race, religion, etc.) | Art. 5(1)(g) |
Tier 2: High-Risk AI Systems (Art. 6, Annex III)
An AI system is high-risk if it falls under Annex III categories OR is a safety component of a product covered by Annex I harmonization legislation.
Annex III Categories:
| # | Category | Examples |
|---|---|---|
| 1 | Biometric identification and categorization | Remote biometric ID, emotion recognition |
| 2 | Critical infrastructure management | Road traffic, water/gas/electricity supply, digital infrastructure |
| 3 | Education and vocational training | Admissions, learning outcome evaluation, test monitoring |
| 4 | Employment and workers management | Recruitment/screening, promotion/termination, performance monitoring |
| 5 | Essential private and public services | Creditworthiness, insurance risk, public assistance eligibility |
| 6 | Law enforcement | Polygraph, deepfake detection, crime analytics |
| 7 | Migration, asylum, border control | Asylum risk assessment, visa/permit examination |
| 8 | Administration of justice | Judicial fact-finding, election influence |
Tier 3: Limited Risk -- Transparency Obligations (Art. 50)
| System Type | Transparency Requirement |
|---|---|
| Chatbots / AI interacting with persons | Inform person they are interacting with AI |
| Emotion recognition / biometric categorization | Inform exposed persons of system operation |
| Deepfakes / AI-generated content | Disclose AI generation; machine-readable labelling |
| AI-generated text on public interest matters | Disclose AI generation unless editorially reviewed |
Tier 4: Minimal Risk
No mandatory requirements. Voluntary codes of conduct encouraged (Art. 95).
---
Provider Obligations for High-Risk AI
Providers of high-risk AI systems must comply with all of the following:
| # | Obligation | Article | Key Requirement |
|---|---|---|---|
| 1 | Risk Management System | Art. 9 | Continuous iterative process throughout lifecycle; test against defined metrics |
| 2 | Data Governance | Art. 10 | Training/validation/testing datasets meet quality, representativeness, and bias criteria |
| 3 | Technical Documentation | Art. 11 | Drawn up before market placement; kept up to date throughout lifecycle |
| 4 | Record-Keeping / Logging | Art. 12 | Automatic recording of events enabling traceability |
| 5 | Transparency | Art. 13 | Instructions for use with capabilities, limitations, and oversight measures |
| 6 | Human Oversight | Art. 14 | Human-in-the-loop, on-the-loop, or in-command depending on risk |
| 7 | Accuracy, Robustness, Cybersecurity | Art. 15 | Appropriate levels declared and maintained; adversarial resilience |
| 8 | Quality Management System | Art. 17 | Documented QMS covering design, development, testing, data management, post-market |
| 9 | Conformity Assessment | Art. 43 | Internal control (Annex VI) or third-party assessment (Annex VII) |
| 10 | CE Marking | Art. 48 | Affix CE marking before market placement |
| 11 | EU Database Registration | Art. 49 | Register in EU database before market placement |
| 12 | Post-Market Monitoring | Art. 72 | Active systematic data collection; serious incident reporting within 15 days |
---
Deployer Obligations (Art. 26)
| Obligation | Detail |
|---|---|
| Use per instructions | Operate per provider's instructions for use |
| Human oversight | Assign competent, trained, authorized oversight personnel |
| Input data relevance | Ensure input data is relevant and representative |
| Monitoring | Monitor operation; inform provider of risks/incidents |
| Record-keeping | Keep auto-generated logs (minimum 6 months) |
| Inform workers | Notify workers/representatives before deployment of high-risk AI |
| DPIA | Carry out GDPR Art. 35 data protection impact assessment when required |
| Fundamental Rights Impact Assessment | Required for public bodies / private entities providing public services (Art. 27) |
---
General-Purpose AI Models (GPAI)
GPAI Provider Obligations (Art. 53) -- Effective 2 August 2025
| Obligation | Detail |
|---|---|
| Technical documentation | Maintain documentation of model training/testing process |
| Information for downstream | Provide sufficient info for downstream AI system providers |
| Copyright compliance | Comply with EU copyright law; honor opt-out mechanisms |
| Training data summary | Publish detailed summary of training content per AI Office template |
| EU representative | Non-EU providers must appoint EU-based representative |
Systemic Risk GPAI Models (Art. 51, 55)
Classified as systemic risk if: high impact capabilities, AI Office designation, or trained with >10^25 FLOPs (rebuttable presumption).
Additional obligations: Model evaluation with adversarial testing, red-teaming proportionate to risk, systemic risk assessment and mitigation, incident tracking and reporting, cybersecurity protection, energy consumption reporting.
---
Conformity Assessment Workflow
The agent guides organizations through conformity assessment for high-risk AI systems.
Workflow: Internal Control (Annex VI)
1. Establish QMS per Art. 17 -- document design, development, testing, data management, and post-market monitoring processes. 2. Compile technical documentation per Art. 11 -- system description, development process, risk management, data governance, performance metrics. 3. Implement all Chapter III Section 2 requirements -- verify each obligation is addressed. 4. Conduct internal assessment:
- Verify risk management system addresses all identified risks (Art. 9)
- Verify data governance meets Art. 10 requirements
- Verify technical documentation is complete and current (Art. 11)
- Verify logging capability (Art. 12)
- Verify transparency and instructions for use (Art. 13)
- Verify human oversight design (Art. 14)
- Verify accuracy, robustness, cybersecurity (Art. 15)
- Confirm QMS covers all required elements (Art. 17)
5. Sign EU Declaration of Conformity (Art. 47), affix CE marking (Art. 48), register in EU database (Art. 49). 6. Implement post-market monitoring (Art. 72) and maintain documentation updates. 7. Validation checkpoint: All 12 provider obligations verified; declaration signed; CE marking affixed; EU database registration complete; post-market monitoring operational.
Workflow: Third-Party Assessment (Annex VII)
Required for biometric identification systems (Annex III point 1) and cases where harmonized standards are insufficient.
1. Complete all internal control steps above. 2. Select and engage notified body with relevant AI system expertise. 3. QMS assessment -- notified body reviews and assesses QMS; issues certificate or requires corrective action; annual surveillance. 4. Technical documentation assessment -- notified body reviews documentation, tests system, issues type-examination certificate. 5. Sign EU Declaration of Conformity with notified body identification number on CE marking. 6. Maintain ongoing compliance -- notified body surveillance, notify of significant changes, maintain all documentation. 7. Validation checkpoint: Notified body certificates issued; CE marking with NB number affixed; ongoing surveillance scheduled.
---
Bias Detection and Fairness Testing
The agent performs bias detection per Art. 10 data governance requirements.
Workflow: Bias Testing
1. Define protected attributes -- age, gender, ethnicity, disability, religion, and other relevant characteristics for the system's context. 2. Analyze data distribution -- check representation ratios (target: 0.8-1.25 vs. population), class imbalance ratios (>0.5), and coverage of all known groups. 3. Evaluate outcome fairness using these metrics:
- Demographic parity: P(positive outcome) equal across groups (within 80% / four-fifths rule)
- Equalized odds: TPR and FPR equal across groups (within 80%)
- Predictive parity: PPV equal across groups (within 80%)
- Calibration: Predicted probabilities accurate for all groups (within 5pp)
4. Identify proxy variables -- check for features correlated with protected attributes. 5. Implement mitigation -- data augmentation, re-sampling, re-weighting, adversarial debiasing, threshold adjustment, or reject option classification as appropriate. 6. Validate -- re-run analysis to confirm improvement. 7. Document -- record all findings, measures taken, and residual bias levels in technical documentation. 8. Validation checkpoint: All protected attributes tested; fairness metrics within thresholds or residual bias documented with justification; mitigation measures recorded.
Example: Bias Detection Command
# Analyze dataset statistics for bias indicators
python scripts/ai_bias_detector.py --input dataset_stats.json \
--protected-attributes gender,age_group,ethnicity
# Output as JSON for integration with compliance documentation
python scripts/ai_bias_detector.py --input dataset_stats.json --json---
Implementation Timeline
| Date | Milestone | Key Requirements |
|---|---|---|
| 1 Aug 2024 | Entry into force | Regulation published |
| 2 Feb 2025 | Prohibited practices + AI literacy | Art. 5 prohibitions; Art. 4 AI literacy |
| 2 Aug 2025 | GPAI obligations + governance | Art. 53, 55 GPAI obligations; AI Office operational |
| 2 Aug 2026 | Full application | All remaining: high-risk, deployer, transparency, conformity, CE marking |
| 2 Aug 2027 | Extended deadline | Certain Annex I Section B high-risk safety components |
Penalties (Art. 99)
| Violation Type | Maximum Fine | % Global Turnover |
|---|---|---|
| Prohibited AI practices | EUR 35 million | 7% (whichever higher) |
| High-risk non-compliance | EUR 15 million | 3% (whichever higher) |
| Misleading information to authorities | EUR 7.5 million | 1% (whichever higher) |
SMEs and startups receive proportionate treatment (lower of absolute or percentage).
---
AI Model Documentation Templates
Template: AI System Description
AI SYSTEM DESCRIPTION
=====================
System Name:
Version:
Provider:
Date:
1. GENERAL INFORMATION
- Intended purpose:
- Target users (deployers):
- Affected persons:
- Geographic scope:
- AI Act classification:
- Annex III category (if applicable):
2. TECHNICAL ARCHITECTURE
- Model type:
- Input data modalities:
- Output description:
- Key design choices and rationale:
3. TRAINING AND DATA
- Training data sources:
- Data volume and characteristics:
- Data preparation methods:
- Bias examination results:
4. PERFORMANCE
- Accuracy metrics:
- Robustness testing results:
- Known limitations:
- Performance across demographic groups:
5. HUMAN OVERSIGHT
- Oversight level: [human-in-the-loop / on-the-loop / in-command]
- Override mechanism:
- Automation bias safeguards:Template: Risk Management Documentation
RISK MANAGEMENT SYSTEM -- AI SYSTEM
====================================
System Name:
Version:
Risk Management Lead:
Date:
1. RISK IDENTIFICATION
| Risk ID | Description | Likelihood | Severity | Risk Level |
|---------|-------------|------------|----------|------------|
| R-001 | | | | |
2. RISK CONTROL MEASURES
| Risk ID | Measure | Type | Verification | Status |
|---------|---------|------|-------------|--------|
| R-001 | | | | |
3. RESIDUAL RISK ASSESSMENT
- Acceptability determination:
- Overall risk-benefit analysis:
4. POST-MARKET DATA INTEGRATION
- Review frequency:
- Trigger conditions for update:---
Tools
AI Risk Classifier
# Classify AI system from JSON description
python scripts/ai_risk_classifier.py --input system_description.json
# Classify from inline JSON
python scripts/ai_risk_classifier.py --inline '{
"name": "Resume Screener",
"description": "AI system that screens job applications and ranks candidates",
"domain": "employment",
"uses_biometrics": false,
"decision_type": "automated_with_review",
"affected_persons": "job applicants",
"eu_deployment": true
}'
# JSON output for programmatic use
python scripts/ai_risk_classifier.py --input system.json --jsonAI Compliance Checker
# Full compliance check with gap analysis
python scripts/ai_compliance_checker.py --input compliance_status.json
# Check deployer obligations only
python scripts/ai_compliance_checker.py --input compliance_status.json --role deployer
# JSON output with remediation steps
python scripts/ai_compliance_checker.py --input compliance_status.json --jsonAI Bias Detector
# Analyze dataset for bias indicators mapped to Art. 10
python scripts/ai_bias_detector.py --input dataset_stats.json
# Specify protected attributes explicitly
python scripts/ai_bias_detector.py --input dataset_stats.json \
--protected-attributes gender,age_group,ethnicity --json---
Reference Documentation
| Document | Path | Description |
|---|---|---|
| Classification Guide | references/ai-act-classification-guide.md | Complete Annex III categories, decision trees, prohibited practices, GPAI classification |
| Governance Framework | references/ai-governance-framework.md | Organizational structure, ethics board, model lifecycle, conformity assessment procedures |
| Documentation Templates | references/ai-technical-documentation-templates.md | Full templates for system description, risk management, data governance, testing, oversight, post-market monitoring, incident reporting, FRIA |
---
---
Troubleshooting
| Problem | Possible Cause | Resolution |
|---|---|---|
| AI system classified as HIGH-RISK but organization believes it qualifies for Art. 6(3) exception | Exception analysis incomplete or domain mapping incorrect | Re-evaluate against all Art. 6(3) exception criteria; the system must perform a narrow procedural task, improve the result of a previously completed human activity, or be purely preparatory; document rationale with legal review |
| Bias detector reports disparate impact but model performs well overall | Aggregated metrics mask subgroup disparities; four-fifths rule violation on specific protected attributes | Analyze per-group positive outcome rates using --protected-attributes flag; implement targeted mitigation (re-sampling, threshold adjustment) for affected groups; document residual bias with justification |
| Compliance checker returns low score despite extensive documentation | Documentation exists but key compliance fields marked as incomplete or not up to date | Verify each obligation field in the input JSON reflects current state; ensure kept_up_to_date and lifecycle_coverage flags are set; update technical documentation per Art. 11 before reassessment |
| System falls under multiple Annex III categories simultaneously | AI system serves multiple domains (e.g., employment + education) | Classify under the highest-risk applicable category; apply the most stringent obligations; document classification rationale for each category |
| GPAI model obligations unclear for downstream provider | Upstream GPAI provider has not supplied sufficient documentation per Art. 53 | Request technical documentation, training data summary, and copyright compliance information from the GPAI provider; if unavailable, document the gap and assess independent obligations |
| Conformity assessment route uncertain (internal vs. third-party) | Biometric identification system or insufficient harmonized standards | Biometric ID systems (Annex III point 1) require third-party assessment (Annex VII); all others may use internal control (Annex VI) unless harmonized standards are unavailable; consult notified body |
| Post-market monitoring shows model performance degradation | Data drift, concept drift, or deployment context changed since initial assessment | Trigger Art. 72 post-market monitoring procedures; report serious incidents within 15 days; update risk management system and technical documentation; consider re-running conformity assessment |
---
Success Criteria
- All AI systems inventoried and classified -- every system assessed against the risk-based framework with documented classification rationale, including Art. 6(3) exception analysis where applicable
- Prohibited practices identified and discontinued -- all Art. 5 prohibited practices flagged by February 2, 2025, with documented evidence of discontinuation or lawful exception application
- High-risk systems fully compliant by August 2, 2026 -- all 12 provider obligations verified, EU Declaration of Conformity signed, CE marking affixed, and EU database registration complete
- Bias testing completed for all high-risk systems -- demographic parity, equalized odds, and predictive parity metrics within four-fifths threshold for all protected attributes, or residual bias documented with justification
- GPAI model obligations met by August 2, 2025 -- technical documentation maintained, downstream provider information supplied, copyright compliance verified, and training data summary published
- Conformity assessment completed per correct route -- internal control (Annex VI) or third-party assessment (Annex VII) selected based on system classification, with all certificates issued and filed
---
Scope & Limitations
In Scope:
- AI system risk classification across all four tiers (Prohibited, High-Risk, Limited Risk, Minimal Risk)
- Annex III category analysis and Art. 6(3) exception evaluation
- Provider and deployer obligation mapping with compliance gap analysis
- GPAI model classification including systemic risk determination (10^25 FLOPs threshold)
- Bias detection and fairness testing mapped to Art. 10 data governance requirements
- Conformity assessment workflow guidance (Annex VI internal control and Annex VII third-party)
- Implementation timeline tracking with penalty exposure assessment
Out of Scope:
- Actual ML model training, retraining, or adversarial testing -- this skill provides compliance frameworks, not ML engineering tools
- Notified body selection, engagement, or audit execution
- National regulatory sandbox applications or experimental AI system exemptions
- Detailed GPAI Code of Practice implementation beyond obligation mapping
- CE marking physical affixation or EU database registration system interaction
- Legal advice on liability, insurance, or contractual allocation of AI Act obligations
Important Notes:
- The EU AI Act compliance deadline of August 2, 2026 for high-risk systems is firm -- organizations should begin classification and gap analysis immediately
- Penalties are severe: up to EUR 35 million or 7% of global turnover for prohibited practices, EUR 15 million or 3% for high-risk non-compliance
- SMEs and startups receive proportionate penalty treatment (lower of absolute or percentage)
---
Integration Points
| Skill | Integration | When to Use |
|---|---|---|
iso42001-ai-management | ISO 42001 AIMS provides organizational framework for EU AI Act compliance; certification demonstrates Art. 17 QMS | When building AI governance program that satisfies both ISO 42001 and EU AI Act |
gdpr-dsgvo-expert | Art. 10 data governance overlaps with GDPR; high-risk AI systems processing personal data require DPIA per GDPR Art. 35 | When AI system processes personal data and requires combined DPIA + conformity assessment |
mdr-745-specialist | AI medical devices fall under both EU AI Act and MDR; MDR conformity assessment may satisfy AI Act per Art. 120 | When AI-enabled medical device requires dual MDR and AI Act compliance |
fda-consultant-specialist | Cross-jurisdictional AI/ML SaMD compliance mapping between FDA PCCP and EU AI Act | When AI medical device is marketed in both US and EU |
infrastructure-compliance-auditor | Technical security controls supporting Art. 15 accuracy, robustness, and cybersecurity requirements | When validating infrastructure security for deployed high-risk AI systems |
---
Tool Reference
ai_risk_classifier.py
Classifies AI systems into EU AI Act risk categories based on a JSON system description.
| Flag | Required | Description |
|---|---|---|
--input <file> | Yes (unless --inline) | Path to JSON file containing AI system description |
--inline '<json>' | No | Inline JSON system description for quick classification |
--json | No | Output results in JSON format for programmatic use |
--output <file> | No | Export classification report to specified file path |
Input Fields: name, description, domain, sub_domain, uses_biometrics, biometric_type, biometric_context, interacts_with_persons, generates_content, content_type, decision_type, affected_persons, is_safety_component, product_legislation, eu_deployment, social_scoring, manipulates_behavior, targets_vulnerable_groups, predictive_policing_individual, untargeted_scraping, is_gpai, training_compute_flops, critical_infrastructure, infrastructure_type.
ai_compliance_checker.py
Validates AI system compliance against all provider and deployer obligations with gap analysis.
| Flag | Required | Description |
|---|---|---|
--input <file> | Yes | Path to JSON compliance status file |
--role <role> | No | Check obligations for specific role: provider (default) or deployer |
--json | No | Output results in JSON format with remediation steps |
--output <file> | No | Export compliance report to specified file path |
Output: Overall compliance score (0-100), per-obligation status, gap analysis with Art. references, and prioritized remediation recommendations.
ai_bias_detector.py
Analyzes dataset statistics for bias indicators mapped to Art. 10 data governance requirements.
| Flag | Required | Description |
|---|---|---|
--input <file> | Yes | Path to JSON file with dataset statistics (demographics, outcomes, correlations) |
--protected-attributes <attrs> | No | Comma-separated list of protected attributes to analyze (e.g., gender,age_group,ethnicity) |
--json | No | Output results in JSON format |
--output <file> | No | Export bias assessment report to specified file path |
Thresholds: Representation ratio 0.8-1.25 (within 20% of population), class imbalance >0.5, four-fifths rule (0.8) for disparate impact, proxy correlation >0.5 for proxy variable detection.
---
Regulation Reference: Regulation (EU) 2024/1689 of the European Parliament and of the Council of 13 June 2024 Last Updated: March 2026 Version: 1.0.0
EU AI Act Classification Guide
Complete reference for classifying AI systems under Regulation (EU) 2024/1689. Covers Annex III high-risk categories, prohibited practices, GPAI model classification, and sector-specific guidance.
---
Table of Contents
- Classification Decision Tree
- Prohibited Practices — Complete Definitions
- Annex III High-Risk Categories — Detailed Reference
- Art. 6(3) Exception Analysis
- GPAI Model Classification
- Systemic Risk Assessment Methodology
- Software as Medical Device (SaMD) Classification
- AI in Regulated Sectors Mapping
- Classification Examples
---
Classification Decision Tree
Master Decision Flow
START: Does the system meet the Art. 3(1) definition of an AI system?
│
├── NO → OUT OF SCOPE
│ Document: Why the system does not meet the AI system definition
│ (e.g., simple rule-based logic, traditional software, basic automation)
│
└── YES → STEP 1: Check Prohibited Practices (Art. 5)
│
├── System falls under Art. 5 prohibition
│ → UNACCEPTABLE RISK
│ Action: Discontinue immediately. Penalties up to EUR 35M / 7% turnover.
│ Exception analysis: Check if narrow exceptions apply (Art. 5(2)-(4))
│
└── No prohibited practice
│
→ STEP 2: Check Annex I (EU harmonisation legislation)
│
├── System IS a safety component of a product covered by Annex I
│ → HIGH-RISK (product legislation path)
│ Assessment: Follow conformity assessment of the relevant product legislation
│ Note: Annex I Section A → applies from Aug 2026
│ Annex I Section B → applies from Aug 2027
│
└── System is NOT a safety component of Annex I product
│
→ STEP 3: Check Annex III categories
│
├── System falls under an Annex III category
│ │
│ → STEP 3a: Art. 6(3) exception analysis
│ │
│ ├── ALL four conditions met AND no significant risk
│ │ → NOT HIGH-RISK
│ │ Action: Document the exception determination and rationale
│ │ Note: System may still have transparency obligations (Step 4)
│ │
│ └── Exception does NOT apply
│ → HIGH-RISK
│ Action: Full Chapter III Section 2 obligations apply
│
└── System does NOT fall under Annex III
│
→ STEP 4: Check transparency obligations (Art. 50)
│
├── System has transparency obligations
│ → LIMITED RISK
│ Action: Implement required disclosures
│
└── No transparency obligations
→ MINIMAL RISK
Action: No mandatory requirements; voluntary codes encouragedIs It an AI System? (Art. 3(1) Analysis)
A system qualifies as an AI system if ALL of the following are true:
| Criterion | Question | Examples |
|---|---|---|
| Machine-based | Is it a machine-based system? | Software, hardware, hybrid systems |
| Varying autonomy | Does it operate with varying levels of autonomy? | From fully automated to human-supervised |
| Adaptiveness | May it exhibit adaptiveness after deployment? | Learning, updating, adjusting behaviour |
| Inference | Does it infer from input how to generate outputs? | Statistical inference, pattern recognition, optimization |
| Output generation | Does it generate predictions, content, recommendations, or decisions? | Classifications, text, images, scores, actions |
| Environment influence | Can outputs influence physical or virtual environments? | Decisions affecting people, controlling systems, generating content |
Systems that are typically NOT AI systems:
- Simple if/then rule engines with no learning component
- Traditional database queries
- Basic calculators or spreadsheet formulas
- Static template-based content generation
- Conventional cybersecurity tools (firewalls, antivirus signatures)
---
Prohibited Practices — Complete Definitions
1. Subliminal Manipulation (Art. 5(1)(a))
Prohibited: AI systems that deploy subliminal techniques beyond a person's consciousness, or purposefully manipulative or deceptive techniques, with the objective or effect of materially distorting behaviour causing or likely to cause significant harm.
Key elements:
- Techniques operate below conscious awareness OR are purposefully manipulative/deceptive
- Objective or effect (not just intent) of materially distorting behaviour
- Causes or is likely to cause significant harm (physical, psychological, financial)
Examples:
- Subliminal visual/audio stimuli in AI-generated content designed to influence purchasing
- AI systems using dark patterns that exploit cognitive biases to manipulate decisions
- Personalized psychological manipulation at scale
NOT prohibited:
- Standard recommendation systems (unless they cross into manipulation)
- A/B testing with transparent variations
- AI-assisted marketing that does not use subliminal techniques
2. Exploitation of Vulnerabilities (Art. 5(1)(b))
Prohibited: AI systems exploiting vulnerabilities due to age, disability, or specific social or economic situation, with the objective or effect of materially distorting behaviour causing significant harm.
Key elements:
- Targets vulnerability related to age, disability, or socioeconomic situation
- Exploits (not merely affects) the vulnerability
- Materially distorts behaviour
- Causes significant harm
Examples:
- AI targeting elderly persons with deceptive financial products
- AI exploiting children's developmental vulnerabilities in gaming/social media
- AI targeting persons with cognitive disabilities with manipulative content
- Predatory lending AI targeting economically vulnerable communities
3. Social Scoring (Art. 5(1)(c))
Prohibited: AI systems used by public authorities (or on their behalf) evaluating or classifying natural persons over a period based on social behaviour or personal/personality characteristics, where the social score leads to detrimental or unfavourable treatment that is unjustified or disproportionate.
Key elements:
- Used by or on behalf of public authorities
- Evaluates/classifies persons based on social behaviour or personal traits
- Creates a social score
- Score leads to detrimental treatment in unrelated contexts, or treatment disproportionate to the behaviour
Examples:
- Government citizen scoring systems affecting access to services
- Public authority systems denying benefits based on social media behaviour
- Municipal systems scoring residents for civic compliance
4. Individual Predictive Policing (Art. 5(1)(d))
Prohibited: AI systems making risk assessments of natural persons to assess or predict the risk of committing a criminal offence, based solely on profiling or personality traits.
Key elements:
- Risk assessment for predicting criminal offending
- Based solely on profiling or personality traits
- Not based on objective, verifiable facts directly linked to criminal activity
- Individual-level prediction (not aggregate crime analytics)
NOT prohibited:
- AI supporting investigation of specific criminal activity
- Crime pattern analysis (geographic, temporal) not targeting individuals
- AI assessing evidence in active investigations
5. Untargeted Facial Image Scraping (Art. 5(1)(e))
Prohibited: AI systems creating or expanding facial recognition databases through untargeted scraping of facial images from the internet or CCTV footage.
Key elements:
- Creates or expands a facial recognition database
- Uses untargeted scraping (not specific, lawful collection)
- Sources: internet or CCTV footage
6. Emotion Recognition in Workplace/Education (Art. 5(1)(f))
Prohibited: AI systems inferring emotions in the workplace or educational institutions, except where for medical or safety reasons.
Key elements:
- Infers emotions of natural persons
- Context: workplace or educational institution
- Exception: medical reasons (e.g., detecting fatigue in safety-critical roles) or safety reasons
Examples (prohibited):
- Employee sentiment monitoring during meetings
- Student attention/engagement detection during lectures
- Job interview emotion analysis
Examples (permitted exceptions):
- Fatigue detection for commercial vehicle drivers (safety)
- Medical monitoring of patient emotional state during therapy
7. Biometric Categorization by Sensitive Attributes (Art. 5(1)(g))
Prohibited: AI systems categorizing natural persons based on biometric data to deduce race, political opinions, trade union membership, religious or philosophical beliefs, sex life, or sexual orientation.
Exception: Labelling or filtering of lawfully acquired biometric data in the area of law enforcement.
8. Real-Time Remote Biometric Identification in Public Spaces (Art. 5(1)(h))
Prohibited: Use of real-time remote biometric identification systems in publicly accessible spaces for law enforcement purposes.
Narrow exceptions (Art. 5(2)) — only if strictly necessary for one of:
- Targeted search for specific victims (abduction, trafficking, sexual exploitation)
- Prevention of specific, substantial, imminent threat to life or physical safety, or genuine and present/foreseeable threat of a terrorist attack
- Identification of suspects for specific serious criminal offences (Art. 5(3) list)
Safeguards for exceptions:
- Prior judicial or independent administrative authorisation required
- Limited in time, geographic scope, and number of persons
- Cannot be used for other purposes once identified
---
Annex III High-Risk Categories — Detailed Reference
Category 1: Biometric Identification and Categorisation
Scope: AI systems intended for:
| Sub-category | Description | High-Risk? |
|---|---|---|
| Remote biometric identification | Identifying natural persons at a distance by comparing biometric data to reference database | YES (except real-time public law enforcement, which is prohibited) |
| Biometric categorisation | Assigning persons to specific categories based on biometric data | YES (except by sensitive attributes, which is prohibited) |
| Emotion recognition | Inferring emotional state from biometric data | YES (except workplace/education, which is prohibited; except medical/safety, which is permitted) |
Examples:
- Airport facial recognition for boarding verification
- Access control using fingerprint/iris recognition
- Customer emotion analysis in retail settings
- Age verification using facial analysis
Category 2: Critical Infrastructure
Scope: AI systems intended as safety components in the management and operation of:
| Infrastructure Type | Examples |
|---|---|
| Road traffic | Autonomous vehicle systems, traffic management AI, smart traffic signals |
| Water supply | Water treatment optimization, distribution network management, contamination detection |
| Gas supply | Pipeline monitoring, leak detection, distribution optimization |
| Heating supply | District heating optimization, demand prediction |
| Electricity supply | Grid management, load balancing, fault prediction, smart meter analytics |
| Digital infrastructure | Network management AI, cybersecurity AI for critical systems |
Key qualifier: The AI must be a SAFETY COMPONENT — meaning its failure or malfunction would endanger safety.
Category 3: Education and Vocational Training
Scope: AI systems intended to be used for:
| Use Case | Description |
|---|---|
| Admission decisions | AI determining or significantly influencing access to educational institutions |
| Learning outcome evaluation | AI assessing student performance, grading exams, evaluating competencies |
| Education level assessment | AI determining the appropriate level of education for a person |
| Proctoring | AI monitoring and detecting prohibited behaviour during tests and exams |
Examples:
- University admission scoring algorithms
- Automated essay grading systems
- AI-powered exam proctoring with behaviour analysis
- Adaptive learning systems that determine student placement levels
- AI recommending educational pathways based on student data
Category 4: Employment and Worker Management
Scope: AI systems intended to be used for:
| Use Case | Description |
|---|---|
| Recruitment and selection | Screening, filtering, evaluating candidates in recruitment, placing targeted job advertisements |
| Promotion and termination | Making decisions affecting terms of work-related relationships, promotion, or termination |
| Task allocation | Allocating tasks based on individual behaviour, personal traits, or characteristics |
| Performance monitoring | Monitoring and evaluating performance and behaviour of workers |
Examples:
- CV/resume screening algorithms
- Video interview analysis AI
- Employee performance prediction systems
- Workforce scheduling AI based on behavioural patterns
- Productivity monitoring with AI-driven analysis
- AI-assisted hiring/firing decision support
Category 5: Essential Services
Scope: AI systems intended to be used for:
| Use Case | Description |
|---|---|
| Creditworthiness assessment | Evaluating creditworthiness or establishing credit scores (except fraud detection) |
| Insurance risk assessment | Risk assessment and pricing for life and health insurance |
| Public benefits eligibility | Evaluating eligibility for public assistance benefits and services, or granting/reducing/revoking such benefits |
| Emergency dispatch | Evaluating and classifying emergency calls, or dispatching/prioritizing emergency first response services (police, fire, medical) |
Examples:
- AI credit scoring models
- Insurance underwriting AI for life/health policies
- Social welfare eligibility determination systems
- Emergency 911/112 call prioritization AI
- AI fraud detection in financial services (NOT high-risk — explicit exception)
Category 6: Law Enforcement
Scope: AI systems intended to be used by law enforcement authorities for:
| Use Case | Description |
|---|---|
| Polygraph/emotion detection | Detecting emotional state, assessing truthfulness (not real-time biometric ID) |
| Deepfake detection | Detecting AI-generated or manipulated content in criminal investigations |
| Risk assessment | Assessing risk of criminal offending or reoffending |
| Profiling | Profiling persons during detection, investigation, or prosecution of criminal offences |
| Crime analytics | Analysing patterns, trends, and relationships in data for criminal investigation |
Category 7: Migration, Asylum, and Border Control
Scope: AI systems intended to be used by public authorities or on their behalf for:
| Use Case | Description |
|---|---|
| Asylum risk assessment | Assessing risk related to irregular migration or health risk |
| Application examination | Examining applications for visas, residence permits, asylum |
| Identification | Identifying persons during border checks (not document verification) |
| Polygraph in asylum | Assessing truthfulness of asylum seekers |
Category 8: Administration of Justice and Democratic Processes
Scope:
| Use Case | Description |
|---|---|
| Judicial assistance | AI assisting judicial authorities in researching and interpreting facts and the law, and in applying the law to concrete facts |
| Democratic processes | AI intended to influence the outcome of an election or referendum (not including AI-generated content that does not directly interact with voters) |
---
Art. 6(3) Exception Analysis
An AI system that falls under Annex III may still be classified as NOT high-risk if the provider determines it does not pose a significant risk to health, safety, or fundamental rights, AND the system performs one of the following:
Exception Conditions (must meet at least one)
| Condition | Description |
|---|---|
| Narrow procedural task | Performs a narrow procedural task — a single, well-defined step in a broader process |
| Improves prior human activity | Improves the result of a previously completed human activity |
| Detects decision patterns | Detects decision-making patterns or deviations without replacing or influencing human assessment |
| Preparatory task | Performs a preparatory task to an assessment relevant to an Annex III use case |
Additional Requirement
The AI system must NOT pose a significant risk of harm to health, safety, or fundamental rights of natural persons, including by not materially influencing the outcome of decision-making.
Documentation Requirement
If a provider determines an Annex III system is not high-risk under Art. 6(3): 1. Document the determination and the rationale before placing on market 2. Notify the relevant market surveillance authority with the documentation 3. Register in the EU database with the determination
Examples
| System | Annex III Category | Exception? | Rationale |
|---|---|---|---|
| AI spell-checker for employee emails | Employment (4) | YES — narrow procedural task | Corrects spelling, does not influence employment decisions |
| AI that organizes CVs alphabetically | Employment (4) | YES — preparatory task | Organizes but does not screen, rank, or filter candidates |
| AI scoring candidates by skills match | Employment (4) | NO | Directly influences recruitment decision |
| AI formatting legal case documents | Justice (8) | YES — narrow procedural task | Formats documents, does not interpret law |
| AI predicting case outcomes for judges | Justice (8) | NO | Directly influences judicial decision-making |
---
GPAI Model Classification
What Is a GPAI Model? (Art. 3(63))
An AI model (including trained with large amounts of data using self-supervision at scale) that displays significant generality, is capable of competently performing a wide range of distinct tasks regardless of the way it is placed on the market, and can be integrated into a variety of downstream systems or applications.
GPAI vs AI System
| Attribute | GPAI Model | AI System |
|---|---|---|
| What it is | A model/foundation model | A complete system using a model |
| Obligations | Chapter V (Art. 51-56) | Chapter III (if high-risk) + Art. 50 |
| Who is regulated | GPAI model provider | AI system provider and deployer |
| Integration | Integrated into downstream AI systems | End-use system |
GPAI Classification Criteria
Is the model a GPAI model?
├── NO → Standard AI system rules apply
└── YES
├── Standard GPAI → Art. 53 obligations
│ - Technical documentation
│ - Information for downstream providers
│ - Copyright compliance
│ - Training data summary
│
└── Systemic Risk GPAI?
│
├── Training compute >= 10^25 FLOPs? → PRESUMED systemic risk
│ (provider can rebut presumption)
│
├── AI Office designation based on high impact capabilities?
│ → DESIGNATED systemic risk
│
└── Neither → Standard GPAI (Art. 53 only)Open-Source GPAI Exception (Art. 53(2))
GPAI models released under a free and open-source licence (allowing access, usage, modification, and distribution with attribution) benefit from reduced obligations:
- Must still comply with copyright policy and training data summary
- Exempt from technical documentation and downstream provider information requirements
- Exception does NOT apply to systemic risk models — they must meet ALL obligations regardless of licensing
---
Systemic Risk Assessment Methodology
Quantitative Indicators
| Indicator | Threshold | Source |
|---|---|---|
| Training compute (FLOPs) | >= 10^25 FLOPs | Art. 51(2) — creates rebuttable presumption |
| Number of registered end users | High (no fixed threshold) | AI Office assessment |
| Number of downstream integrations | High (no fixed threshold) | AI Office assessment |
Qualitative Indicators
| Indicator | Assessment Criteria |
|---|---|
| High impact capabilities | Model benchmarks, evaluations, and testing demonstrate exceptional performance across multiple domains |
| Reach and scale | Number of persons potentially affected by model outputs |
| Reversibility | Whether harms from model outputs can be reversed |
| Autonomy of downstream systems | Degree of autonomy in AI systems built on the model |
| Potential for misuse | Risk of the model being used for harmful purposes at scale |
| Dual-use potential | Applicability to both beneficial and harmful use cases |
AI Office Designation Process
1. AI Office may initiate designation based on available evidence 2. Provider is notified and can submit views 3. AI Office issues reasoned decision 4. Provider can challenge designation 5. Commission may update the compute threshold by delegated act
---
Software as Medical Device (SaMD) Classification
AI systems that qualify as medical devices are subject to both the AI Act and EU MDR 2017/745.
Dual Classification
| Regulation | Classification Path |
|---|---|
| AI Act | High-risk if AI system is a safety component of a medical device (Annex I references MDR) |
| MDR 2017/745 | Classified per Annex VIII rules, particularly Rule 11 for software |
SaMD Classification Under MDR (Rule 11 + MDCG 2019-11)
| AI Function | Clinical Impact | MDR Class |
|---|---|---|
| Provides information for decision | Non-serious condition | IIa |
| Provides information for decision | Serious condition | IIb |
| Drives or informs critical decisions | Life-threatening or irreversible | III |
| Monitors physiological parameters | Vital parameters, risk of immediate danger | IIb |
AI Act Implications for SaMD
- Must comply with BOTH MDR conformity assessment AND AI Act requirements
- Conformity assessment follows the MDR route (not AI Act Annex VI/VII)
- AI Act high-risk obligations (Art. 9-15, 17) still apply in full
- Technical documentation must address both MDR Annex II/III and AI Act Annex IV requirements
---
AI in Regulated Sectors Mapping
Cross-Regulation Mapping
| Sector | AI Act Classification | Other Applicable Regulation | Special Considerations |
|---|---|---|---|
| Healthcare / Medical Devices | High-risk (Annex I — MDR) | MDR 2017/745, IVDR 2017/746 | Dual conformity assessment; MDCG guidance on AI/ML |
| Automotive | High-risk (Annex I — vehicle safety) | UNECE regulations, Type Approval | ADAS and autonomous driving systems |
| Aviation | High-risk (Annex I — civil aviation) | Regulation (EU) 2018/1139 | AI in air traffic management, aircraft systems |
| Machinery | High-risk (Annex I, Section B) | Machinery Regulation (EU) 2023/1230 | Extended deadline to Aug 2027 |
| Financial Services | High-risk (Annex III, point 5) | CRD, MiFID II, DORA | Credit scoring, insurance pricing |
| Employment | High-risk (Annex III, point 4) | Employment law, GDPR | Recruitment AI, performance monitoring |
| Education | High-risk (Annex III, point 3) | National education law | Admission, grading, proctoring |
| Law Enforcement | High-risk / Prohibited | LED (Law Enforcement Directive) | Biometric restrictions, exceptions for serious crime |
| Telecommunications | Potentially high-risk (critical infrastructure) | European Electronic Communications Code | Network management AI |
| Energy | High-risk (Annex III, point 2) | NIS2 Directive, Electricity Directive | Grid management, supply optimization |
GDPR Interaction
| AI Act Requirement | GDPR Requirement | Alignment |
|---|---|---|
| Art. 10 (Data governance) | Art. 5 (Data quality principles) | Complementary — AI Act adds AI-specific bias requirements |
| Art. 14 (Human oversight) | Art. 22 (Automated decision-making) | AI Act provides detailed oversight specifications |
| Art. 13 (Transparency) | Art. 13-14 (Right to information) | AI Act adds system-level transparency |
| Art. 9 (Risk management) | Art. 35 (DPIA) | AI Act risk management is broader; DPIA still required for personal data |
| Art. 10(5) (Special categories) | Art. 9 (Special category data) | AI Act permits processing for bias correction with safeguards |
---
Classification Examples
Example 1: CV Screening Tool
| Factor | Assessment |
|---|---|
| AI System? | Yes — uses NLP to parse and score CVs |
| Prohibited? | No |
| Annex I product? | No |
| Annex III? | Yes — Category 4 (Employment: recruitment screening) |
| Art. 6(3) exception? | No — directly influences candidate selection |
| Classification | HIGH-RISK |
| Key obligations | Full provider obligations including bias testing on demographic groups |
Example 2: Customer Service Chatbot
| Factor | Assessment |
|---|---|
| AI System? | Yes — generates responses using NLP |
| Prohibited? | No |
| Annex I product? | No |
| Annex III? | No |
| Art. 50? | Yes — AI interacting with persons |
| Classification | LIMITED RISK |
| Key obligations | Disclose to users they are interacting with AI |
Example 3: AI Credit Scoring Model
| Factor | Assessment |
|---|---|
| AI System? | Yes — uses ML to predict creditworthiness |
| Prohibited? | No |
| Annex I product? | No |
| Annex III? | Yes — Category 5 (Essential services: creditworthiness) |
| Art. 6(3) exception? | No — directly determines credit decisions |
| Classification | HIGH-RISK |
| Key obligations | Full provider obligations; fairness across demographic groups critical |
Example 4: Spam Filter
| Factor | Assessment |
|---|---|
| AI System? | Likely yes — uses ML classification |
| Prohibited? | No |
| Annex I product? | No |
| Annex III? | No |
| Art. 50? | No |
| Classification | MINIMAL RISK |
| Key obligations | None mandatory; voluntary codes of conduct |
Example 5: AI Diagnostic Imaging (Medical)
| Factor | Assessment |
|---|---|
| AI System? | Yes — analyses medical images for diagnosis |
| Prohibited? | No |
| Annex I product? | Yes — medical device under MDR 2017/745 |
| Classification | HIGH-RISK (product legislation path) |
| Key obligations | MDR conformity assessment + AI Act high-risk obligations |
Example 6: Large Language Model (Foundation Model)
| Factor | Assessment |
|---|---|
| AI System? | It is a GPAI model |
| GPAI? | Yes — general-purpose, performs wide range of tasks |
| Systemic risk? | Depends on training compute and AI Office assessment |
| Classification | GPAI (Art. 53) or GPAI with systemic risk (Art. 55) |
| Key obligations | Technical docs, downstream info, copyright policy, training data summary; if systemic: red-teaming, risk assessment, incident reporting |
Example 7: Social Media Content Moderation
| Factor | Assessment |
|---|---|
| AI System? | Yes — uses ML to classify content |
| Prohibited? | No |
| Annex I product? | No |
| Annex III? | No (not in listed categories) |
| Art. 50? | Possibly — if it generates responses to users |
| Classification | MINIMAL or LIMITED RISK |
| Key obligations | Transparency if interacting with users; otherwise voluntary |
---
Regulation Reference: Regulation (EU) 2024/1689, Annexes I, III, and relevant recitals
Last Updated: March 2026
AI Governance Framework
Comprehensive reference for establishing AI governance structures aligned with EU AI Act (Regulation EU 2024/1689) requirements. Covers organizational design, ethics oversight, model lifecycle governance, incident management, and conformity assessment procedures.
---
Table of Contents
- AI Governance Organizational Structure
- AI Ethics Board
- AI Registry and Inventory Management
- Model Lifecycle Governance
- Responsible AI Principles — Legal Requirements Mapping
- AI Incident Management
- Conformity Assessment Procedures
- CE Marking Process for AI Systems
---
AI Governance Organizational Structure
Recommended Governance Model
Organizations deploying AI systems subject to the EU AI Act should establish a three-tier governance structure:
TIER 1: STRATEGIC GOVERNANCE
┌─────────────────────────────────────────────────┐
│ Board of Directors / Executive Leadership │
│ - Overall accountability for AI strategy │
│ - Risk appetite and tolerance setting │
│ - Resource allocation for AI compliance │
└──────────────────────┬──────────────────────────┘
│
TIER 2: OVERSIGHT AND ADVISORY
┌──────────────────────┴──────────────────────────┐
│ AI Ethics Board / AI Governance Committee │
│ - Policy development and review │
│ - Ethical review of high-risk AI systems │
│ - Fundamental rights impact oversight │
│ - Exception and escalation decisions │
└──────────────────────┬──────────────────────────┘
│
TIER 3: OPERATIONAL GOVERNANCE
┌──────────────────────┴──────────────────────────┐
│ AI Compliance Function │
│ ┌───────────────────────────────────────────┐ │
│ │ AI Compliance Officer / Team │ │
│ │ - Risk classification │ │
│ │ - Conformity assessment coordination │ │
│ │ - Post-market monitoring │ │
│ │ - Regulatory liaison │ │
│ └───────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────┐ │
│ │ AI Technical Governance │ │
│ │ - Data governance (Art. 10) │ │
│ │ - Technical documentation (Art. 11) │ │
│ │ - Model validation and testing │ │
│ │ - Bias detection and fairness testing │ │
│ └───────────────────────────────────────────┘ │
│ ┌───────────────────────────────────────────┐ │
│ │ AI Risk Management │ │
│ │ - Risk identification and evaluation │ │
│ │ - Control measure design │ │
│ │ - Incident management │ │
│ │ - Human oversight implementation │ │
│ └───────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘Key Roles and Responsibilities
| Role | Responsibility | AI Act Reference |
|---|---|---|
| AI Compliance Officer | Overall AI Act compliance oversight, regulatory liaison, classification decisions | Art. 17 (QMS), Art. 43 (conformity assessment) |
| Data Governance Lead | Training data quality, bias examination, representativeness analysis | Art. 10 |
| AI Risk Manager | Risk management system, risk evaluation, control measures | Art. 9 |
| Human Oversight Coordinator | Oversight personnel selection, training, procedure design | Art. 14 |
| Technical Documentation Manager | Technical file creation, maintenance, updates | Art. 11 |
| Post-Market Monitoring Lead | Monitoring system operation, incident reporting, data analysis | Art. 72, 73 |
| AI Ethics Advisor | Ethical review, fundamental rights impact assessment, bias review | Art. 27 |
| AI Security Officer | Cybersecurity measures, adversarial threat protection | Art. 15 |
| AI Literacy Coordinator | Training program design and delivery | Art. 4 |
Governance Documentation Requirements
| Document | Purpose | Owner | Review Frequency |
|---|---|---|---|
| AI Governance Policy | Top-level governance framework and principles | AI Compliance Officer | Annual |
| AI System Inventory | Register of all AI systems with classifications | AI Compliance Officer | Continuous |
| AI Risk Management Policy | Risk appetite, methodology, escalation | AI Risk Manager | Annual |
| AI Data Governance Policy | Data quality, bias, representativeness standards | Data Governance Lead | Annual |
| AI Ethics Policy | Ethical principles and review procedures | AI Ethics Board | Annual |
| AI Incident Response Plan | Incident detection, classification, response, reporting | Post-Market Monitoring Lead | Annual |
| AI Literacy Program | Training curriculum and delivery plan | AI Literacy Coordinator | Semi-annual |
| Conformity Assessment Procedures | Assessment pathways and evidence requirements | AI Compliance Officer | As needed |
---
AI Ethics Board
Purpose
The AI Ethics Board provides independent oversight and advisory guidance on the ethical dimensions of AI system development and deployment. While not explicitly required by the AI Act, an ethics board is a best practice that supports compliance with fundamental rights obligations, bias prevention, and responsible AI deployment.
Composition
| Member | Expertise | Role |
|---|---|---|
| Independent Chair | Ethics, law, or governance | Chairs meetings, breaks ties, signs off on reviews |
| Legal Counsel | AI regulation, data protection, fundamental rights | Legal interpretation, regulatory guidance |
| Technical Expert | AI/ML engineering, data science | Technical feasibility assessment, bias analysis review |
| Domain Expert | Sector-specific knowledge (healthcare, finance, etc.) | Use-case context, impact assessment |
| External Ethicist | Applied ethics, philosophy of technology | Ethical framework application, societal impact |
| User/Affected Person Representative | End-user or affected community perspective | Impact from the perspective of those affected |
| Data Protection Officer | GDPR, data privacy | Personal data processing oversight |
Operating Procedures
Meetings: Quarterly regular meetings; ad-hoc meetings for urgent reviews
Quorum: Minimum of 4 members including Chair and at least one external member
Review triggers:
- New high-risk AI system proposed for development
- Significant change to an existing high-risk AI system
- Bias detection findings requiring mitigation decisions
- Fundamental rights impact assessment results
- Serious incident involving an AI system
- Ethical concern raised by any employee (whistleblower pathway)
Decisions:
- Advisory recommendations (non-binding but must be addressed with documented rationale)
- Escalation to Board of Directors for strategic decisions
- Authority to recommend halting deployment pending investigation
Ethical Review Process
1. SUBMISSION
└── Project team submits AI Ethics Review Request
Including: system description, risk classification,
FRIA (if applicable), bias analysis results
2. SCREENING (5 business days)
└── Ethics Board secretariat reviews for completeness
├── Complete → Schedule for review
└── Incomplete → Return with guidance
3. REVIEW (15 business days)
└── Board members review documentation
└── Meeting to discuss findings and concerns
4. DETERMINATION
├── APPROVED — proceed with noted conditions
├── APPROVED WITH CONDITIONS — proceed after addressing conditions
├── DEFERRED — additional information or analysis required
└── NOT APPROVED — significant ethical concerns; do not proceed
5. FOLLOW-UP
└── Monitor conditions and report back at defined intervals---
AI Registry and Inventory Management
AI System Registry
Maintain a comprehensive registry of all AI systems in the organization. This supports the EU database registration requirement (Art. 49) and internal governance.
Registry Fields
| Field | Description | Required |
|---|---|---|
| System ID | Unique internal identifier | Yes |
| System Name | Human-readable name | Yes |
| Version | Current version | Yes |
| Description | Functional description | Yes |
| Provider | Internal team or external vendor | Yes |
| Risk Classification | Unacceptable / High / Limited / Minimal | Yes |
| Annex III Category | If applicable, which Annex III category | If high-risk |
| Art. 6(3) Exception | Whether exception was claimed and rationale | If Annex III |
| Intended Purpose | Specific use case | Yes |
| Deployment Status | Development / Testing / Staging / Production / Retired | Yes |
| Deployment Date | Date placed on market or put into service | If deployed |
| EU Deployment | Whether deployed or producing outputs used in EU | Yes |
| Affected Persons | Categories of persons affected | Yes |
| Decision Impact | Advisory / Automated with review / Fully automated | Yes |
| Data Types | Personal / Special category / Non-personal | Yes |
| Model Type | Classification, regression, NLP, computer vision, etc. | Yes |
| Conformity Assessment | Status and path (internal / third-party) | If high-risk |
| CE Marking | Whether applied | If high-risk |
| EU Database ID | Registration number in EU database | If registered |
| Post-Market Monitoring | Monitoring plan reference | If high-risk |
| Responsible Person | Internal compliance owner | Yes |
| Ethics Review | Status and reference | If high-risk |
| Last Review Date | Date of last compliance review | Yes |
| Next Review Date | Scheduled next review | Yes |
Inventory Management Process
1. DISCOVERY
└── Identify all AI systems across the organization
├── Procurement records (vendor AI systems)
├── IT system inventory
├── Development team records
└── Shadow AI detection (unofficial AI tool usage)
2. REGISTRATION
└── Enter each AI system into the registry
└── Complete all required fields
3. CLASSIFICATION
└── Apply risk classification (use ai_risk_classifier.py)
└── Document classification rationale
4. ONGOING MANAGEMENT
├── New systems: Register before development begins
├── Changes: Update registry on any significant change
├── Retirement: Mark as retired, retain records
└── Reviews: Quarterly review of all active systems
5. REPORTING
├── Management dashboard: Active systems by risk level
├── Compliance status: Gap analysis per system
└── Board reporting: Summary metrics and risk postureShadow AI Detection
Organizations must also detect and manage unofficial AI system usage:
| Detection Method | Description |
|---|---|
| Network monitoring | Detect API calls to AI services (OpenAI, Anthropic, Google, etc.) |
| Procurement review | Review software subscriptions for AI tools |
| Employee surveys | Periodic surveys about AI tool usage |
| IT policy enforcement | Acceptable use policies for AI tools |
| Data flow analysis | Detect organizational data flowing to AI services |
---
Model Lifecycle Governance
Lifecycle Stages
┌─────────┐ ┌───────────┐ ┌──────────┐ ┌────────────┐ ┌───────────┐
│ CONCEPT │ -> │ DEVELOP │ -> │ VALIDATE │ -> │ DEPLOY │ -> │ MONITOR │
│ & DESIGN │ │ & TRAIN │ │ & TEST │ │ & OPERATE │ │ & MAINTAIN│
└─────────┘ └───────────┘ └──────────┘ └────────────┘ └───────────┘
│
v
┌───────────┐
│ RETIRE │
└───────────┘Stage 1: Concept and Design
| Activity | Governance Control | AI Act Reference |
|---|---|---|
| Define intended purpose | Document and get approval | Art. 13 |
| Risk classification | Classify using decision tree | Art. 6 |
| Ethics review (high-risk) | Submit to AI Ethics Board | Best practice |
| FRIA (public bodies) | Complete before design | Art. 27 |
| Data requirements | Define data needs and governance plan | Art. 10 |
| Resource allocation | Budget for compliance activities | Art. 17 |
Gate criteria: Risk classification completed and documented; ethics review approved (if high-risk); resource plan approved.
Stage 2: Develop and Train
| Activity | Governance Control | AI Act Reference |
|---|---|---|
| Data collection and preparation | Follow data governance policy | Art. 10 |
| Bias examination | Run bias detection on training data | Art. 10(2)(f) |
| Model training | Document architecture, parameters, choices | Art. 11 |
| Risk identification | Identify known and foreseeable risks | Art. 9 |
| Technical documentation | Begin drafting technical file | Art. 11 |
Gate criteria: Bias examination completed; risks identified and documented; technical documentation initiated.
Stage 3: Validate and Test
| Activity | Governance Control | AI Act Reference |
|---|---|---|
| Performance testing | Test against defined metrics and thresholds | Art. 9(7) |
| Fairness testing | Test outcomes across demographic groups | Art. 10(2)(f) |
| Robustness testing | Test with noisy, adversarial, and edge-case inputs | Art. 15 |
| Security testing | Test for AI-specific vulnerabilities | Art. 15 |
| Human oversight testing | Verify oversight mechanisms function correctly | Art. 14 |
| Logging verification | Verify automatic logging captures required data | Art. 12 |
Gate criteria: All tests passed or accepted with documented rationale; risk management measures verified; technical documentation complete.
Stage 4: Deploy and Operate
| Activity | Governance Control | AI Act Reference |
|---|---|---|
| Conformity assessment | Complete internal control or third-party assessment | Art. 43 |
| CE marking | Affix before placing on market | Art. 48 |
| EU database registration | Register before deployment | Art. 49 |
| Deploy instructions for use | Provide to all deployers | Art. 13 |
| Activate monitoring | Start post-market monitoring system | Art. 72 |
| Train oversight personnel | Ensure competency of human overseers | Art. 14 |
| Inform workers | Notify workers subject to AI system | Art. 26(7) |
Gate criteria: Conformity assessment completed; CE marking applied; EU database registration confirmed; monitoring active.
Stage 5: Monitor and Maintain
| Activity | Governance Control | AI Act Reference |
|---|---|---|
| Performance monitoring | Continuous performance and drift tracking | Art. 72 |
| Bias monitoring | Ongoing fairness metric tracking | Art. 10, 72 |
| Incident management | Detect, classify, respond, report incidents | Art. 73 |
| Risk management updates | Update risk assessment with new data | Art. 9 |
| Model retraining | Governed retraining process with validation | Art. 9, 10, 11 |
| Documentation updates | Keep technical documentation current | Art. 11 |
| Periodic review | Regular compliance review | Art. 17 |
Triggers for re-assessment:
- Significant model performance degradation
- Bias metric exceeding defined thresholds
- Serious incident reported
- Change in intended purpose or deployment context
- Material change to the model (retraining, architecture change)
- Regulatory guidance update
Stage 6: Retirement
| Activity | Governance Control |
|---|---|
| Retirement decision | Documented rationale for retirement |
| Data retention | Retain logs and documentation per retention policy |
| EU database update | Update registration to reflect retirement |
| Notification | Inform deployers and affected parties |
| Knowledge transfer | Document lessons learned |
| Archive | Archive technical documentation per retention requirements |
---
Responsible AI Principles — Legal Requirements Mapping
Mapping Ethical Principles to Legal Obligations
| Responsible AI Principle | EU AI Act Legal Requirement | Articles |
|---|---|---|
| Transparency | System transparency; instructions for use; AI interaction disclosure | Art. 13, Art. 50 |
| Fairness and Non-discrimination | Data governance; bias examination and mitigation; representative datasets | Art. 10(2)(f)(g) |
| Accountability | QMS accountability framework; record-keeping; traceability | Art. 12, Art. 17 |
| Safety | Risk management system; accuracy, robustness, cybersecurity | Art. 9, Art. 15 |
| Human Agency | Human oversight; automation bias safeguards; intervention mechanisms | Art. 14 |
| Privacy | Data governance; GDPR alignment; special category data safeguards | Art. 10(5), GDPR |
| Societal Wellbeing | Fundamental rights impact assessment; prohibited practices | Art. 5, Art. 27 |
| Explainability | Transparency to deployers; interpretable outputs | Art. 13, Art. 14 |
| Robustness | Accuracy and robustness requirements; adversarial resilience | Art. 15 |
| Sustainability | Energy reporting for GPAI; voluntary codes of conduct | Art. 55(1)(e), Art. 95 |
---
AI Incident Management
Incident Classification
| Severity | Definition | Response Time | Reporting |
|---|---|---|---|
| Critical | Serious incident — death, serious damage to health, serious and irreversible disruption to critical infrastructure, serious breach of fundamental rights | Immediate response | Report to market surveillance authority within 15 days (Art. 73) |
| High | Near-miss serious incident or significant malfunction with potential for serious consequences | Within 4 hours | Internal escalation; assess if Art. 73 reporting required |
| Medium | Malfunction affecting performance but not meeting serious incident criteria | Within 24 hours | Internal documentation; provider notification |
| Low | Minor anomaly, degraded performance within acceptable bounds | Within 1 week | Internal logging; trend monitoring |
Serious Incident Definition (Art. 3(49))
An incident or malfunctioning of an AI system that directly or indirectly leads to any of the following: 1. Death or serious damage to the health of a person 2. Serious and irreversible disruption of the management or operation of critical infrastructure 3. Breach of obligations under Union law intended to protect fundamental rights 4. Serious damage to property or the environment
Incident Response Process
1. DETECTION
├── Automated monitoring alerts
├── Human oversight personnel reports
├── Deployer incident reports
├── Affected person complaints
└── External reports (authorities, media)
2. TRIAGE (within 1 hour)
├── Classify severity (Critical / High / Medium / Low)
├── Assign incident owner
├── Determine if serious incident (Art. 3(49))
└── Activate appropriate response team
3. CONTAINMENT (immediate for Critical/High)
├── Assess need to halt system operation
├── Implement immediate corrective measures
├── Preserve evidence and logs
└── Secure affected data
4. INVESTIGATION
├── Root cause analysis
├── Impact assessment (persons affected, scope, severity)
├── Review risk management adequacy
├── Assess whether system still meets requirements
└── Identify systemic issues
5. REPORTING (within 15 days for serious incidents)
├── Report to market surveillance authority (Art. 73)
│ ├── Authorities of ALL member states where incident occurred
│ ├── Include: description, corrective actions, known details
│ └── Follow up with additional information as available
├── Report to notified body (if applicable)
└── Notify deployers
6. CORRECTIVE ACTION
├── Implement corrective measures
├── Update risk management system
├── Update technical documentation
├── Retrain model if needed (with governance controls)
└── Communicate changes to deployers
7. CLOSURE AND LEARNING
├── Verify corrective actions are effective
├── Update post-market monitoring system
├── Document lessons learned
├── Update AI literacy training if needed
└── Close incident recordIncident Documentation Requirements
| Field | Description |
|---|---|
| Incident ID | Unique identifier |
| Detection date/time | When incident was detected |
| Occurrence date/time | When incident occurred (if different) |
| AI System | System name, version, registration number |
| Severity classification | Critical / High / Medium / Low |
| Serious incident? | Yes/No per Art. 3(49) criteria |
| Description | What happened |
| Root cause | Identified or suspected root cause |
| Affected persons | Number and categories of affected persons |
| Impact | Health, safety, fundamental rights, property, environment |
| Containment actions | Immediate actions taken |
| Corrective actions | Remediation measures |
| Reporting | Authorities notified, dates, references |
| Status | Open / Under investigation / Corrective action / Closed |
| Closure date | When incident was closed |
| Lessons learned | Insights for preventing recurrence |
---
Conformity Assessment Procedures
Internal Control Procedure (Annex VI)
For high-risk AI systems where internal control is sufficient (Annex III categories 2-8, with harmonised standards applied):
PHASE 1: PREPARATION (months 1-3)
├── 1.1 Establish/verify QMS meets Art. 17 requirements
├── 1.2 Verify all Chapter III Section 2 requirements are implemented
├── 1.3 Compile technical documentation (Art. 11, Annex IV)
├── 1.4 Complete all testing (accuracy, robustness, cybersecurity, fairness)
└── 1.5 Designate person(s) responsible for conformity assessment
PHASE 2: INTERNAL ASSESSMENT (months 3-5)
├── 2.1 Review technical documentation for completeness and accuracy
├── 2.2 Verify risk management system (Art. 9)
│ ├── Risks identified, evaluated, and controlled
│ ├── Testing completed against defined metrics
│ └── Residual risks acceptable
├── 2.3 Verify data governance (Art. 10)
│ ├── Data quality criteria met
│ ├── Bias examined and mitigated
│ └── Special category data handled properly
├── 2.4 Verify record-keeping (Art. 12)
│ ├── Automatic logging implemented
│ └── Retention periods defined
├── 2.5 Verify transparency (Art. 13)
│ ├── Instructions for use complete
│ └── All required information included
├── 2.6 Verify human oversight (Art. 14)
│ ├── Oversight level appropriate
│ ├── Mechanisms functional
│ └── Automation bias safeguards in place
├── 2.7 Verify accuracy, robustness, cybersecurity (Art. 15)
│ ├── Performance metrics meet targets
│ ├── Robustness tested
│ └── Cybersecurity measures proportionate
├── 2.8 Verify QMS (Art. 17)
│ └── All QMS elements documented and implemented
└── 2.9 Document assessment findings and conclusions
PHASE 3: DECLARATION (month 5-6)
├── 3.1 Prepare EU Declaration of Conformity (Art. 47)
│ ├── Provider name and address
│ ├── AI system identification
│ ├── Declaration of conformity with AI Act
│ ├── Reference to harmonised standards applied
│ ├── Signed by authorized representative
│ └── Date and place of issuance
├── 3.2 Affix CE marking (Art. 48)
├── 3.3 Register in EU database (Art. 49)
└── 3.4 Retain documentation for 10 years
PHASE 4: POST-MARKET (ongoing)
├── 4.1 Implement post-market monitoring system (Art. 72)
├── 4.2 Maintain documentation updates
├── 4.3 Report serious incidents within 15 days (Art. 73)
├── 4.4 Re-assess conformity on significant changes
└── 4.5 Annual compliance reviewThird-Party Assessment Procedure (Annex VII)
For biometric identification systems (Annex III category 1) and cases where harmonised standards are insufficient:
PHASE 1: PREPARATION (months 1-4)
├── 1.1 Complete all Phase 1 steps from internal control procedure
├── 1.2 Select notified body
│ ├── Check notified body competence and scope
│ ├── Verify designation covers the AI system type
│ └── Agree on timeline and scope of assessment
└── 1.3 Prepare submission package for notified body
PHASE 2: QMS ASSESSMENT BY NOTIFIED BODY (months 4-8)
├── 2.1 Submit QMS documentation to notified body
├── 2.2 Notified body reviews:
│ ├── QMS documentation completeness
│ ├── QMS implementation (may include on-site audit)
│ ├── Representative sample of AI system development records
│ └── Evidence of QMS effectiveness
├── 2.3 Notified body determination:
│ ├── QMS certificate issued → proceed to Phase 3
│ └── Corrective action required → address and re-submit
└── 2.4 QMS certificate issued (valid for specified period)
PHASE 3: TECHNICAL DOCUMENTATION ASSESSMENT (months 6-10)
├── 3.1 Submit complete technical documentation to notified body
├── 3.2 Notified body reviews:
│ ├── Technical documentation completeness (Annex IV)
│ ├── System compliance with requirements (Art. 9-15)
│ ├── Data governance and bias examination results
│ ├── Testing and validation results
│ └── Human oversight design
├── 3.3 Notified body may:
│ ├── Request additional testing
│ ├── Conduct independent testing
│ ├── Review source code or training data (subject to confidentiality)
│ └── Interview development team
├── 3.4 Notified body determination:
│ ├── EU type-examination certificate issued → proceed to Phase 4
│ └── Non-conformity identified → address and re-submit
└── 3.5 Type-examination certificate issued (valid for specified period)
PHASE 4: DECLARATION AND MARKING (months 10-12)
├── 4.1 Prepare EU Declaration of Conformity
│ ├── Reference both QMS certificate and type-examination certificate
│ └── Include notified body identification number
├── 4.2 Affix CE marking with notified body identification number
├── 4.3 Register in EU database
└── 4.4 Retain documentation for 10 years
PHASE 5: ONGOING SURVEILLANCE (annual)
├── 5.1 Notified body periodic surveillance audits
├── 5.2 Notify notified body of any planned significant changes
├── 5.3 Obtain approval before implementing significant changes
├── 5.4 Maintain QMS and technical documentation
└── 5.5 Report serious incidents to notified bodySelecting the Correct Assessment Path
| System Category | Default Path | Conditions for Alternative |
|---|---|---|
| Annex III, point 1 (biometrics) | Third-party (Annex VII) | No alternative — third-party required |
| Annex III, points 2-8 | Internal control (Annex VI) | Third-party required if harmonised standards not applied or do not fully cover requirements |
| Annex I products (safety components) | Per product legislation | Follow the applicable product conformity assessment |
| GPAI models | No conformity assessment per se | Compliance demonstration to AI Office |
---
CE Marking Process for AI Systems
CE Marking Requirements (Art. 48)
| Requirement | Detail |
|---|---|
| Visibility | CE marking must be visible on the AI system, its packaging, or accompanying documentation |
| Legibility | Must be clearly legible (minimum 5mm height per Regulation 765/2008 unless impractical) |
| Indelibility | Must be indelible — cannot be easily removed |
| Notified body number | If third-party assessment performed, include the notified body's four-digit identification number |
| Timing | Must be affixed BEFORE placing on the market |
| Single marking | One CE marking per system — covers both product legislation and AI Act if applicable |
CE Marking Process
1. CONFIRM ELIGIBILITY
└── System has completed conformity assessment (Annex VI or VII)
2. PREPARE DECLARATION
└── EU Declaration of Conformity signed per Art. 47
3. DESIGN MARKING
├── Standard CE marking format
├── Add notified body number (if applicable): CE XXXX
└── Determine placement (system, packaging, or documentation)
4. APPLY MARKING
├── For software: In the system UI, About screen, or documentation
├── For hardware: Physical marking on the device
├── For digital-only: In documentation and EU database entry
└── Ensure visibility, legibility, indelibility
5. REGISTER
└── Update EU database registration with CE marking status
6. MAINTAIN
├── Ensure marking remains valid throughout system lifetime
├── Re-assess if significant changes are made
└── Remove if conformity can no longer be ensuredDeclaration of Conformity Content (Art. 47)
The EU Declaration of Conformity must contain:
| Element | Description |
|---|---|
| Provider details | Name and address of the provider |
| AI system identification | System name, type, version, serial number or batch identifier |
| Conformity statement | Statement that the AI system is in conformity with the AI Act |
| Standards | References to harmonised standards or common specifications applied |
| Notified body | Name, number, and certificate references (if applicable) |
| Additional legislation | Reference to any other applicable EU legislation |
| Signature | Signed by a person authorised to bind the provider |
| Date and place | Date and place of issue |
| Responsible person | Name, position, and contact details of the person signing |
---
Last Updated: March 2026 Regulation Reference: Regulation (EU) 2024/1689 — EU Artificial Intelligence Act
#!/usr/bin/env python3
"""
EU AI Act Bias Detector
Analyzes dataset statistics for bias indicators and generates a fairness
assessment report mapped to EU AI Act data governance requirements (Art. 10).
Works with JSON input describing dataset demographics and outcomes — does NOT
perform actual ML or process raw data.
Usage:
python ai_bias_detector.py --input dataset_stats.json
python ai_bias_detector.py --input dataset_stats.json --json
python ai_bias_detector.py --input dataset_stats.json --protected-attributes gender,age_group,ethnicity
python ai_bias_detector.py --input dataset_stats.json --output report.json
Input JSON schema:
{
"dataset_name": "Training Dataset v2.1",
"total_samples": 50000,
"description": "Loan application dataset for credit scoring model",
"target_variable": "loan_approved",
"positive_label": "approved",
"demographics": {
"gender": {
"male": {"count": 30000, "positive_outcomes": 24000},
"female": {"count": 20000, "positive_outcomes": 14000}
},
"age_group": {
"18-25": {"count": 8000, "positive_outcomes": 4800},
"26-40": {"count": 20000, "positive_outcomes": 16000},
"41-60": {"count": 15000, "positive_outcomes": 12000},
"60+": {"count": 7000, "positive_outcomes": 5250}
},
"ethnicity": {
"group_a": {"count": 35000, "positive_outcomes": 28000},
"group_b": {"count": 10000, "positive_outcomes": 7000},
"group_c": {"count": 5000, "positive_outcomes": 3000}
}
},
"population_distribution": {
"gender": {"male": 0.49, "female": 0.51},
"age_group": {"18-25": 0.15, "26-40": 0.35, "41-60": 0.30, "60+": 0.20},
"ethnicity": {"group_a": 0.60, "group_b": 0.25, "group_c": 0.15}
},
"feature_correlations": {
"zip_code": {"gender": 0.05, "ethnicity": 0.72},
"education_level": {"gender": 0.12, "age_group": 0.35},
"income": {"gender": 0.28, "ethnicity": 0.31}
}
}
"""
import argparse
import json
import math
import sys
from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple
# ---------------------------------------------------------------------------
# Thresholds and configuration
# ---------------------------------------------------------------------------
# Representation ratio: dataset proportion / population proportion
# Acceptable range: 0.8 to 1.25 (within 20% of expected)
REPRESENTATION_RATIO_MIN = 0.8
REPRESENTATION_RATIO_MAX = 1.25
# Class imbalance: smallest group / largest group
# Acceptable: > 0.5 (no group less than half the largest)
CLASS_IMBALANCE_THRESHOLD = 0.5
# Four-fifths rule for disparate impact
# Ratio of positive outcome rates: minority / majority must be >= 0.8
FOUR_FIFTHS_THRESHOLD = 0.8
# Feature correlation threshold for proxy variable detection
PROXY_CORRELATION_THRESHOLD = 0.5
# Minimum group size for reliable statistical analysis
MIN_GROUP_SIZE = 30
# ---------------------------------------------------------------------------
# Analysis functions
# ---------------------------------------------------------------------------
def analyze_representation(
demographics: Dict[str, Dict],
population: Optional[Dict[str, Dict]],
total_samples: int,
) -> List[Dict[str, Any]]:
"""Analyze demographic representation in the dataset."""
findings = []
for attribute, groups in demographics.items():
pop_dist = population.get(attribute, {}) if population else {}
group_counts = {name: info["count"] for name, info in groups.items()}
total_in_attr = sum(group_counts.values())
# Class imbalance check
if group_counts:
max_count = max(group_counts.values())
min_count = min(group_counts.values())
min_group = [k for k, v in group_counts.items() if v == min_count][0]
max_group = [k for k, v in group_counts.items() if v == max_count][0]
imbalance_ratio = min_count / max_count if max_count > 0 else 0
finding = {
"attribute": attribute,
"type": "class_imbalance",
"metric": "imbalance_ratio",
"value": round(imbalance_ratio, 4),
"threshold": CLASS_IMBALANCE_THRESHOLD,
"smallest_group": min_group,
"smallest_count": min_count,
"largest_group": max_group,
"largest_count": max_count,
"passed": imbalance_ratio >= CLASS_IMBALANCE_THRESHOLD,
"severity": "LOW" if imbalance_ratio >= CLASS_IMBALANCE_THRESHOLD else (
"MEDIUM" if imbalance_ratio >= 0.25 else "HIGH"
),
}
findings.append(finding)
# Representation ratio check (if population data available)
if pop_dist:
for group_name, group_info in groups.items():
expected_prop = pop_dist.get(group_name)
if expected_prop is None or expected_prop == 0:
continue
actual_prop = group_info["count"] / total_in_attr if total_in_attr > 0 else 0
rep_ratio = actual_prop / expected_prop
finding = {
"attribute": attribute,
"group": group_name,
"type": "representation_ratio",
"metric": "representation_ratio",
"actual_proportion": round(actual_prop, 4),
"expected_proportion": round(expected_prop, 4),
"value": round(rep_ratio, 4),
"threshold_min": REPRESENTATION_RATIO_MIN,
"threshold_max": REPRESENTATION_RATIO_MAX,
"passed": REPRESENTATION_RATIO_MIN <= rep_ratio <= REPRESENTATION_RATIO_MAX,
"severity": "LOW" if REPRESENTATION_RATIO_MIN <= rep_ratio <= REPRESENTATION_RATIO_MAX else (
"MEDIUM" if 0.5 <= rep_ratio <= 2.0 else "HIGH"
),
}
if rep_ratio < REPRESENTATION_RATIO_MIN:
finding["issue"] = f"Group '{group_name}' is UNDERREPRESENTED (ratio {rep_ratio:.2f})"
elif rep_ratio > REPRESENTATION_RATIO_MAX:
finding["issue"] = f"Group '{group_name}' is OVERREPRESENTED (ratio {rep_ratio:.2f})"
findings.append(finding)
# Small group size warning
for group_name, group_info in groups.items():
if group_info["count"] < MIN_GROUP_SIZE:
findings.append({
"attribute": attribute,
"group": group_name,
"type": "small_sample",
"metric": "group_size",
"value": group_info["count"],
"threshold": MIN_GROUP_SIZE,
"passed": False,
"severity": "HIGH",
"issue": f"Group '{group_name}' has fewer than {MIN_GROUP_SIZE} samples — statistical analysis unreliable",
})
return findings
def analyze_outcome_fairness(
demographics: Dict[str, Dict],
) -> List[Dict[str, Any]]:
"""Analyze outcome fairness across demographic groups."""
findings = []
for attribute, groups in demographics.items():
# Calculate positive outcome rates for each group
rates = {}
for group_name, group_info in groups.items():
count = group_info.get("count", 0)
positive = group_info.get("positive_outcomes", 0)
if count > 0:
rates[group_name] = positive / count
else:
rates[group_name] = 0.0
if not rates:
continue
max_rate = max(rates.values())
min_rate = min(rates.values())
max_group = [k for k, v in rates.items() if v == max_rate][0]
min_group = [k for k, v in rates.items() if v == min_rate][0]
# Demographic parity (four-fifths rule)
if max_rate > 0:
parity_ratio = min_rate / max_rate
else:
parity_ratio = 1.0 # Both zero
finding = {
"attribute": attribute,
"type": "demographic_parity",
"metric": "four_fifths_ratio",
"value": round(parity_ratio, 4),
"threshold": FOUR_FIFTHS_THRESHOLD,
"advantaged_group": max_group,
"advantaged_rate": round(max_rate, 4),
"disadvantaged_group": min_group,
"disadvantaged_rate": round(min_rate, 4),
"passed": parity_ratio >= FOUR_FIFTHS_THRESHOLD,
"severity": "LOW" if parity_ratio >= FOUR_FIFTHS_THRESHOLD else (
"MEDIUM" if parity_ratio >= 0.6 else "HIGH"
),
}
if not finding["passed"]:
diff_pct = round((1 - parity_ratio) * 100, 1)
finding["issue"] = (
f"Potential disparate impact: '{min_group}' has {diff_pct}% lower positive outcome rate "
f"than '{max_group}' ({min_rate:.1%} vs {max_rate:.1%})"
)
findings.append(finding)
# Pairwise group comparisons
group_names = list(rates.keys())
for i in range(len(group_names)):
for j in range(i + 1, len(group_names)):
g1, g2 = group_names[i], group_names[j]
r1, r2 = rates[g1], rates[g2]
higher = max(r1, r2)
lower = min(r1, r2)
if higher > 0:
pair_ratio = lower / higher
else:
pair_ratio = 1.0
if pair_ratio < FOUR_FIFTHS_THRESHOLD:
adv = g1 if r1 > r2 else g2
dis = g2 if r1 > r2 else g1
findings.append({
"attribute": attribute,
"type": "pairwise_disparity",
"metric": "pairwise_ratio",
"group_1": g1,
"group_1_rate": round(r1, 4),
"group_2": g2,
"group_2_rate": round(r2, 4),
"value": round(pair_ratio, 4),
"threshold": FOUR_FIFTHS_THRESHOLD,
"advantaged_group": adv,
"disadvantaged_group": dis,
"passed": False,
"severity": "MEDIUM" if pair_ratio >= 0.6 else "HIGH",
"issue": f"Disparity between '{dis}' and '{adv}': ratio {pair_ratio:.2f} < {FOUR_FIFTHS_THRESHOLD}",
})
return findings
def analyze_proxy_variables(
correlations: Dict[str, Dict[str, float]],
) -> List[Dict[str, Any]]:
"""Identify features correlated with protected attributes (proxy variables)."""
findings = []
for feature, attr_correlations in correlations.items():
for protected_attr, corr_value in attr_correlations.items():
abs_corr = abs(corr_value)
if abs_corr >= PROXY_CORRELATION_THRESHOLD:
findings.append({
"type": "proxy_variable",
"feature": feature,
"protected_attribute": protected_attr,
"correlation": round(corr_value, 4),
"absolute_correlation": round(abs_corr, 4),
"threshold": PROXY_CORRELATION_THRESHOLD,
"passed": False,
"severity": "MEDIUM" if abs_corr < 0.7 else "HIGH",
"issue": (
f"Feature '{feature}' has high correlation ({corr_value:.2f}) with protected "
f"attribute '{protected_attr}' — potential proxy variable for discrimination"
),
})
elif abs_corr >= 0.3:
findings.append({
"type": "proxy_variable_warning",
"feature": feature,
"protected_attribute": protected_attr,
"correlation": round(corr_value, 4),
"absolute_correlation": round(abs_corr, 4),
"threshold": PROXY_CORRELATION_THRESHOLD,
"passed": True,
"severity": "LOW",
"issue": (
f"Feature '{feature}' has moderate correlation ({corr_value:.2f}) with "
f"'{protected_attr}' — monitor for proxy effects"
),
})
return findings
def generate_mitigation_recommendations(
representation_findings: List[Dict],
fairness_findings: List[Dict],
proxy_findings: List[Dict],
) -> List[Dict[str, str]]:
"""Generate bias mitigation recommendations based on findings."""
recommendations = []
# Representation issues
underrepresented = [
f for f in representation_findings
if f["type"] == "representation_ratio" and not f["passed"]
and f.get("value", 1.0) < REPRESENTATION_RATIO_MIN
]
if underrepresented:
groups = ", ".join(set(f"{f['group']} ({f['attribute']})" for f in underrepresented))
recommendations.append({
"category": "Data Augmentation",
"priority": "HIGH",
"recommendation": f"Augment training data for underrepresented groups: {groups}. "
"Consider synthetic data generation, targeted data collection, or oversampling techniques.",
"ai_act_reference": "Art. 10(2)(f) — datasets shall be representative",
})
overrepresented = [
f for f in representation_findings
if f["type"] == "representation_ratio" and not f["passed"]
and f.get("value", 1.0) > REPRESENTATION_RATIO_MAX
]
if overrepresented:
groups = ", ".join(set(f"{f['group']} ({f['attribute']})" for f in overrepresented))
recommendations.append({
"category": "Data Re-sampling",
"priority": "MEDIUM",
"recommendation": f"Consider undersampling overrepresented groups: {groups}. "
"Alternatively, apply sample weighting to balance group influence during training.",
"ai_act_reference": "Art. 10(2)(f) — datasets shall be representative",
})
# Class imbalance
imbalanced = [
f for f in representation_findings
if f["type"] == "class_imbalance" and not f["passed"]
]
if imbalanced:
for f in imbalanced:
recommendations.append({
"category": "Class Balancing",
"priority": "HIGH" if f["severity"] == "HIGH" else "MEDIUM",
"recommendation": (
f"Address class imbalance in '{f['attribute']}': smallest group '{f['smallest_group']}' "
f"({f['smallest_count']}) is {f['value']:.0%} of largest group '{f['largest_group']}' "
f"({f['largest_count']}). Apply SMOTE, random oversampling, or class weights."
),
"ai_act_reference": "Art. 10(2)(f) — datasets shall be representative",
})
# Outcome fairness
disparities = [f for f in fairness_findings if f["type"] == "demographic_parity" and not f["passed"]]
if disparities:
for f in disparities:
recommendations.append({
"category": "Fairness Constraint",
"priority": "HIGH",
"recommendation": (
f"Disparate impact detected for '{f['attribute']}': '{f['disadvantaged_group']}' receives "
f"positive outcomes at {f['disadvantaged_rate']:.1%} vs '{f['advantaged_group']}' at "
f"{f['advantaged_rate']:.1%}. Consider: (1) threshold calibration per group, "
f"(2) adversarial debiasing during training, (3) reject-option classification for borderline cases."
),
"ai_act_reference": "Art. 10(2)(f)(g) — bias examination and mitigation",
})
# Proxy variables
proxies = [f for f in proxy_findings if f["type"] == "proxy_variable"]
if proxies:
features = ", ".join(set(f["feature"] for f in proxies))
recommendations.append({
"category": "Proxy Variable Mitigation",
"priority": "HIGH",
"recommendation": (
f"High-correlation proxy variables detected: {features}. "
"Options: (1) remove proxy features, (2) apply fair representation learning, "
"(3) use causal inference to separate legitimate from discriminatory effects, "
"(4) apply feature importance analysis to quantify proxy influence on outcomes."
),
"ai_act_reference": "Art. 10(2)(f)(g) — bias examination and mitigation",
})
# Small samples
small = [f for f in representation_findings if f["type"] == "small_sample"]
if small:
groups = ", ".join(f"{f['group']} ({f['attribute']}, n={f['value']})" for f in small)
recommendations.append({
"category": "Data Collection",
"priority": "HIGH",
"recommendation": (
f"Insufficient sample sizes for reliable analysis: {groups}. "
"Collect additional data for these groups before deployment. "
"Statistical conclusions about these groups may be unreliable."
),
"ai_act_reference": "Art. 10(2)(e) — data shall be sufficient for intended purpose",
})
# General recommendations
if not recommendations:
recommendations.append({
"category": "Ongoing Monitoring",
"priority": "LOW",
"recommendation": "No significant bias indicators detected. Continue monitoring fairness metrics "
"during deployment through the post-market monitoring system (Art. 72).",
"ai_act_reference": "Art. 72 — Post-market monitoring",
})
else:
recommendations.append({
"category": "Documentation",
"priority": "MEDIUM",
"recommendation": "Document all bias examination findings, mitigation measures applied, and "
"residual bias levels in the technical documentation (Art. 11) and data governance "
"documentation (Art. 10).",
"ai_act_reference": "Art. 10, Art. 11 — Data governance and technical documentation",
})
recommendations.append({
"category": "Re-evaluation",
"priority": "MEDIUM",
"recommendation": "After implementing mitigation measures, re-run bias analysis to verify improvement. "
"Establish ongoing fairness monitoring as part of post-market monitoring (Art. 72).",
"ai_act_reference": "Art. 9(6) — Testing throughout lifecycle; Art. 72 — Post-market monitoring",
})
return recommendations
def run_bias_analysis(data: Dict[str, Any], protected_attrs: Optional[List[str]] = None) -> Dict[str, Any]:
"""Run complete bias analysis on dataset statistics."""
result = {
"dataset_name": data.get("dataset_name", "Unknown"),
"total_samples": data.get("total_samples", 0),
"description": data.get("description", ""),
"target_variable": data.get("target_variable", "Unknown"),
"analysis_date": datetime.now().strftime("%Y-%m-%d"),
"protected_attributes_analyzed": [],
"representation_findings": [],
"fairness_findings": [],
"proxy_findings": [],
"mitigation_recommendations": [],
"art10_compliance": {},
"overall_assessment": {},
}
demographics = data.get("demographics", {})
population = data.get("population_distribution", {})
correlations = data.get("feature_correlations", {})
# Filter to requested protected attributes
if protected_attrs:
demographics = {k: v for k, v in demographics.items() if k in protected_attrs}
population = {k: v for k, v in population.items() if k in protected_attrs}
result["protected_attributes_analyzed"] = list(demographics.keys())
# Run analyses
representation = analyze_representation(demographics, population, data.get("total_samples", 0))
result["representation_findings"] = representation
fairness = analyze_outcome_fairness(demographics)
result["fairness_findings"] = fairness
proxy = analyze_proxy_variables(correlations)
result["proxy_findings"] = proxy
# Generate recommendations
result["mitigation_recommendations"] = generate_mitigation_recommendations(
representation, fairness, proxy
)
# Art. 10 compliance mapping
result["art10_compliance"] = _assess_art10_compliance(data, representation, fairness, proxy)
# Overall assessment
all_findings = representation + fairness + proxy
high_severity = [f for f in all_findings if f.get("severity") == "HIGH" and not f.get("passed", True)]
medium_severity = [f for f in all_findings if f.get("severity") == "MEDIUM" and not f.get("passed", True)]
failed = [f for f in all_findings if not f.get("passed", True)]
if high_severity:
assessment = "HIGH_RISK"
description = (
f"Significant bias indicators detected: {len(high_severity)} high-severity issues. "
"Bias mitigation is REQUIRED before deployment per Art. 10(2)(f)(g)."
)
elif medium_severity:
assessment = "MODERATE_RISK"
description = (
f"Moderate bias indicators detected: {len(medium_severity)} medium-severity issues. "
"Bias mitigation is RECOMMENDED. Document findings and rationale for any accepted risks."
)
elif failed:
assessment = "LOW_RISK"
description = (
f"Minor bias indicators detected: {len(failed)} low-severity issues. "
"Monitor during deployment. Document examination results."
)
else:
assessment = "ACCEPTABLE"
description = "No significant bias indicators detected. Continue monitoring during deployment."
result["overall_assessment"] = {
"risk_level": assessment,
"description": description,
"total_findings": len(all_findings),
"findings_passed": len(all_findings) - len(failed),
"findings_failed": len(failed),
"high_severity_count": len(high_severity),
"medium_severity_count": len(medium_severity),
}
return result
def _assess_art10_compliance(
data: Dict,
representation: List[Dict],
fairness: List[Dict],
proxy: List[Dict],
) -> Dict[str, Any]:
"""Map findings to Art. 10 data governance requirements."""
compliance = {
"art_10_2_a": {
"requirement": "Design choices about data documented",
"status": "PRESENT" if data.get("description") else "MISSING",
"note": "Dataset description provided" if data.get("description") else "No dataset description provided — document data collection design choices",
},
"art_10_2_e": {
"requirement": "Data sufficient for intended purpose",
"status": "UNKNOWN",
"note": f"Dataset contains {data.get('total_samples', 0)} samples. Sufficiency depends on model complexity and intended purpose — requires domain assessment.",
},
"art_10_2_f_representativeness": {
"requirement": "Data representative of target population",
"status": "ASSESSED",
"issues_found": len([f for f in representation if f["type"] == "representation_ratio" and not f["passed"]]),
"note": "",
},
"art_10_2_f_bias_examination": {
"requirement": "Datasets examined for possible biases",
"status": "COMPLETED",
"note": f"Bias examination completed. {len(representation) + len(fairness) + len(proxy)} checks performed.",
},
"art_10_2_g_bias_mitigation": {
"requirement": "Appropriate bias mitigation measures",
"status": "RECOMMENDATIONS_PROVIDED",
"note": "See mitigation recommendations section for specific measures to address identified biases.",
},
}
rep_issues = compliance["art_10_2_f_representativeness"]["issues_found"]
if rep_issues == 0:
compliance["art_10_2_f_representativeness"]["note"] = "No significant representation gaps detected."
else:
compliance["art_10_2_f_representativeness"]["note"] = (
f"{rep_issues} representation issues detected. Mitigation required."
)
# Check for population distribution availability
if data.get("population_distribution"):
compliance["art_10_2_f_representativeness"]["population_data"] = "PROVIDED"
else:
compliance["art_10_2_f_representativeness"]["population_data"] = "NOT_PROVIDED"
compliance["art_10_2_f_representativeness"]["note"] += (
" Population distribution data not provided — representativeness assessment is limited."
)
return compliance
# ---------------------------------------------------------------------------
# Output formatting
# ---------------------------------------------------------------------------
def format_text_report(result: Dict[str, Any]) -> str:
"""Format bias analysis result as a human-readable report."""
lines = []
lines.append("=" * 72)
lines.append("EU AI ACT BIAS DETECTION REPORT")
lines.append("Art. 10 — Data and Data Governance")
lines.append("Regulation (EU) 2024/1689")
lines.append("=" * 72)
lines.append("")
lines.append(f"Dataset: {result['dataset_name']}")
lines.append(f"Total Samples: {result['total_samples']:,}")
lines.append(f"Target Variable: {result['target_variable']}")
lines.append(f"Analysis Date: {result['analysis_date']}")
lines.append(f"Attributes Analyzed: {', '.join(result['protected_attributes_analyzed'])}")
lines.append("")
# Overall assessment
assessment = result["overall_assessment"]
lines.append("-" * 72)
lines.append("OVERALL ASSESSMENT")
lines.append("-" * 72)
lines.append(f" Risk Level: {assessment['risk_level']}")
lines.append(f" Total Checks: {assessment['total_findings']}")
lines.append(f" Passed: {assessment['findings_passed']}")
lines.append(f" Failed: {assessment['findings_failed']}")
lines.append(f" High Severity: {assessment['high_severity_count']}")
lines.append(f" Medium Severity: {assessment['medium_severity_count']}")
lines.append(f" Assessment: {assessment['description']}")
lines.append("")
# Representation findings
rep = result["representation_findings"]
if rep:
lines.append("-" * 72)
lines.append("REPRESENTATION ANALYSIS")
lines.append("-" * 72)
for f in rep:
status = "PASS" if f["passed"] else "FAIL"
lines.append(f"\n [{status}] {f['type'].replace('_', ' ').title()}")
if "attribute" in f:
lines.append(f" Attribute: {f['attribute']}")
if "group" in f:
lines.append(f" Group: {f['group']}")
lines.append(f" Value: {f['value']}")
if "threshold" in f:
lines.append(f" Threshold: {f['threshold']}")
if "issue" in f:
lines.append(f" Issue: {f['issue']}")
lines.append(f" Severity: {f['severity']}")
lines.append("")
# Fairness findings
fair = result["fairness_findings"]
if fair:
lines.append("-" * 72)
lines.append("OUTCOME FAIRNESS ANALYSIS")
lines.append("-" * 72)
for f in fair:
status = "PASS" if f["passed"] else "FAIL"
lines.append(f"\n [{status}] {f['type'].replace('_', ' ').title()}")
lines.append(f" Attribute: {f['attribute']}")
if f["type"] == "demographic_parity":
lines.append(f" Four-fifths ratio: {f['value']:.4f} (threshold: {f['threshold']})")
lines.append(f" Advantaged: {f['advantaged_group']} ({f['advantaged_rate']:.1%})")
lines.append(f" Disadvantaged: {f['disadvantaged_group']} ({f['disadvantaged_rate']:.1%})")
elif f["type"] == "pairwise_disparity":
lines.append(f" {f['group_1']} ({f['group_1_rate']:.1%}) vs {f['group_2']} ({f['group_2_rate']:.1%})")
lines.append(f" Ratio: {f['value']:.4f}")
if "issue" in f:
lines.append(f" Issue: {f['issue']}")
lines.append(f" Severity: {f['severity']}")
lines.append("")
# Proxy variable findings
proxy = result["proxy_findings"]
if proxy:
lines.append("-" * 72)
lines.append("PROXY VARIABLE ANALYSIS")
lines.append("-" * 72)
for f in proxy:
status = "PASS" if f["passed"] else "FAIL"
lines.append(f"\n [{status}] {f['feature']} <-> {f['protected_attribute']}")
lines.append(f" Correlation: {f['correlation']:.4f}")
lines.append(f" Threshold: {f['threshold']}")
if "issue" in f:
lines.append(f" Issue: {f['issue']}")
lines.append(f" Severity: {f['severity']}")
lines.append("")
# Art. 10 compliance mapping
art10 = result["art10_compliance"]
if art10:
lines.append("-" * 72)
lines.append("ART. 10 DATA GOVERNANCE COMPLIANCE MAPPING")
lines.append("-" * 72)
for key, item in art10.items():
lines.append(f"\n [{item['status']}] {item['requirement']}")
lines.append(f" {item['note']}")
lines.append("")
# Mitigation recommendations
recs = result["mitigation_recommendations"]
if recs:
lines.append("-" * 72)
lines.append("MITIGATION RECOMMENDATIONS")
lines.append("-" * 72)
for r in recs:
lines.append(f"\n [{r['priority']}] {r['category']}")
lines.append(f" {r['recommendation']}")
lines.append(f" Reference: {r['ai_act_reference']}")
lines.append("")
lines.append("=" * 72)
lines.append("End of Report")
lines.append("=" * 72)
return "\n".join(lines)
# ---------------------------------------------------------------------------
# CLI
# ---------------------------------------------------------------------------
def main():
parser = argparse.ArgumentParser(
description="EU AI Act Bias Detector — Analyze dataset statistics for bias indicators (Art. 10)",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
%(prog)s --input dataset_stats.json
%(prog)s --input dataset_stats.json --json
%(prog)s --input dataset_stats.json --protected-attributes gender,age_group,ethnicity
%(prog)s --input dataset_stats.json --output report.json
""",
)
parser.add_argument("--input", "-i", required=True, help="Path to JSON file with dataset statistics")
parser.add_argument("--output", "-o", help="Path to write output report (default: stdout)")
parser.add_argument("--json", action="store_true", help="Output in JSON format")
parser.add_argument(
"--protected-attributes",
help="Comma-separated list of protected attributes to analyze (default: all in input)",
)
args = parser.parse_args()
try:
with open(args.input, "r", encoding="utf-8") as f:
data = json.load(f)
except FileNotFoundError:
print(f"Error: File not found — {args.input}", file=sys.stderr)
sys.exit(1)
except json.JSONDecodeError as e:
print(f"Error: Invalid JSON in {args.input} — {e}", file=sys.stderr)
sys.exit(1)
protected_attrs = None
if args.protected_attributes:
protected_attrs = [a.strip() for a in args.protected_attributes.split(",")]
result = run_bias_analysis(data, protected_attrs)
if args.json:
output = json.dumps(result, indent=2, ensure_ascii=False)
else:
output = format_text_report(result)
if args.output:
with open(args.output, "w", encoding="utf-8") as f:
f.write(output)
print(f"Report written to {args.output}")
else:
print(output)
if __name__ == "__main__":
main()
Related skills
FAQ
What are the risk tiers?
Four tiers: prohibited practices (Art. 5), high-risk (Art. 6 / Annex III), limited-risk (Art. 50 transparency), and minimal-risk.
Does it handle GPAI models?
Yes. It covers GPAI model compliance including the systemic-risk path for models trained with more than 10^25 FLOPs.