
ai-data-retention
Manages AI model retention and machine unlearning requirements. Covers training data deletion verification, model versioning for compliance, machine unlearning techniques (SISA, gradient-based), and retraining triggers. Keywords: AI retention, machine unlearning, model versioning, training data deletion, retraining, storage limitation.
- Installs
- 43
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-data-retention- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads ai-data-retention automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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 Category | Description | Retention Consideration |
|---|---|---|
| Raw training data | Original personal data used for model training | Delete after training unless retraining justifies retention |
| Processed training data | Cleaned, augmented, feature-engineered data | Same as raw — delete when training purpose exhausted |
| Validation/test data | Data used for model evaluation | Retain for model audit and comparison; pseudonymise |
| Model weights/parameters | Trained model artefacts encoding training data information | Retain while model is deployed; delete on decommission |
| Inference logs | Inputs and outputs of model predictions | Retention based on purpose (audit, debugging, rights exercise) |
| Model metadata | Training configuration, hyperparameters, provenance | Retain for compliance documentation; low privacy risk |
| Embedding vectors | Dense representations derived from personal data | May 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
| Phase | Retention Rule |
|---|---|
| Development | Training data retained during active development |
| Deployment | Training data deleted unless retraining is planned within defined period |
| Operation | Inference logs retained per purpose (30 days debug, 1 year audit) |
| Retraining | New training data collected; old data deleted post-training |
| Decommission | All 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.
| Property | Value |
|---|---|
| Guarantee | Complete — model has no knowledge of deleted data |
| Cost | Very high — full training cost for each deletion request |
| Feasibility | Impractical for large models or frequent deletion requests |
| When to use | Small 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.
| Property | Value |
|---|---|
| Guarantee | Exact within the affected shard |
| Cost | 1/k of full retraining (k = number of shards) |
| Feasibility | Requires SISA architecture from the start |
| Trade-off | Model 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.
| Property | Value |
|---|---|
| Guarantee | Approximate — statistically similar to retrained model |
| Cost | Low — few gradient steps |
| Feasibility | Works for most differentiable models |
| Verification | Requires membership inference testing to verify |
Influence Function-Based Unlearning
Use influence functions to estimate the effect of removing data and adjust model accordingly.
| Property | Value |
|---|---|
| Guarantee | Approximate — first-order approximation |
| Cost | Medium — requires Hessian computation |
| Feasibility | Best for smaller models or linear models |
Unlearning Verification
After applying unlearning, verify effectiveness:
- Membership inference test: Run MI attack on unlearned records — should classify as non-members
- Output comparison: Compare model outputs with and without the unlearned data
- Canary test: If canary records were included, verify they are no longer extractable
- Statistical test: Compare model to one retrained from scratch on the same data minus deleted records
Model Versioning for Compliance
Version Control Requirements
| Element | Documentation |
|---|---|
| Model version ID | Unique identifier (e.g., model-v2.3.1-20260314) |
| Training data snapshot | Hash of training dataset used for this version |
| Training date | When training was executed |
| Data deletions applied | Which data subject deletions are reflected in this version |
| Unlearning applied | Any approximate unlearning applied since last full retraining |
| Privacy properties | DP epsilon, MI test results for this version |
| Deployment dates | When deployed and when retired |
Retraining Triggers
| Trigger | Action |
|---|---|
| Accumulated deletion requests exceed threshold | Full retraining on updated dataset |
| Scheduled periodic retraining | Incorporate all pending deletions |
| Privacy audit reveals unacceptable leakage | Retrain with enhanced privacy measures |
| Model performance degradation | Retrain with current data (post-deletions) |
| Regulatory change | Assess 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
FAQ
What does the ai-data-retention skill do?
Manages AI model retention and machine unlearning requirements. Covers training data deletion verification, model versioning for compliance, machine unlearning techniques (SISA, gradient-based), and retraining triggers. Keywords: AI retention, machine unlearning, model versioning, training data deletion, retraining, storage limitation.
How do I install ai-data-retention?
Run npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-data-retention in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ai-data-retention/ (personal) or .claude/skills/ai-data-retention/ (project).
Which AI agents can use ai-data-retention?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is ai-data-retention safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains ai-data-retention?
It is published by mukul975 in mukul975/privacy-data-protection-skills. It has 43 recorded installs.
More from mukul975/privacy-data-protection-skills
brazil-lgpd
mukul975/privacy-data-protection-skills
Open the skill to read its SKILL.md instructions.
analytics-cookie-consent
mukul975/privacy-data-protection-skills
Managing consent for analytics cookies and implementing privacy-preserving measurement. Covers GA4 privacy configuration, consent mode fallback behavior, aggregate reporting alternatives, and cookieless measurement approaches.
audit-report-writing
mukul975/privacy-data-protection-skills
Open the skill to read its SKILL.md instructions.
gdpr-compliance-audit
mukul975/privacy-data-protection-skills
Open the skill to read its SKILL.md instructions.
conducting-gdpr-dpia
mukul975/privacy-data-protection-skills
Open the skill to read its SKILL.md instructions.
backup-retention-erasure
mukul975/privacy-data-protection-skills
Open the skill to read its SKILL.md instructions.
Popular security skills
azure-compliance
microsoft/azure-skills
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
minimal-run-and-audit
lllllllama/rigorpilot-skills
Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
firebase-security-rules-auditor
firebase/agent-skills
Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.
audit
pbakaus/impeccable
Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
competitors
coreyhaines31/marketingskills
When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.