From ai-privacy-governance-skills
Assesses AI bias risks for GDPR Art. 9 special category data and AI Act Art. 10 governance. Covers fairness metrics, bias detection, mitigation strategies, and documentation for protected characteristics.
npx claudepluginhub mukul975/privacy-data-protection-skills --plugin ai-privacy-governance-skillsThis skill uses the workspace's default tool permissions.
AI systems can amplify, perpetuate, or introduce bias against protected groups defined by GDPR Art. 9 special categories (race, ethnicity, political opinion, religion, trade union membership, genetic data, biometric data, health, sexual orientation) and by EU equality law (gender, age, disability). The AI Act Art. 10 requires data governance practices for training data that address bias, while ...
Conducts multi-round deep research on GitHub repos via API and web searches, generating markdown reports with executive summaries, timelines, metrics, and Mermaid diagrams.
Dynamically discovers and combines enabled skills into cohesive, unexpected delightful experiences like interactive HTML or themed artifacts. Activates on 'surprise me', inspiration, or boredom cues.
Generates images from structured JSON prompts via Python script execution. Supports reference images and aspect ratios for characters, scenes, products, visuals.
AI systems can amplify, perpetuate, or introduce bias against protected groups defined by GDPR Art. 9 special categories (race, ethnicity, political opinion, religion, trade union membership, genetic data, biometric data, health, sexual orientation) and by EU equality law (gender, age, disability). The AI Act Art. 10 requires data governance practices for training data that address bias, while Art. 5 prohibits AI-based social scoring. This skill provides the methodology for detecting, measuring, and mitigating bias in AI systems that process or infer special category data, with documentation requirements meeting both GDPR and AI Act obligations.
When AI systems directly process Art. 9 data:
| Category | AI Bias Risk | Example |
|---|---|---|
| Racial or ethnic origin | Discrimination in hiring, credit, policing | CV screening penalising names associated with ethnic minorities |
| Political opinions | Political profiling, content suppression | News recommendation amplifying or suppressing political viewpoints |
| Religious beliefs | Service denial, discriminatory targeting | Insurance pricing varying by religious affiliation |
| Trade union membership | Employment discrimination | Performance scoring penalising union activity |
| Genetic data | Genetic discrimination in insurance/employment | Health insurance pricing based on genetic predisposition |
| Biometric data | Differential accuracy across demographics | Facial recognition with higher error rates for darker skin tones |
| Health data | Health-based discrimination | Hiring algorithms penalising disability or mental health history |
| Sexual orientation | Discrimination, outing | Content recommendation inadvertently revealing sexual orientation |
AI models frequently infer Art. 9 data from non-sensitive features:
| Proxy Feature | Inferred Category | Mechanism |
|---|---|---|
| Postcode/zip code | Race/ethnicity, income | Residential segregation patterns |
| First/last name | Race/ethnicity, religion | Name-ethnicity correlations |
| Browsing history | Political opinion, religion, health | Content consumption patterns |
| Purchase history | Health status, religion | Medication purchases, dietary products |
| Language patterns | National origin, education | Dialect, vocabulary, grammar patterns |
| Device/app usage | Age, income, disability | Accessibility features, device type |
EDPB position: inferring Art. 9 data from non-sensitive inputs constitutes processing of special category data — the same protections apply.
| Metric | Definition | When to Use |
|---|---|---|
| Demographic parity | P(positive outcome | group A) = P(positive outcome |
| Equalized odds | TPR and FPR equal across groups | When accuracy should be equal across groups |
| Equal opportunity | TPR equal across groups (relaxed equalized odds) | When true positive detection should be equal |
| Calibration | P(Y=1 | score=s, group=A) = P(Y=1 |
| Predictive parity | PPV equal across groups | When positive predictions should be equally reliable |
| Metric | Definition |
|---|---|
| Consistency | Similar individuals receive similar outcomes |
| Counterfactual fairness | Outcome would be the same if protected attribute were different |
| Causal fairness | No causal path from protected attribute to outcome |
| Decision Context | Recommended Metric | Justification |
|---|---|---|
| Hiring/admissions | Equalized odds or equal opportunity | Equal detection of qualified candidates across groups |
| Credit scoring | Calibration | Score should mean the same probability regardless of group |
| Criminal risk | Equalized odds | Both FPR and TPR should be equal to avoid disproportionate impact |
| Healthcare | Equal opportunity + calibration | Equal detection of conditions; equal meaning of risk scores |
| Content moderation | Demographic parity | Content removal should not disproportionately affect groups |
Note: Mathematical impossibility results show that demographic parity, equalized odds, and calibration cannot all be satisfied simultaneously when base rates differ across groups. Document the trade-off explicitly.
| Strategy | Description | Trade-off |
|---|---|---|
| Resampling | Over-sample underrepresented groups, under-sample overrepresented | May reduce data diversity or introduce duplicates |
| Reweighting | Assign higher weights to underrepresented group samples | Computationally simple; may not address structural bias |
| Relabelling | Correct historically biased labels | Requires domain expertise; may be subjective |
| Fair representation learning | Learn latent representation that removes protected attribute information | May lose legitimate correlations |
| Strategy | Description | Trade-off |
|---|---|---|
| Adversarial debiasing | Train adversary to predict protected attribute from model; penalise success | Accuracy-fairness trade-off; requires protected attribute data |
| Fairness constraints | Add fairness metric as training constraint | May reduce overall accuracy; constraint satisfaction varies |
| Regularisation | Add fairness-related regularisation term to loss function | Balances accuracy and fairness; requires tuning |
| Causal modelling | Use causal graph to block discriminatory paths | Requires causal knowledge; complex to implement |
| Strategy | Description | Trade-off |
|---|---|---|
| Threshold adjustment | Different decision thresholds per group to equalise metrics | May be perceived as unfair; legally complex |
| Score calibration | Calibrate scores per group | Requires sufficient group data; may reduce discrimination |
| Reject option | Abstain from decision for borderline cases across groups | Reduces coverage; requires human fallback |
Art. 10 requires for high-risk AI training data:
| Requirement | Implementation |
|---|---|
| Relevant data | Training data must be relevant to the intended purpose |
| Sufficiently representative | Data must represent the population the system will be deployed on |
| Free of errors | Data quality assessment and cleaning processes |
| Complete | Sufficient coverage of deployment scenarios |
| Appropriate statistical properties | Distribution analysis including demographic representation |
| Bias examination | Examine training data for possible biases, especially related to Art. 10(2)(f) |
Art. 10(5): Processing of special category data for bias detection is permitted for high-risk AI if:
| Section | Content |
|---|---|
| System description | Model, purpose, affected groups |
| Protected attributes assessed | Art. 9 categories + equality law characteristics |
| Fairness metrics selected | With justification for selection |
| Data audit results | Training data demographics, representation gaps |
| Model testing results | Per-group performance, fairness metrics, counterfactual results |
| Bias findings | Identified disparities with severity assessment |
| Mitigation measures | Applied strategies with effectiveness evidence |
| Residual bias | Remaining disparities after mitigation |
| Trade-off documentation | Accuracy-fairness trade-offs, metric impossibility acknowledgement |
| Ongoing monitoring plan | Post-deployment fairness monitoring |