Architecture Note · Security & Compliance
Deterministic DSAR Automation, PII Discovery, and DPO Sign-Off Architecture
How deterministic SLA timers, local PII pattern discovery with 1-hour upload auto-wipe, automated third-party redaction, and mandatory DPO human sign-off gates replace risky privacy wrappers.
The Operational Problem: Multi-Jurisdiction DSARs Across Fragmented Data Estates
Data Protection Officers (DPOs), General Counsel, and Privacy Engineering leads must fulfill access, portability, rectification, opt-out, and hard-erasure requests across fragmented systems spanning Postgres, Snowflake, AWS S3, Zendesk, and HubSpot. Statutory deadlines shift by regime: 30 days under EU GDPR (with optional +60-day complex extensions), 30 days under UK GDPR, 45 days under CCPA/CPRA (+45-day extensions), 30 days under the Australian Privacy Act (APP 12/13), and an enforced 21-day internal SLA for Japan APPI. Missing a statutory window—or releasing an unredacted third-party IBAN, counterparty email, health code, or litigation-hold record inside a subject export bundle—creates immediate regulatory liability.
Why Naive AI Wrappers Fail
Treating DSAR fulfillment and PII discovery as a prompt-engineering problem fails compliance engineering along three predictable fault lines:
- Nondeterministic SLA math and pattern classification: Language models drift when computing statutory deadlines across jurisdictions or validating structured identifiers. Guessing whether a 22-character string is a valid IBAN instead of checking ISO 13616 MOD-97-10 checksums produces false positives and silent misses across SSNs and ICD-10, NHS, or PHI markers.
- Third-party PII leakage and missing privilege boundaries: Generic summarizers blend subject records with bystander emails, support engineer IDs, counterparty bank accounts, and privileged AML or legal notes that must be withheld under GDPR Article 15(4).
- Unbounded data retention and unverified mutations: Shipping raw schema exports to external model endpoints leaks sensitive payloads outside the perimeter, leaves temporary CSV or JSON staging files on disk, and lacks both an immutable audit trail and a hard technical barrier preventing unapproved bundle releases or irreversible database purges.
The Deterministic Architecture That Fixes It
A defensible privacy control plane pairs FastAPI and SQLite (WAL mode) with deterministic classifiers, strict tenant isolation, and enforced human-in-the-loop gates:
- Statutory SLA engine and verification gates:
POST /api/dsar/requestslogs subject requests with deterministic deadline computation acrossGDPR,UK_GDPR,CCPA_CPRA,AU_PRIVACY_ACT, andJP_APPI. Requests track identity gates (pending_kba,idp_verified,legal_hold) and enforce per-tenant invite token scoping (returning HTTP403on cross-tenant access) with sliding-window rate limits. - Offline PII discovery with 1-hour ephemeral wipe:
POST /api/discovery/scaninspects JSON payloads or multipart.jsonand.csvuploads across Postgres, Snowflake, S3, Zendesk, and HubSpot using an offline deterministic adapter by default. Regex and field-hint classifiers detect emails, MOD-97-10 validated IBANs, SSNs, and health identifiers while storing only masked previews. Raw files written totmp_uploads/(with0600permissions) and temporary parsed payloads in SQLite auto-wipe after 1 hour (3600s). - Third-party redaction ledger and mandatory DPO gate:
POST /api/dsar/{id}/packagestrips third-party emails, staff identifiers, bystander IBANs, and privileged legal notes into an explicitredaction_ledger. Any request specifyingrelease_externally=trueoraction="hard_erasure"returns HTTP409 Conflictuntil a DPO records explicit approval viaPOST /api/dsar/{id}/dpo-approveand any active legal hold or pending KBA check is cleared. - Immutable SHA-256 audit log and Article 30 RoPA exports: Every verification, column tokenization, DPO sign-off, bundle release, and retention simulation appends to SQLite
audit_logs, whereBEFORE UPDATEandBEFORE DELETEtriggers block tampering and each row chains via SHA-256.GET /api/ropa/exportproduces GDPR Article 30 registers as JSON or RFC 4180 CSV with OWASP formula-injection neutralization, backed by a pytest suite verifying auth isolation, SLA math, cleanup, redaction, and DPO gates.
Operational Takeaway
Automated privacy operations cannot rely on probabilistic text generation or unguarded deletion scripts. Combining deterministic statutory SLA timers, offline checksum-validated PII scanning with 1-hour upload wiping, SHA-256 chained SQLite audit triggers, and mandatory DPO human approval gates turns multi-jurisdiction DSAR fulfillment into an auditable engineering workflow.