mukul975/privacy-data-protection-skills

ai-data-retention

- Manages AI model retention and machine unlearning requirements.

Vedi sorgente

Come usare

  1. Copia il comando e controlla il pacchetto prima di installarlo nel tuo ambiente agente.
  2. Controlla strumenti, credenziali e ambienti richiesti nel documento originale.
  3. Descrivi input e risultato desiderato; confronta l’output con le fonti.
npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-data-retention

Prima di iniziare

  • L’installazione non include abbonamenti, quote API o accesso ai file.
  • Stelle e installazioni indicano attività, non un test indipendente di qualità o sicurezza.
Documento Skill originale

Contenuto dal repository con titoli, esempi, codice, tabelle, link e immagini preservati.

AI Model Retention and Unlearning

Overview

GDPR Art. 5(1)(e) storage limitation requires that personal data be kept no longer than necessary for the processing purpose. For AI systems, this creates complex retention challenges: training data used to build a model may no longer be needed once training is complete, but the model itself encodes information about the training data. Machine unlearning — the process of removing the influence of specific data from a trained model — is an emerging field that addresses the gap between deleting training data and eliminating its influence from model parameters. This skill provides retention policies, deletion verification methods, and machine unlearning techniques for AI compliance.

AI Data Retention Categories

Data CategoryDescriptionRetention Consideration
Raw training dataOriginal personal data used for model trainingDelete after training unless retraining justifies retention
Processed training dataCleaned, augmented, feature-engineered dataSame as raw — delete when training purpose exhausted
Validation/test dataData used for model evaluationRetain for model audit and comparison; pseudonymise
Model weights/parametersTrained model artefacts encoding training data informationRetain while model is deployed; delete on decommission
Inference logsInputs and outputs of model predictionsRetention based on purpose (audit, debugging, rights exercise)
Model metadataTraining configuration, hyperparameters, provenanceRetain for compliance documentation; low privacy risk
Embedding vectorsDense representations derived from personal dataMay contain personal data — apply retention policy

Retention Policy Framework

Training Data Retention Decision Tree

Training data category identified
│
├─ Is the data still needed for model retraining?
│  ├─ YES → Retain with documented justification and review date
│  └─ NO → Continue
│
├─ Is the data needed for model validation or audit?
│  ├─ YES → Retain in pseudonymised form with access controls
│  └─ NO → Continue
│
├─ Is the data needed for data subject rights exercise?
│  ├─ YES → Retain for rights exercise period, then delete
│  └─ NO → Continue
│
├─ Is there a legal obligation to retain?
│  ├─ YES → Retain per legal requirement
│  └─ NO → DELETE the training data
│
└─ After deletion: assess model for residual data encoding

Model Lifecycle Retention

PhaseRetention Rule
DevelopmentTraining data retained during active development
DeploymentTraining data deleted unless retraining is planned within defined period
OperationInference logs retained per purpose (30 days debug, 1 year audit)
RetrainingNew training data collected; old data deleted post-training
DecommissionAll model artefacts, training data, and logs deleted; retain only compliance documentation

Machine Unlearning Techniques

Exact Unlearning

Full retraining: Retrain the model from scratch on the dataset minus deleted records.

PropertyValue
GuaranteeComplete — model has no knowledge of deleted data
CostVery high — full training cost for each deletion request
FeasibilityImpractical for large models or frequent deletion requests
When to useSmall models, infrequent requests, high-sensitivity data

SISA (Sharded, Isolated, Sliced, Aggregated) Training

Train model on sharded data partitions. To unlearn, retrain only the affected shard.

PropertyValue
GuaranteeExact within the affected shard
Cost1/k of full retraining (k = number of shards)
FeasibilityRequires SISA architecture from the start
Trade-offModel accuracy may decrease with fewer shards contributing

Approximate Unlearning

Gradient-Based Unlearning

Apply gradient ascent on the data to be forgotten, then fine-tune on remaining data.

PropertyValue
GuaranteeApproximate — statistically similar to retrained model
CostLow — few gradient steps
FeasibilityWorks for most differentiable models
VerificationRequires membership inference testing to verify

Influence Function-Based Unlearning

Use influence functions to estimate the effect of removing data and adjust model accordingly.

PropertyValue
GuaranteeApproximate — first-order approximation
CostMedium — requires Hessian computation
FeasibilityBest for smaller models or linear models

Unlearning Verification

After applying unlearning, verify effectiveness:

  1. Membership inference test: Run MI attack on unlearned records — should classify as non-members
  2. Output comparison: Compare model outputs with and without the unlearned data
  3. Canary test: If canary records were included, verify they are no longer extractable
  4. Statistical test: Compare model to one retrained from scratch on the same data minus deleted records

Model Versioning for Compliance

Version Control Requirements

ElementDocumentation
Model version IDUnique identifier (e.g., model-v2.3.1-20260314)
Training data snapshotHash of training dataset used for this version
Training dateWhen training was executed
Data deletions appliedWhich data subject deletions are reflected in this version
Unlearning appliedAny approximate unlearning applied since last full retraining
Privacy propertiesDP epsilon, MI test results for this version
Deployment datesWhen deployed and when retired

Retraining Triggers

TriggerAction
Accumulated deletion requests exceed thresholdFull retraining on updated dataset
Scheduled periodic retrainingIncorporate all pending deletions
Privacy audit reveals unacceptable leakageRetrain with enhanced privacy measures
Model performance degradationRetrain with current data (post-deletions)
Regulatory changeAssess if retraining needed for compliance

Enforcement Relevance

  • EDPB Guidelines 04/2025: Training data retention must be justified; deletion of training data does not automatically eliminate GDPR obligations for the model if it encodes personal data.
  • Garante v. OpenAI (2023): Required mechanism for data deletion from training data; acknowledged technical challenges but expected good faith effort.
  • EDPB ChatGPT Taskforce (2024): Controllers must demonstrate capability to address erasure requests affecting training data.

Integration Points

  • ai-data-subject-rights: Erasure rights implementation requires unlearning
  • ai-dpia: Retention and deletion capability assessed in DPIA
  • ai-model-privacy-audit: Audit verifies deletion effectiveness
  • ai-training-lawfulness: Retention justification part of lawful basis assessment

Correlati per attività

dallo stesso repository

Altri Skills

Tutti gli Skills
mukul975
Community

applying-privacy-design-patterns

- Systematic application of the eight privacy design patterns per Hoepman: minimize, hide, separate, abstract, inform, control, enforce, and demonstrate. Covers pattern selection methodology per processing activity, mapping to GDPR principles, and practical implementation guidance for privacy-by-design system architecture.

installazioni
1
GitHub Stars
315
Aggiornato
16 mar
mukul975
Community

brazil-lgpd

- Guides compliance with Brazil's Lei Geral de Proteção de Dados (LGPD, Lei 13.709/2018). Covers the 10 lawful bases under Art. 7, DPO appointment, ANPD enforcement, data subject rights under Arts. 17-22, and international transfer mechanisms. Keywords: LGPD, Brazil data protection, ANPD, lawful bases, data subject rights, international transfers.

installazioni
1
GitHub Stars
315
Aggiornato
16 mar
mukul975
Community

adequacy-assessment

- Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

installazioni
1
GitHub Stars
295
Aggiornato
16 mar
mukul975
Community

age-gating-services

- Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

installazioni
1
GitHub Stars
295
Aggiornato
16 mar