Data Governance

Proving a data audit catches what it claims

A simulated GDPR/CCPA audit on 50,000 records, deliberately seeded with violations so every detector, scanner, and masking rule can be proven against a known answer key.

50K
records audited
100%
of 4,447 violations caught
847
unmasked PII patterns
3.2ms
SAR lookup query
01Problem

Most data-governance tooling makes a claim no one verifies: that it finds the violations. But how do you know an audit caught everything, when you don't know what was there to begin with? This project flips the usual approach — it manufactures a dataset with a known number of planted violations, so the audit can be graded against an answer key instead of taken on faith.

02Data

50,000 synthetic customer records generated with Faker, deliberately seeded with 4,447 known violations — retention-period breaches, unmasked PII, and consent gaps — spread across the dataset, giving an exact ground truth to measure detection against.

03Method

A layered audit: rule-based detectors for retention and consent violations, pattern scanners for unmasked PII (emails, card numbers, national IDs), and dbt models that apply and verify masking. Great Expectations enforces data-quality contracts, and a DuckDB query layer answers regulator-style requests — including a Subject Access Request lookup — on demand.

04Finding

The audit caught 100% of the 4,447 seeded violations — including 847 unmasked PII patterns and roughly 2,400 retention breaches — with zero known misses against the answer key.

And a Subject Access Request, the query a regulator times you on, returns in 3.2 milliseconds: compliance that's not just correct but operationally fast.

05Recommendation

Run this audit on a schedule against production extracts and alert on any non-zero violation count, so governance shifts from an annual scramble to a continuous control. The seeded-ground-truth pattern is worth keeping as a permanent test harness — it's the only way to prove the audit still works after every schema change.

Great Expectations report

HTML report in the repo
Interactive data-quality report

The full Great Expectations report (ge_report.html) is generated and committed to the repo. Host it alongside the site and it embeds here as an interactive, expandable data-quality report.

View the audit code ↗