The LLM features customers notice most run on customer data. A support assistant answers better when it can read the ticket history, and a claims summarizer is useless without the case file. Every API call that carries that data is also a transfer to a model provider, which keeps its own logs under its own retention rules. That provider may also process the request in a different jurisdiction from your customers.
The model rarely needs the identifiers themselves. To draft a reply, it needs to know which customer is which across the conversation and what kind of detail appeared in the text. A stable token can carry both. This article explains how to use customer data in AI while your LLM provider receives tokens in place of real names and account numbers, where those identifiers hide in a request, and what the approach leaves uncovered. It is one part of a wider approach to controlling what your AI systems can see and hold.
Steps to Use Customer Data in AI While Your LLM Provider Sees Only Tokens
To use customer data in AI without sending identifiers, route LLM API calls through a privacy proxy. It swaps each customer identifier for a deterministic token before the provider sees the request, then puts real values back in the reply.
1. Send LLM API Calls Through a Privacy Proxy With a Base URL Change
Your application keeps the same model and the same SDK. What changes is the address each request goes to, and the setup takes three moves:
- Register your existing provider key once in the proxy's console.
- Change the base URL in your LLM client to the proxy endpoint.
- Send a test request with sample customer details and confirm the dashboard shows the detections.
From then on, the proxy tokenizes the customer data it finds in each request before forwarding it to the provider you chose. Because the change happens at the API layer, your support agents and claims handlers keep using the app the way they always have. Nobody has to remember to remove an email address before asking a question.
2. Detect Customer Identifiers and Secrets in One Pass
Customer text carries more than personal details. Secrets end up in it whenever people paste what they're looking at into a support thread:
- Error logs: a stack trace copied into a ticket can include a cloud API key.
- Troubleshooting threads: a developer may share a database connection string while helping a customer.
- Configuration snippets: private keys sometimes travel inside a pasted config file.
- Integration questions: auth tokens appear when customers describe a failed API call.
When secret detection runs in the same pass as PII detection, one scan covers both before anything leaves your environment. NoPII replaces detected secrets with vault tokens and restores them in the response, logging each detection.
3. Replace Each Value With a Deterministic Token
Every detected value is swapped for a token that names its type and holds a stable reference. Deterministic means the same plaintext always produces the same token, which is what lets the model follow one customer through a long conversation:
| Turn | What the customer wrote | What the provider receives |
|---|---|---|
| First message | My email is john@acme.com | My email is [EMAIL: bN3dF5h] |
| Tenth message | Send the refund confirmation to john@acme.com | Send the refund confirmation to [EMAIL: bN3dF5h] |
The model sees one token in both places and links the two requests to the same person. Teams that have tried PII masking for LLMs often hit the opposite problem: every masked value looks identical, so the model can no longer tell one customer from another.
4. Neutralize Context Phrases That Reveal What a Token Hides
A token can still give away more than you intend when the words beside it describe the value. Context phrase neutralization rewrites those labels into generic ones. NoPII's own examples include:
- Social security number is rewritten as ID number
- Credit card number and bank account number both become account number
- Date of birth is shortened to date
- Passport number turns into document number
The model still knows an identifier is present and what role it plays in the request. The surrounding text no longer announces which kind of identifier sat behind the token, and NoPII credits this neutralization with preventing model refusals.
5. Restore Real Values When the Response Comes Back
The provider's answer arrives with tokens in it, and the return trip runs in a fixed order:
- Provider sends back a response that refers to customers by their tokens.
- Proxy looks up each token in the vault and replaces it with the original value.
- Application receives the restored response and carries on as if no tokenization happened.
NoPII calls this round-trip detokenization, and your users never see a token. With streaming, the same replacement happens as chunks arrive, so a live chat reply shows real names while it is still being written.
6. Block the Request When Tokenization Fails
Detection can error out, and what the proxy does next decides whether the failure stays harmless. A proxy that forwards the raw text when something breaks leaks customer data without anyone noticing, because the request still succeeds and the application looks healthy.
NoPII blocks the request whenever tokenization fails and logs the decision. The failure surfaces as an error your team can see and fix, and the provider never receives the raw customer data. NoPII describes this as architecture, which means it is not a setting someone can turn off.
Which Customer Identifiers an LLM Privacy Proxy Should Detect Before a Model Call
An LLM privacy proxy should detect common direct identifiers such as names, emails, phone numbers and card numbers by default. It should also support regional IDs for the countries your customers live in, plus API keys hidden in customer text.
Start with the identifiers that appear in almost every customer record. NoPII detects 11 types everywhere by default:
| Group | Identifier types |
|---|---|
| People and contact | Person names, email addresses, phone numbers, street addresses |
| Payments and finance | Credit and debit cards, IBAN, crypto wallet addresses |
| Network and web | IP addresses (v4 and v6), URLs |
| Credentials | API keys and connection strings, along with other secrets |
| Time | Dates |
Regional identifiers come next. More than 25 country-specific types can be switched on per workspace, covering:
- United States: SSNs, US passport numbers, driver's license numbers, bank account numbers, Medicare Beneficiary Identifiers and tax IDs
- India: Aadhaar (checksum-validated), PAN, Indian address formats with PIN codes and Devanagari digits, with passport and voter ID numbers among the beta types
- United Kingdom: National Insurance and NHS numbers, along with UK street address formats
- Europe: Spanish tax and identity numbers, Italian fiscal codes and VAT numbers, Polish PESEL and Finnish personal identity codes, all in beta
- Australia and Singapore: Tax File Numbers, ABN, ACN and Medicare numbers, along with Singapore NRIC and FIN, all in beta
Some of these are detected only when a label such as TFN or NRIC sits before the number. Plain numbers match check digits too often to be treated as identifiers on their own.
Secrets get their own coverage. NoPII ships with 14 secret pattern families switched on for new accounts. They range from cloud credentials and LLM provider keys to private keys, with code-platform tokens and database connection strings in between.
Language matters too. Pattern-based types are detected in most languages, including non-Latin scripts and full-width digits. Names and places are detected in English, with Devanagari Hindi in beta.
One more point belongs in any list of what counts as PII. A single field can look harmless while a combination of fields identifies a person. A postcode plus a job title plus a purchase date may point to one customer even though none of them is an identifier by itself. Detection handles the recognizable values, and deciding which fields a request needs in the first place handles the rest.
Why Tokenization Keeps LLM Answers Accurate When Redaction Breaks Them
Redaction deletes identifiers and leaves gaps the model can't reason over, whereas tokenization gives every value a stable stand-in. The LLM can still tell customers apart across turns, and the original values return to your app in the reply.
Here is a request as your application builds it:
Please update the account for John Smith (SSN: 123-45-6789) at john@acme.com
Redacted, it reaches the provider like this:
Please update the account for [REDACTED] (SSN: [REDACTED]) at [REDACTED]
Tokenized through NoPII, the provider receives this:
Please update the account for [NAME: Ry0Ixd1] (ID number: [IDENTIFIER: k8Lm2n]) at [EMAIL: bN3dF5h]
The redacted version tells the model that three things were removed and nothing else. It can't tell whether the email belongs to the same person as the name. Once two customers appear in one thread, every reference collapses into the same placeholder. Models also tend to hedge or refuse when a request is full of blanks.
The tokenized version keeps the structure intact. The model can see that the name and the email belong to the same request, with an ID number between them. The SSN label has been neutralized to ID number. When the answer comes back, the proxy puts the real values in place.
| Question | Redaction | Tokenization |
|---|---|---|
| Can the model link a name to its email? | Relationships between values are lost | Each value keeps a stable token, so links survive |
| Does the same customer stay recognizable across turns? | Every mention becomes an identical blank | One customer maps to one token in every message |
| Can real values reach the user in the reply? | Nothing remains to put back | Tokens are swapped back on the return path |
| How does the model react? | Gaps can trigger refusals | Neutralized labels help prevent refusals |
Tokens are pseudonymous. The vault can map them back to real values, so tokenized customer records are generally still personal data under laws such as GDPR. Tokenization reduces what the provider receives, and your privacy obligations for that data still apply. Teams comparing data redaction for AI with tokenization should weigh that alongside answer quality.
Where Customer Identifiers Travel in an LLM Request Beyond the Chat Message
Customer identifiers travel well beyond the message a user typed. They sit in system prompt fields and tool call results, and they ride along in conversation history and streamed output, so detection has to cover the whole request.
System Prompt Fields Loaded With Account Context
Applications often load account details into the system prompt field so the model starts with context. That field travels to the provider with every call, so it needs the same treatment as user messages. Here is a typical field before and after tokenization:
Before: You are helping Priya Nair (priya.nair@example.com), Gold plan, open ticket about a delayed refund.
After: You are helping [NAME: Tq7Lm2a] ([EMAIL: Hx4Rb9c]), Gold plan, open ticket about a delayed refund.
NoPII scans the system prompt field along with user and assistant messages. The plan tier and ticket topic stay readable to the model, while the customer's identity stays in the vault.
Tool Call Arguments and Tool Results
When a model calls a function to look up an order, customer data moves in both directions:
| Part of the call | What it can carry | How NoPII handles it |
|---|---|---|
| Arguments in the tool call | An email or account number used to find the record | Detected and tokenized whenever they travel to the provider |
| Results your system returns | The full order record, often with a delivery address | Sanitized before the next turn reaches the provider |
| OpenAI Responses API | Function calls in the newer response format | Served alongside Chat Completions |
| Anthropic Messages endpoint | Tool use and tool result blocks | Sanitized inside the Messages endpoint |
Tool results can hold far more customer detail than the original question needed, which makes them easy to overlook when you review what an LLM request contains.
Earlier Turns in the Conversation
Most chat applications resend the full conversation history with each call, because the model keeps no memory between requests. A phone number a customer shared in turn two goes to the provider again on every later turn. Without protection, one disclosure turns into many.
Deterministic tokens keep those repeats consistent. The phone number appears as the same token every time the history is resent, so the thread keeps its meaning for the model without carrying the real number.
Streamed Responses
Streaming creates its own problem, because a token can be split across two chunks. NoPII handles the two cases differently:
- Text responses streamed as server-sent events are detokenized in flight, so real values appear as each chunk arrives.
- Streamed tool-call arguments are held until the call completes, then released as one piece.
The second rule matters for any application that parses tool calls as JSON. A token cut in half mid-stream would otherwise produce malformed output your code can't read.
Traces and Observability
Tracing tools capture request and response bodies by design, and traces are often read by more people than the app itself. NoPII's Langfuse integration is set up to keep customer values out of them:
- Availability: opt-in for each workspace
- Trace shape: each request produces a trace that starts at the sanitize step and ends at the desanitize step, with the model call between them
- Logged content: input and output are tokenized, and output is captured before detokenization
- Existing tracing: the W3C traceparent header is honored
- Failure handling: tracing failures never affect requests
This kind of coverage is central to PII protection for LLM applications, since customer values in a trace store are as exposed as values sent to the provider.
How to Use Customer Data in RAG and Embeddings Without Sending Identifiers
To use customer data in RAG without sending identifiers, tokenize each text before it goes to the embedding model. The provider embeds tokens in place of names and emails, and the vectors come back unchanged for your vector store.
Retrieval-augmented generation pulls in exactly the documents that carry the most customer detail: support tickets, case files, contracts and clinical notes. Each of those texts passes through an embedding API before it is stored, which makes the embedding call a second route to the provider.
NoPII tokenizes each text before the embedding provider sees it:
Before: Case notes for John Smith, john@example.com. Follow-up scheduled.
After: Case notes for [PERSON: aBcDeFgH12], [EMAIL: bN3dF5h]. Follow-up scheduled.
The vectors return unchanged, so search and retrieval behave as usual. Embedding protection works with OpenAI, Mistral, Together, Fireworks and Gemini.
Two practical points shape how well this works:
- Match names before they reach the proxy: J. Smith and John Smith produce different tokens. Tokenization ignores how alike two names look, so deduplicate customer records on your side first if you want one person to map to one token.
- Keep semantic search on the content: retrieval works on the meaning of the surrounding text. Fuzzy matching over the identifier values themselves won't survive tokenization, so design queries around the issue or product.
Deterministic tokenization is what makes RAG over tokenized data hang together. Anyone new to how tokenization works can think of it as a consistent alias for each value: the same input gives the same alias every time.
Who Can Reveal Real Customer Values After an LLM Response Is Detokenized
Real customer values should be revealed only to the user or session that created a token, or to someone holding an explicit grant. Every other request should be refused, with each event recorded in an audit log that holds no plaintext.
Restoring values in the response path covers the normal case. Your application also needs rules for anyone who later asks to see the value behind a token. NoPII reveals a token only when one of four conditions holds:
- End user who created the token makes the request.
- Session the token was created in, which belongs to no other user, asks for it.
- Reveal grant covering that token is in place. Grants last from 60 seconds to one day, and each one carries a recorded reason such as a ticket number.
- Server-side key carrying the opt-in detokenize-any scope makes the call.
Anything outside those conditions is refused. The policy fails closed as well: when the shared reveal cache is unavailable, reveals are refused. Key types add another layer. Secret keys stay on servers, publishable keys are origin-restricted for in-page use, and device keys handle enrollment. Privileged scopes on publishable or device keys are dropped.
Failure on the return path also lands on the safe side. If detokenization fails, tokens stay visible in the output and the real value stays hidden.
What the audit log keeps: each detection is recorded with the token, a masked value, the entity type, a confidence score, the session, provider and model, and a timestamp. Plaintext is never written to the log.
How long tokens live: set a retention period that matches how long your application needs to restore a value. Short retention suits one-off chats, while longer retention suits support cases that reopen weeks later. When a token expires, the underlying data is permanently deleted from the vault. With NoPII, retention ranges from a single day to permanent depending on the plan, as shown on the NoPII pricing page.
Handling an erasure request: the token purge deletes every token for a list of values in one request. The audit entry stays, stamped with when and by whom the purge happened, so you keep the record without keeping the data.
How One Privacy Proxy Covers Customer Data Across Every LLM Provider You Use
One privacy proxy can sit in front of nine LLM providers, from OpenAI and Anthropic to Groq and Fireworks. Customer data gets the same tokenization and audit trail whichever model you call, so changing models doesn't mean rebuilding protection.
Many teams use more than one model. A cheaper model handles classification, a stronger one handles drafting, and a third gets trialed every quarter. NoPII works across nine providers:
- OpenAI
- Anthropic
- Google Gemini
- xAI
- DeepSeek
- Mistral
- Groq
- Together
- Fireworks
Setup stays light. NoPII needs no API key or header of its own. You register each provider key once in the console, and NoPII identifies your account from the provider key already in the request and never stores your key. Several providers can sit under one account with one audit log, so a privacy review covers every model your application calls.
Public examples also cover LangChain, LangGraph, LlamaIndex, LiteLLM and the Vercel AI SDK, since these frameworks accept a configurable base URL.
Where the proxy runs is a separate decision:
| Edition | Where it runs | What your team handles |
|---|---|---|
| NoPII Cloud | Managed service operated by Enigma Vault | Registering a provider key and changing the base URL |
| Self-hosted | Proxy and vault inside your own environment | Running the containers under an annual Enterprise license |
Detection, tokenization, restoration and fail-closed behavior are identical in both editions. Workspaces let you separate tenants, each holding its own provider keys and PII settings. Every workspace also keeps a separate audit log.
A browser SDK is in preview. Its second tier lets the browser tokenize messages before they reach your own API, so your servers forward tokens and the reply is revealed in the browser. The page your user loads still runs your JavaScript, which can read the text.
What Tokenizing Customer Data Before LLM Calls Does Not Protect
Tokenizing customer data before LLM calls protects the text your application routes through the proxy. It does not cover consumer chatbots, images or audio, providers you never routed, or identifiers the detector doesn't recognize.
Traffic That Never Passes Through the Proxy
NoPII protects the route you integrate. Anything that reaches a model by another path keeps its plaintext:
| Situation | Why the proxy never sees it |
|---|---|
| Employee pastes a customer list into a consumer chatbot website | Browser traffic goes straight to the chatbot provider |
| Browser extension sends text to a model on its own | Extension calls the vendor's API directly |
| Application uses three providers and routes only one through the proxy | Calls to the other two skip the base URL change |
For employee use of consumer chatbots, Enigma points to endpoint DLP as the right control. For your own applications, every provider needs to go through the proxy.
Content and Languages Detection Can't Read Yet
Some customer data reaches a model in forms the detector doesn't handle reliably:
- Non-text content: detection works on text, so a scanned ID or a call recording sent to a model isn't tokenized. Convert the content to text in your own environment first if a feature needs it.
- Names in Chinese, Japanese, Korean or Thai script: these aren't yet reliably detected, so test real records before relying on coverage.
- Regional numbers without a label: several regional types are detected only when a label sits before the number.
- Phone numbers without a country code: these are recognized only for the United States, the United Kingdom, Canada, India, Germany, France, Brazil and Israel.
Values the Detector Misses
Detection is not perfect, and an unrecognized identifier can pass through to the provider. A customer might type an account number in an unusual format, or mention a relative's name in a way the detector doesn't catch.
Sensitive details that aren't identifiers raise a related issue. A ticket describing a health condition carries meaning the proxy isn't designed to remove, and Enigma is clear that tokenization doesn't guarantee removal of every sensitive inference. The answer is data minimization before the proxy: send only the fields a task needs, and treat detection as the second layer.
Compliance by Itself
NoPII is built for teams working under HIPAA, GDPR, CCPA, PCI DSS, SOX and the EU AI Act, and a BAA is available. Tokenizing model traffic supports those programs. Each one still calls for work the proxy doesn't do:
- Mapping every data flow that touches customer records, including routes outside the proxy
- Confirming contracts with model providers and other subprocessors
- Setting retention and access controls for logs and traces
- Deciding whether a BAA or similar agreement is required for your use
Those obligations vary by sector, so check the industry-specific requirements that apply to your customer data.
How to Check That Customer Identifiers No Longer Reach Your LLM Provider
To check that identifiers no longer reach your LLM provider, run real sample records through the proxy and compare your input with what the model received. Then review the audit log and traces for any value that still appears in plaintext.
Testing is where the approach earns trust. These checks move from a quick look to a proper pilot:
- Try the live demo: send a message containing a name and an SSN, then compare what your backend sees with what the provider receives.
- Use the live chat playground: the admin console shows your raw input beside the tokenized version, with the restored response alongside. Paste in real ticket formats and regional IDs, then try names written in other languages.
- Read the audit log by entity type: look for identifier types you expected to see but never appear. A missing type often points to a format the detector doesn't recognize or a regional type that isn't switched on.
- Compare the provider breakdown with your code: the dashboard shows requests by provider. A model your application calls that never appears there is a route that skips the proxy.
- Search traces and error logs: count plaintext sightings of customer values across logs and traces before and after the change.
- Force a failure: confirm that a request is blocked and logged when tokenization can't complete.
Enigma Vault also publishes the results of 109 automated tests on the NoPII engine, which help you see how detection was validated before you run your own data through it.
How Enigma NoPII Lets You Use Customer Data in AI Without Sending Identifiers
It doesn't matter which LLM provider or framework you use. NoPII sits between your application and the model, with Enigma Vault as the underlying infrastructure. Within Enigma AI Vault, NoPII handles the Minimize exposure step. The model works with deterministic references, and real values come back only through controlled restoration.
The change in your code is two lines:
from openai import OpenAI
client = OpenAI(base_url="https://api.nopii.co")
Once that change is live, NoPII gives your application the following:
| Area | What NoPII provides |
|---|---|
| Providers | Nine LLM providers behind one proxy |
| Coverage | 30+ identifier types across nine countries, plus 14 secret pattern families |
| Request paths | Messages, system prompt fields, tool calls and results, streaming, embeddings |
| Failure behavior | Requests blocked and logged when tokenization fails |
| Restoration | Real values returned to your application, with a reveal policy for any later access |
| Records | Plaintext-free audit log, plus token retention by plan with purge for erasure requests |
| Deployment | NoPII Cloud or self-hosted on Enterprise |
| Foundation | Enigma Vault infrastructure (PCI DSS Level 1 and SOC 2 Type II) using AES-256 keys held per customer |
The free tier covers one million protected tokens each month, with no credit card required, so you can start free on your own traffic. To see what your provider would receive first, try the live demo.