Library

Volume 1 · Security, Compliance & Responsible AI

Notebook
Sign in

Section 39

GDPR & Data Privacy (right to erasure, data minimization, DPIA)

410 words · about 2 min

39.1 GDPR Requirements for AI

Principle Requirement AI Implementation
Lawful basis Need a legal basis for processing Consent or legitimate interest
Purpose limitation Data used only for stated purpose AI training scope documented
Data minimization Collect only what’s needed Feature selection, not all raw data
Accuracy Data must be accurate Data quality pipeline
Storage limitation Don’t retain longer than needed TTL on vector DB, training data
Right to erasure Delete on request Remove from training data AND embeddings
Right to explanation Explain automated decisions XAI techniques, audit trail
Privacy by design Privacy built in, not bolted on Architecture-level privacy controls

39.2 Right to Erasure — The Hard Problem for AI

Deleting a row from an OLTP database is easy. Deleting a user’s influence from a trained model or a vector index is not:

  • Vector stores: must support delete-by-metadata (e.g., patient_id filter) so embeddings are physically removed, not just excluded from queries.
  • Trained models: if PII was memorized during fine-tuning, full retraining (or machine unlearning techniques) may be required — this must be planned for architecturally, not discovered during an audit.
  • Caches and logs: erasure requests must cascade to prompt/response caches, application logs, and backups within the compliance window.

39.3 DPIA (Data Protection Impact Assessment)

Required before deploying AI systems with high privacy risk (large-scale profiling, sensitive categories of data, systematic monitoring). Documents: purpose, data flows, necessity/proportionality, identified risks, and mitigations. Architect’s role: produce the data flow diagram and risk register that feeds the DPIA, and ensure mitigations (pseudonymization, access controls, retention limits) are actually implemented in the design, not just on paper.

39.4 Right to Explanation

Individuals affected by automated decisions have the right to understand: what data was used, how the decision was made, which factors were most influential, and how to contest it. Implementation: store reasoning traces, use SHAP/LIME for model explanations, maintain citation chains in RAG pipelines.

39.5 Q&A

Q: How do you architect a RAG system to support GDPR’s right to erasure? Tag every embedded chunk with a source-record identifier (patient/user ID) as metadata at ingestion time. On an erasure request, run a metadata-filtered delete against the vector index (not just a re-index exclusion), purge the source document from the raw/curated data lake zones, invalidate any cached LLM responses derived from that data, and log the erasure action itself for audit. If the record was ever used in fine-tuning, flag it in a model-lineage registry so scheduled retraining excludes it going forward.