# Data Minimization Review

> Use when reviewing an existing system, feature, or dataset for excess personal data. Covers field level collection audits, retention review, log and analytics scrubbing, and turning findings into drop, mask, or shorten decisions. Use when a product ships new fields, when a privacy review flags overcollection, or when preparing evidence that only necessary data is kept.

- Skill: `mizazhaider-ceh/data-minimization-review` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/data-minimization-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/data-minimization-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/data-minimization-review

---


A data minimization review is a structured pass over a live system to
prove that every personal data field still earns its place. Collection
creeps over time. A field added for one launch stays for ten more, a
debug log starts capturing full payloads, and an analytics event quietly
adds a device identifier. This sub-skill turns that drift into a
repeatable audit with decisions, owners, and recheck dates, rather than
a vague recommendation to collect less.

## Quick Workflow

1. Scope the review to one feature, service, or dataset, and list every
   collection point it owns, including forms, APIs, SDKs, logs, and
   analytics events.
2. Inventory every personal data field at each point, with its purpose,
   legal basis, and retention rule.
3. Challenge each field with one question - what breaks, concretely, if
   we stop collecting it.
4. Decide per field - keep, drop, make optional, mask, or shorten
   retention - and record the owner and deadline for each change.
5. Verify retention and deletion actually run, by querying for rows
   past their window instead of trusting the policy document.
6. Scrub logs, error reports, and analytics for accidental personal
   data, and add a guard so it cannot creep back.
7. File the review record and set the recheck date, tied to the next
   feature change or at most one year out.

## 1. Inventory every collection point

Start from what the system really sends, not what the design doc says
it sends. API schemas, form markup, and SDK manifests are the evidence.

```bash
# List API routes from an OpenAPI document and look for personal data shapes
curl -s https://app.example/api/openapi.json -o /tmp/openapi.json
python3 -c "import json; d = json.load(open('/tmp/openapi.json')); print('\n'.join(sorted(d['paths'].keys())))"
# Then inspect each route's request schema for fields like email, phone,
# location, device id, or free text that may carry personal data
```

```python
#!/usr/bin/env python3
"""Field inventory - one row per field, with purpose and retention."""
FIELDS = [
    # (field, collection point, purpose, retention rule)
    ("email", "signup form", "account identity", "life of account"),
    ("phone", "signup form", "account recovery", "life of account"),
    ("date_of_birth", "signup form", "NOT DOCUMENTED", "NOT SET"),
    ("ip_address", "access log", "abuse prevention", "30 days"),
    ("gps_latitude", "check-in event", "nearby results", "24 hours"),
]
for field, point, purpose, retention in FIELDS:
    flag = "REVIEW" if "NOT" in purpose or "NOT" in retention else "ok"
    print(f"{flag:6s} {field:15s} via {point:15s} purpose: {purpose} retention: {retention}")
```

## 2. Challenge each field and record the decision

A field survives only with a purpose tied to a user-visible function or
a legal duty. "Might be useful later" is not a purpose, and "the
product team asked" is not a legal basis. Record the decision in a
form the next reviewer can audit.

```markdown
# Minimization decision record - template

| Field | Purpose | Decision | Rationale | Owner | Due |
| --- | --- | --- | --- | --- | --- |
| date_of_birth | none documented | DROP | Age gate uses a boolean flag instead | backend lead | 2026-11-10 |
| gps_latitude | nearby results | COARSEN | City level gives the same results | mobile lead | 2026-11-17 |
| ip_address | abuse prevention | SHORTEN | 30 days to 7 days, hashed after 24h | platform lead | 2026-11-17 |
| device_model | debugging | KEEP | Needed to reproduce crash reports | mobile lead | n/a |

Decisions allowed - KEEP, DROP, OPTIONAL, MASK, COARSEN, SHORTEN.
Every non-KEEP row needs an owner and a due date.
```

## 3. Verify retention and deletion actually run

Policies lie and cron jobs silently fail. Query the store for rows
older than the retention window, and check that deletion removes the
row from backups and replicas on their own schedule, not just from the
primary table.

```python
#!/usr/bin/env python3
"""Retention check - report rows older than the allowed window."""
import sqlite3
from datetime import date, timedelta

db = sqlite3.connect("/tmp/review-example.db")
cutoff = (date.today() - timedelta(days=30)).isoformat()
rows = db.execute(
    "SELECT COUNT(*) FROM access_log WHERE created_at < ?", (cutoff,)
).fetchone()[0]
print(f"Rows older than 30 days: {rows} (must be 0 if retention is enforced)")
# A nonzero count means the deletion job is broken, disabled, or never existed.
# Fix the job first, then backfill the deletion, then re-run this check.
```

## 4. Scrub logs and analytics for accidental personal data

Logs are the most common minimization failure. A single debug statement
can copy an email address, token, or full request body into a log that
is kept far longer than the source data and read by far more people.

```bash
# Scan recent logs for common personal data patterns (tune for your stack)
grep -RInE "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}" /var/log/app/ | head -20
grep -RInE "Authorization: Bearer |password=|ssn=|card_number=" /var/log/app/ | head -20
# For each hit - remove the logging call or redact at the source, then
# rotate the affected logs. Redacting at query time is not a fix.
```

## Edge cases

- Free text fields (support tickets, feedback forms, search boxes) almost
  always contain personal data users were never asked for. Treat them
  as personal data by default, shorten their retention, and restrict
  who can read them.
- Backups and archives inherit the retention problem. A deletion that
  skips backups is incomplete, so record the backup expiry alongside
  the primary retention rule.
- Aggregated analytics can still identify people when a segment is
  tiny. Suppress or generalize segments below a threshold (for
  example, fewer than 10 users) before publishing a dashboard.
- Legal holds and fraud investigations can justify longer retention,
  but only for the specific records in scope, with a documented hold
  and an expiry. A hold is not a reason to keep everything forever.
- Third party SDKs collect on your behalf. If an SDK sends device
  identifiers or location you did not ask for, disabling or replacing
  it is part of the review, not someone else's problem.

## Key references

- GDPR Article 5(1)(c) - data minimisation principle
- GDPR Article 5(1)(e) - storage limitation principle
- GDPR Article 25 - data protection by design and by default
- Parent skill data-minimization - field audits, pseudonyms, precision reduction
- OWASP guidance on logging sensitive data and log retention

