mcpField
A
ai-training-data-class

ai-training-data-class

github.com/mukul975Security32345 installsUpdated 32w ago
Repository

About ai-training-data-class

A privacy and compliance reference for teams handling AI/ML training datasets. It combines data classification, proxy and bias checks, provenance records, and consent-scope review with GDPR and EU AI Act considerations, including data-card guidance.

Key features

  1. 01Personal data tiers for training sets
  2. 02Proxy-variable and bias checks
  3. 03Consent and lawful-basis categories
  4. 04Data-card and provenance guidance
  5. 05GDPR and EU AI Act requirements

Use cases

  1. 01Check training sets for special-category data
  2. 02Assess feature links to protected traits
  3. 03Record dataset provenance, purpose, and retention

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-training-data-class

After installing, type/ai-training-data-classin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
template.md
references/
standards.md
workflows.md
scripts/
process.py

Details

From the project README

Sensitive Data Classification for AI/ML Training Datasets

Overview

AI and machine learning models trained on personal data raise distinct classification challenges. Training data may contain direct personal data, inferred special categories, proxy variables for protected characteristics, and data whose consent scope does not extend to model training. The EU AI Act (Regulation (EU) 2024/1689) imposes additional requirements for high-risk AI systems, including data governance obligations under Art. 10 that intersect with GDPR classification requirements. This skill provides a framework for classifying training data, detecting bias-relevant features, documenting data provenance, and verifying consent coverage.

GDPR and AI Act Intersection

GDPR Requirements for Training Data
GDPR ArticleApplication to AI Training
Art. 5(1)(b) — Purpose limitationTraining a model is a distinct processing purpose; if data was collected for customer service, using it for ML training requires a compatible purpose assessment or new lawful basis
Art. 5(1)(c) — Data minimisationTraining datasets must not include more personal data than necessary for the model objective
Art. 6 — Lawful basisModel training requires its own lawful basis; legitimate interests (Art. 6(1)(f)) is most common, but requires LIA documentation
Art. 9 — Special categoriesIf training data contains or enables inference of special category data, Art. 9(2) condition required
Art. 22 — Automated decision-makingIf the trained model makes decisions with legal or significant effects, additional safeguards apply
Art. 25 — Data protection by designClassification of training data is a by-design measure enabling appropriate technical protections
Art. 35 — DPIAHigh-risk AI processing (profiling, automated decision-making) requires DPIA
EU AI Act Art. 10 — Data Governance for High-Risk AI

The AI Act Art. 10 requires that training, validation, and testing datasets for high-risk AI systems:

  1. Are subject to appropriate data governance and management practices (Art. 10(2))
  2. Are relevant, sufficiently representative, and to the extent possible free of errors and complete (Art. 10(3))
  3. Take into account the specific geographical, contextual, behavioural, or functional setting within which the AI system is intended to be used (Art. 10(4))
  4. Where special category data processing is strictly necessary for bias detection and correction, this is permitted under Art. 10(5), subject to appropriate safeguards including pseudonymisation and GDPR compliance

Training Data Classification Framework

Classification Tier 1: Personal Data Content
ClassificationDescriptionExample
TRAINING_PII_DIRECTDataset contains direct identifiersCustomer names, email addresses in NLP training corpus
TRAINING_PII_INDIRECTDataset contains indirect identifiersCustomer IDs, transaction patterns enabling singling out
TRAINING_SPECIAL_CATDataset contains Art. 9 special category dataHealth records for medical diagnosis model
TRAINING_CRIMINALDataset contains Art. 10 criminal dataFraud transaction labels derived from criminal investigations
TRAINING_PSEUDONYMISEDPersonal data replaced with tokens but re-identification key existsPseudonymised customer data with mapping held by data team
TRAINING_ANONYMISEDData verified as anonymised per WP29 criteriaAggregated population statistics with k ≥ 10
TRAINING_SYNTHETICArtificially generated data with no real personal dataGAN-generated synthetic transaction data
TRAINING_NON_PERSONALNo personal data contentMarket price data, weather data, product specifications
Classification Tier 2: Bias and Proxy Detection

Even when a dataset does not directly contain Art. 9 special category data, it may contain proxy variables that correlate with protected characteristics:

Proxy VariableCorrelated Protected CharacteristicDetection Method
Postcode/ZIP codeRacial/ethnic origin, socioeconomic statusGeographic demographic analysis
First nameGender, ethnic origin, age cohortName demographics database lookup
Language preferenceEthnic origin, nationalityStatistical correlation analysis
Shopping patternsReligious belief (halal/kosher purchases), health statusPurchase category analysis
Web browsing historyPolitical opinions, sexual orientation, health statusTopic modelling on browsing categories
Employment gap patternsGender (maternity), disability, healthStatistical pattern analysis
Credit scoreRacial/ethnic origin (documented correlation in US/UK studies)Disparate impact analysis
Classification Tier 3: Consent and Purpose Scope
ClassificationDescriptionCompliance Requirement
CONSENT_COVERS_TRAININGOriginal consent explicitly covers AI/ML trainingDocument consent text and verify specificity
CONSENT_DOES_NOT_COVEROriginal consent did not anticipate ML trainingNew consent required or alternative lawful basis needed
LEGITIMATE_INTERESTML training relies on legitimate interests (Art. 6(1)(f))Documented LIA required
CONTRACT_PERFORMANCEML training is necessary for contract performanceNarrow scope — must be genuinely necessary
PUBLIC_DATAData sourced from publicly available sourcesStill requires lawful basis; public availability is not a lawful basis
RESEARCH_EXEMPTIONProcessing under Art. 89(1) research exemptionAppropriate safeguards including pseudonymisation required

Data Card Documentation

A data card is a structured document accompanying each training dataset, providing transparency about its contents, provenance, and limitations. Modelled on the "Datasheets for Datasets" framework (Gebru et al., 2021) and adapted for GDPR compliance.

Required Data Card Fields for Vanguard Financial Services
SectionFields
1. Dataset IdentityName, version, creation date, owner, purpose
2. Personal Data ClassificationTier 1 classification, data elements present, classification labels
3. Data SubjectsCategories of data subjects, volume, geographic scope
4. ProvenanceOriginal collection purpose, source systems, processing chain from collection to training set
5. Consent/Lawful BasisTier 3 classification, consent text reference or LIA reference, purpose compatibility assessment
6. Special Category AssessmentWhether Art. 9 data is present (direct or inferred), Art. 9(2) condition if applicable
7. Bias AssessmentProxy variables identified, disparate impact analysis results, demographic representation statistics
8. De-identificationTechnique applied (pseudonymisation, anonymisation, synthetic generation), assessment reference
9. RetentionTraining data retention period, model retention period, deletion schedule
10. Access ControlsWho can access the training data, who can access the model, audit logging
11. DPIA ReferenceDPIA document reference if applicable
12. LimitationsKnown biases, geographic limitations, temporal limitations, data quality issues

Bias Detection Methodology

Step 1: Demographic Representation Analysis

For each training dataset, calculate representation statistics:

  • What percentage of records come from each demographic group (to the extent known)?
  • Does the representation match the target population?
  • Are any groups under-represented by more than 20% relative to population?
Step 2: Proxy Variable Identification

Scan all features for proxy correlation with Art. 9 protected characteristics:

  • Calculate correlation coefficient between each feature and known protected characteristics (where available)
  • Flag features with |correlation| > 0.3 as potential proxies
  • Document all proxy variables in the data card
Step 3: Disparate Impact Analysis

For classification or scoring models:

  • Calculate model performance metrics by demographic group
  • Apply the 80% (four-fifths) rule: if the selection rate for any protected group is less than 80% of the rate for the most favoured group, disparate impact may exist
  • Document disparate impact analysis results in the data card
Step 4: AI Act Art. 10(5) Assessment

If bias detection requires processing special category data:

  • Document why processing is "strictly necessary" for bias detection and correction
  • Implement pseudonymisation of the special category data used for bias testing
  • Ensure GDPR Art. 9(2) condition is established (typically Art. 9(2)(g) substantial public interest or Art. 9(2)(j) research)
  • Process in a controlled environment with access restricted to the bias assessment team
  • Delete special category data after bias assessment is complete

Enforcement and Regulatory Precedents

  • Italian Garante — Clearview AI (2022): EUR 20 million fine for processing biometric data scraped from public sources for AI facial recognition training without lawful basis, consent, or transparency. Established that public availability does not provide lawful basis for AI training.
  • Italian Garante — ChatGPT/OpenAI (2023): Temporary ban and subsequent enforcement requiring OpenAI to establish lawful basis for training data collection, implement age verification, and provide opt-out mechanisms. Highlighted that AI training on personal data requires GDPR compliance throughout the data lifecycle.
  • CNIL — Enforcement Notice on AI Training Data (2024): CNIL published guidance sheets on AI training data requiring purpose limitation assessment, proportionality analysis, and specific measures when training data contains special category data.
  • ICO — Generative AI and Data Protection Consultation (2024): ICO's position that legitimate interests is the most likely lawful basis for AI training but requires documented LIA considering data subject reasonable expectations.

Integration Points

  • personal-data-test: Training data must first be classified as personal or non-personal
  • special-category-data: Art. 9 data in training sets requires heightened protections
  • pseudo-vs-anon-data: De-identification of training data must be validated
  • classification-policy: Training data classified under enterprise classification tiers
  • data-lineage-tracking: Full provenance from original collection to model deployment must be tracked

Comments

Markdown supported