Building GDPR-Compliant AI Systems with Automatic Redaction

Published: (February 3, 2026 at 07:08 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Why raw user data is a compliance risk

If your app sends user data to an AI model, you may be sharing personally identifiable information (PII) without realizing it. A single AI request can already be a GDPR compliance risk because:

  • Raw user data leaves your system unchanged
  • No filtering or redaction is applied
  • No audit trail is created
  • You have zero control over what is sent to the model

Practical approach

Instead of blocking AI entirely, sanitize the input before it leaves your system.

1. Detect PII

Identify any personal data (names, email addresses, phone numbers, IDs, etc.) in the user‑generated content.

2. Redact before calling the model

Replace detected PII with placeholders while preserving the surrounding context so the model can still understand the request.

Before:
john@email.com) called about invoice #4832

After:
NAME called about invoice #4832

Insert a proxy service between your application and the AI API. The proxy can:

  • Perform automatic PII detection and redaction
  • Enforce consistent policies across all AI calls
  • Centralise logging for compliance audits

4. Log for compliance

Record each request and its redacted version, along with metadata (timestamp, user ID, purpose). This creates an audit trail required by GDPR.

Tools & recommendations

  • Secure AI platforms (e.g., Questa‑AI) that provide built‑in automatic PII detection and redaction.
  • If you prefer to build your own solution, use open‑source libraries for PII detection (e.g., presidio, pii‑detect) and integrate them into your proxy.

Checklist before shipping AI features

  • Have you identified all sources of PII in user input?
  • Does every AI request go through the redaction proxy?
  • Are logs being stored securely and retained for the required period?

If any answer is “no”, address that gap first. The architecture change is relatively simple—add a proxy, enforce redaction, and log the interactions. Once in place, AI can be used confidently without violating GDPR, allowing teams to focus on shipping features rather than debating security.

Back to Blog

Related posts

Read more »