Core Architecture of a Privacy Protection System
Privacy systems differ from most software in one critical way: every component must produce auditable evidence. A consent record is worthless without an immutable timestamp, a version fingerprint of the policy shown, and the exact signal (click, API call, implicit legitimate interest) that established the lawful basis. Four subsystems form the backbone of a production-grade privacy platform.
Consent Management and Lawful Basis Engine
The consent store records every consent event as an immutable append-only log: data subject identifier (hashed or pseudonymised), consent version hash, timestamp, channel (web widget, mobile SDK, API), and the specific processing purposes consented to. Withdrawal events are appended rather than overwriting prior records. The lawful basis engine maps processing activities to their basis (consent, legitimate interest, contract, legal obligation) and blocks downstream data flows when no valid basis exists for that subject-purpose pair. Policy version management fingerprints each consent notice; a change to the notice invalidates prior consent records where consent was the lawful basis, triggering a re-consent workflow.
PII Discovery and Data Classification
You cannot protect data you cannot find. The discovery engine crawls configured data stores (PostgreSQL schemas, S3 buckets, Elasticsearch indices, Kafka topics, third-party SaaS exports) using pattern matching (regex for email/SSN/IBAN/credit card), ML classifiers for context-sensitive PII, and schema sampling for structured stores. Each discovered field receives a classification label (direct identifier, quasi-identifier, sensitive category, non-personal) and a retention policy assignment. The data map auto-updates on schema migrations via CI/CD hooks, preventing new PII fields from appearing undocumented in production.
Data Subject Rights (DSR) Automation
GDPR Articles 15-22 and CCPA Sections 1798.100-1798.125 impose strict response windows (30 days GDPR, 45 days CCPA). Manual fulfilment at scale breaks under volume. The DSR engine provides: identity verification workflow (email OTP, document upload, liveness check for high-risk requests), automated data retrieval from registered data stores producing a structured portable export (JSON-LD or machine-readable CSV), right-to-erasure cascade (deletion propagation to connected systems with dependency graph resolution to avoid orphaned foreign keys), and objection/restriction flags that suppress processing without deleting the record. Every step is logged with timestamps for regulator-ready audit trails.
Purpose Limitation and Data Minimisation Enforcement
Tagging data at ingestion with the purpose for which it was collected enables runtime enforcement. A middleware layer intercepts data access calls, resolves the requesting service's declared purpose, and checks it against the purpose tags on the requested data. Access outside the original purpose requires either a new consent signal or a documented compatible purpose assessment. This is not advisory logging: it is a hard enforcement gate configurable per environment (warn in staging, block in production). Retention policies attach to purpose tags: data collected for onboarding expires differently from data collected for fraud detection, with automated deletion jobs triggered on schedule rather than manual cleanup cycles.