---
title: Your Marketing AI Prompts Are Leaking Customer PII. Redact Before You Send.
description: Most marketing AI jobs send raw names, emails, and phone numbers to a model API for tasks that never need them. Here is how to tokenize PII at the gateway and restore it after the response.
author: LETSGROW Dev Team
date: 2026-10-17
category: AI Tools
tags: ["PII Redaction", "Data Privacy", "LLM", "AI Gateway", "Presidio"]
url: "https://letsgrow.dev/blog/pii-redaction-marketing-ai-prompts"
---
Every customer record you paste into a prompt is a copy of that customer's data living on someone else's servers. Most marketing teams treat that as a rounding error. It is not. If your lead enrichment, call summarization, or support tagging jobs send raw names, emails, and phone numbers to a model API, you have built a data leak with a nice interface. The fix is cheap and boring: redact PII before the prompt leaves your network, and restore it after the answer comes back.

::stat-block
- value: 0
  label: Fields of customer PII a classification or scoring prompt actually needs
- value: 3
  label: Places raw PII usually leaks: prompts, logs, and vendor retention
- value: 1 layer
  label: Is enough to start: a redaction step in front of your LLM client
::

## The Model Does Not Need to Know Who Anyone Is

Look at what your marketing AI jobs actually do. Score a lead from firmographics. Tag a call transcript with objections. Summarize a support thread. Draft a reply to a review. In almost every case, the task depends on the content and structure of the text, not on the identity of the person who wrote it.

"Sarah Chen from Acme asked about SSO pricing" and "[PERSON_1] from [COMPANY_1] asked about SSO pricing" produce the same intent tag, the same sentiment, the same next step. The model gains nothing from the real name. You gain a great deal from withholding it: a smaller blast radius if a vendor is breached, simpler data processing agreements, and logs you can share with engineers without a privacy review.

The common objection is that redaction hurts quality. In practice it rarely does for classification, extraction, and summarization. It can hurt when the identity itself is the signal, such as researching a named executive. For those cases, keep the name and redact everything else.

## Tokenize, Do Not Delete

Deleting PII breaks your output. If the model drafts "Thanks for reaching out, [REDACTED]" you have a worse email and no way to personalize it. The pattern that works is reversible tokenization.

Replace each sensitive value with a stable placeholder before the call, keep a lookup table in memory for the life of that request, and swap the real values back into the response. The model sees [EMAIL_1] and [PERSON_1]. Your CRM write-back sees the real values. The mapping never leaves your process and is discarded when the job finishes.

Two rules keep this reliable. Make placeholders consistent within a request, so the same email always maps to the same token and the model can reason about who said what. And make them unique across requests only when you cache the mapping securely, otherwise let them reset. For detection, use a purpose-built library such as Microsoft Presidio rather than hand-written regexes. Regexes catch emails and phone numbers. They miss names, addresses, and the account number buried in a free-text note.

::compare-table
| Approach | Catches names | Keeps output usable | Effort | Verdict |
| --- | --- | --- | --- | --- |
| Regex only | No | Yes | Low | Fine for emails and phones, not enough alone |
| Delete matches | Partly | No | Low | Breaks personalization |
| NER library plus tokenize | Yes | Yes | Medium | The default for most teams |
| Self-hosted model | Yes | Yes | High | Worth it for regulated data |
::

## Put It in the Gateway, Not in Every Script

The failure mode of redaction is inconsistency. One script redacts, three others do not, and nobody remembers which. Treat it as infrastructure. Put the redaction step in a single shared client or in your LLM gateway so every outbound call passes through it by default, and make bypassing it a deliberate, logged choice.

Then handle the quieter leak: your own logs. Teams carefully redact prompts and then write the full request body to a debug log or an observability trace. Log the redacted prompt, never the original. Apply the same filter to anything you ship to a tracing tool, because those vendors are one more third party holding your customer data.

Finally, test it. Build a small fixture of fake records containing tricky PII, such as names inside sentences, emails with plus signs, phone numbers in odd formats, and addresses in signatures. Run it in CI. Assert that none of the planted values appear in the outbound payload. When a detector misses something in production, add that case to the fixture. This is the same discipline you apply to prompt evals, pointed at privacy.

## Ship It This Week

You do not need a platform project. You need a short list and an owner.

::checklist
title: PII redaction rollout
items:
  - List every job that sends customer text to a model API
  - Mark which fields each job genuinely needs, and drop the rest
  - Add a detection library in front of your shared LLM client
  - Use reversible placeholders so outputs can be rehydrated
  - Log only redacted prompts and traces
  - Add a fixture of fake PII to CI and fail the build on any leak
  - Review vendor retention and training settings once per quarter
::

Start with your highest volume job, because that is where most of the exposure sits. Measure how often the detector fires, spot check twenty redacted prompts by hand, and compare output quality against the unredacted version on a sample. If quality holds, and it usually does, roll the same client out to every other job.

The teams that get hurt by AI data incidents are rarely the ones who made a clever mistake. They are the ones who never asked what was inside the prompt. Ask, then strip it out before it leaves the building.
