| Platform | CaseFlow Automation (caseflowautomation.co.uk) |
| Last Updated | 30 June 2026 |
| Classification | Internal - Compliance |
| Document Purpose | DPIA / Compliance Reference |
CaseFlow Automation processes insurer correspondence and case details using AI to generate legal analysis and draft responses. To support UK GDPR data-minimisation principles (Article 5(1)(c)), the platform implements a three-layer privacy architecture:
| Layer | Location | Purpose |
|---|---|---|
| Layer 1 - Local Processing | User's browser | Text-based PDFs are extracted entirely client-side; the file never reaches our servers. A server-side fallback is used only when a PDF is a scanned image (no embedded text), in which case the file is uploaded to a private temporary bucket for OCR and removed immediately after processing. |
| Layer 2 - PII Masking Gateway (in transit) | Server-side (Edge Function) | Regex-based pattern matching detects and replaces personal identifiers with neutral placeholders before text is transmitted to the AI model. |
| Layer 3 - At-Rest Masking | Database (triggers) | The same masking patterns are applied via PostgreSQL triggers (public.mask_pii()) on insert/update to correspondence, ai_replies, case_advice, preemptive_letters, and taxi_risk_assessments. Saved history therefore contains placeholders, not raw identifiers, mitigating impact in the event of unauthorised database access. |
The temp-pdfs storage bucket is private. Files are deleted by the application immediately after OCR completes. A scheduled pg_cron job (purge-temp-pdfs-daily, 03:00 UTC) acts as a safety net, removing any object older than 24 hours. In typical operation the bucket is empty.
pdfjs-dist (Mozilla's PDF.js) directly in the user's browser.extract-loss-of-use-timeline uses the in-memory variant and writes nothing to any table or bucket.The masking gateway (piiRedactor.ts) is a shared server-side module invoked by every AI-facing Edge Function before any text is sent to the language model. It operates as a mandatory processing step on the server.
The gateway attempts to detect and mask the following UK-specific identifier types:
| # | Category | Placeholder | Example Patterns |
|---|---|---|---|
| 1 | Email addresses | [EMAIL_REDACTED] | Standard email format |
| 2 | National Insurance Numbers | [NINO_REDACTED] | AB 12 34 56 C |
| 3 | UK Driving Licence Numbers | [DRIVING_LICENCE_REDACTED] | 16-character DVLA format |
| 4 | Vehicle Registration Marks | [VRM_REDACTED] | Current, prefix, suffix, dateless - requires β₯2 digits to avoid car model false positives |
| 5 | UK Postcodes | Not masked (preserved) | Deliberately preserved because postcodes are material to basic-hire-rate and locality arguments. A separate output-side scrubber removes any postcode the AI introduces that was not present in the original input. |
| 6 | UK Phone Numbers | [PHONE_REDACTED] | Landline, mobile, +44 international |
| 7 | Dates of Birth | [DOB_REDACTED] | Contextual only (preceded by DOB/born) |
| 8 | Bank Account Numbers | [ACCOUNT_REDACTED] | Account number with contextual prefix |
| 9 | Policy / Claim References | [REF_REDACTED] | Markers include POL, CLM, REF, CLAIM, POLICY, FILE, BHR, CHR, CHO, TPI, plus structured formats such as 24-ABC-123456 and ABC/2025/12345 |
| 10 | Street Addresses | [ADDRESS_REDACTED] | House number + street name (conservative) |
| 11 | Person Names | [NAME_REDACTED] | Titled names (Mr/Mrs/Ms/Miss/Dr/Prof + surname) are always masked. Bare/untitled names are masked only in high-precision contexts: field labels (e.g. "Claimant:", "Driver:", "Insured:"), salutations ("Dear ..."), sign-offs, and "Re <name>" in email subjects. Guards protect case citations and company names. A bare first name and surname in free prose with none of those cues may not be caught. |
Patterns are applied in a specific sequence (most specific first) to prevent partial matches or false positives:
1. Emails β 2. NINOs β 3. Driving Licences β 4. VRMs β 5. Phone Numbers β 6. DOBs β 7. Bank Details β 8. References β 9. Addresses β 10. Titled Names β 11. Bare Personal Names. UK postcodes are deliberately not part of the masking sequence; they are preserved for locality/BHR analysis, and a separate output-side scrubber removes any postcode the AI introduces that was not present in the original input.
Each invocation logs the count and types of items masked (e.g., PII redaction: 3 items redacted (types: EMAIL, VRM, REF)). No original PII values are logged.
The PII Masking Gateway is invoked in the following backend functions:
| Function | Purpose |
|---|---|
analyze-correspondence | Insurer correspondence analysis |
generate-reply | AI-generated reply drafting |
case-advice | Live case strategic guidance |
generate-argument-letter | Argument letter generation |
extract-loss-of-use-timeline | Loss-of-Use Chronology extraction (in-memory only, nothing stored) |
All text reaching the model for analysis passes through the gateway. "No bypass path" means exactly that: every analysis, drafting and advice call is preceded by masking, and this includes text produced by OCR of a scanned page, which is masked on return before it is used for analysis. The only text the model sees unmasked is the raw image of a scanned page it is asked to read, which it processes under zero-retention terms.
As of 13 February 2026, the platform enforces strict separation between GTA protocol data and case law:
| Claim Type | Knowledge Provided to AI | Case Law Included? |
|---|---|---|
| GTA Claim (ticked) | GTA sections, hire rate tables, EV-to-ICE mappings only | No - case law is explicitly excluded |
| Non-GTA Claim (unticked) | Case law database | Yes - full case law knowledge base |
This ensures GTA claims receive advice grounded solely in GTA protocol and rate tables, while non-GTA claims receive case law citations. The separation prevents cross-contamination of authority sources and reduces hallucination risk.
Electric vehicles not listed in standard GTA rate tables are mapped to ICE equivalent groups with mandatory explanatory notes. Accident dates are preserved as non-identifying data.
| Control | Implementation |
|---|---|
| Low Temperature | temperature: 0.3 on all AI calls |
| Explicit System Prompts | "Do NOT invent case names", "Only cite cases from the provided knowledge base" |
| Knowledge Isolation | GTA claims receive no case law; non-GTA claims receive no GTA rate data |
| Final Output Scrubbing (Layer 3) | Active — citationScrubber.ts runs on all AI outputs. Strips fabricated or unverified case citations while preserving legitimate legal references. Applied across all six edge functions (Analysis, Reply, Case Advice, Liability Assessment, Argument Letter, Pre-Emptive Letter). |
The platform UI and Privacy Policy use deliberately honest language:
| Principle | Implementation |
|---|---|
| Data Minimisation (Art. 5(1)(c)) | Three-layer approach: local processing, in-transit masking gateway, and at-rest masking |
| Privacy by Design (Art. 25) | Masking gateway is mandatory in the processing pipeline; no bypass |
| Transparency (Art. 13/14) | UI wording and Privacy Policy describe the approach honestly |
| Accountability (Art. 5(2)) | Source code is auditable; server logs record masking activity without storing PII |