NoPII

How to Prevent Sensitive Data From Reaching AI: Steps and Best Practices

To prevent sensitive data from reaching AI, send models only the fields a task needs, replace the remaining sensitive values with reversible tokens before each request and block any request that can't be protected.

AK Abhilash Kumar Dec 2, 2026 20 min read
On this page

    Enigma Vault

    Secure your cards.
    Protect your data.
    Keep it out of your AI.

    Data tokenization that keeps your applications working, so a breach exposes nothing worth stealing.

    • Free Lite tier, no contract
    • PCI DSS Level 1, SOC 2 Type II
    • Billed through AWS Marketplace
    Request a demo

    An HR software team builds an assistant that reads job applications, summarizes each candidate and drafts interview invitations. Testing goes well. Then someone asks what the model provider receives with every request, and the honest list is long: candidate names, phone numbers, home addresses and, now and then, a passport number pasted into a cover letter.

    That question is where most teams start looking for ways to prevent sensitive data from reaching AI. The answer has two parts. Some data never needs to leave your systems at all. The rest can travel as stand-ins that mean nothing to the provider, while your application still gets the real values back.

    How to Prevent Sensitive Data From Reaching AI Models and LLM Providers

    To prevent sensitive data from reaching AI, send models only the fields a task needs, replace the remaining sensitive values with reversible tokens before each request and block any request that can't be protected.

    Every prompt your application sends is a data transfer. After a request goes out, what it contains is governed by how that provider logs and keeps data, and by the laws where it operates. None of that shifts your own obligations under HIPAA or GDPR, or under the agreements you have with customers.

    This is why AI projects stall in review. Asked to sign off on a feature backed only by a vendor's assurances, legal and compliance teams tend to refuse, and the roadmap freezes or teams find a way around the review. Once providers only ever see tokens that point to nothing, the approval case depends on controls you own.

    Three moves keep data from reaching AI, and they work best in this order:

    1. Send less: leave out every field the model doesn't use, so there is less to protect in the first place.
    2. Replace values with tokens: swap the sensitive values that remain for consistent stand-ins before the request leaves, then restore the real values in the reply.
    3. Block when protection fails: if tokenization can't run, stop the request so nothing goes out unprotected.

    Each move gets its own section below, from deciding what counts as sensitive to running protection in production. Stakes differ from one sector to the next, and Enigma's page on AI data security across industries breaks down how healthcare, finance, legal and other fields are affected.

    Which Sensitive Data Should Never Reach an AI Model in Plain Form

    Personal identifiers, payment and bank details, government and regional ID numbers and secrets such as API keys should never reach an AI model in plain form. Text about health or finances can be sensitive even without a name.

    One test sorts most fields: would the task still work if the model saw a consistent stand-in where the real value used to be? An assistant drafting an interview invitation needs to know there is one candidate with one email address. It never needs the address itself.

    Data groupExamplesWhat the model needs in its place
    Everyday identifiersDates, street addresses, person names, email addresses and phone numbersConsistent reference for each person and contact detail
    Payment and account dataCrypto wallet addresses, IBAN, credit and debit cards and bank account numbersProof that an account exists, without the digits
    US identifiersTax IDs such as EIN, ITIN and TIN, Medicare Beneficiary Identifiers, Social Security numbers, plus passport and driver's license numbersNeutral label such as ID number
    Identifiers from other marketsNHS and National Insurance numbers in the UK, PAN, Aadhaar and voter ID in India, Spain NIF, DNI and NIE, Italy fiscal code, Poland PESEL, Finland personal identity code, Australia TFN and ABN, Singapore NRIC and FINStable token that keeps each ID distinct
    Technical identifiersIP addresses and URLsPlaceholder that keeps the structure readable
    Secrets and credentialsPrivate keys, auth tokens, database connection strings, code-platform and payment tokens, model API keys and cloud provider keysNothing, since no task needs a live credential

    Regional ID types are often optional in detection tools, several are still in beta, and a few, such as TFN and NRIC numbers, are only picked up when their label appears right before them. Check which ones your customers actually send.

    The hardest category has no identifier in it. A cover letter that mentions a medical condition, or a note about someone's debt, carries sensitive meaning even with every name removed. Detection can't catch meaning, so sending fewer fields matters as much as anything else. The full range of types of personally identifiable information also includes combinations of ordinary fields that point to one person.

    The 5 Most Common Ways Sensitive Data Leaks Into AI Model Requests

    Sensitive data most often leaks into AI through raw records in model requests, context the application adds on its own, secrets pasted into customer text, documents sent for embeddings and filters that fail without anyone noticing.

    None of these needs a hacker. Each one is a feature behaving as designed, which is exactly why they go unnoticed.

    1. Raw Records Sent Straight to the Provider

    The simplest leak is the most common. A feature passes a full application, ticket or claim to the model, and customer data accumulates in the provider's logs with every call. A recruiting assistant asked for a two-line summary might receive the candidate's home address, phone number and date of birth along with the work history it actually uses. Nobody decided to share those extra fields. They went along because the code sent the whole record, and they will keep going along with every request until someone narrows it.

    2. Context the Application Adds on Its Own

    Much of what reaches a model was never typed by a user. Applications quietly add:

    • System prompts built from account or profile data
    • Values the model hands to a tool, like an email used for a lookup
    • Tool results, which often return whole records when one field was needed
    • Earlier turns of the conversation, resent with each new message

    Because this context is assembled in code, it rarely shows up in a product review. A system prompt that includes a customer's account details travels again on every turn of the session.

    3. Secrets Hidden Inside Customer Text

    Customers paste error logs and configuration snippets into support chats, often without noticing what they contain. A single line like this one, with an invented password, is enough to expose a whole database:

    ERROR could not connect: postgres://admin:Winter2026!@db.internal:5432/candidates

    Credentials like these unlock far more than one person's details, so detection has to look for secrets as well as personal data.

    4. Documents Sent for Embeddings

    Retrieval features move documents through several stages before a model ever answers a question:

    1. Documents are split into chunks of text.
    2. Each chunk goes to an embedding API.
    3. Vectors and text are stored in a vector database.
    4. Matching chunks are pulled back into later requests.

    By the end of that path, the vector database holds its own copy of customer data, outside the systems where you normally govern it, and the same chunks reach the model again at query time.

    5. Filters That Fail Without Warning

    Homegrown filters usually run on a best-effort basis. The difference shows up only when something breaks:

    • Best effort: when the filter times out or errors, the untouched request still goes out, and the gap appears on calls no one reviews.
    • Blocked by default: the failing request never leaves your systems, and engineers get a visible error to chase down.

    Strong PII protection in LLM apps closes all five of these routes at the point where a request leaves for the provider.

    Why Redaction and Masking Fail to Keep Sensitive Data Safe in AI

    Redaction and masking protect data by removing it, which destroys the context a model needs to reason. Placeholders merge different people into one, nothing can be restored in the reply and scrubbed prompts often get refused.

    Redaction replaces a sensitive value with a fixed placeholder such as [REDACTED] or [NAME]. Masking hides part of a value, such as a card number reduced to its final four digits. Both keep the raw value away from the provider, and both also remove information the model was using to reason.

    Here is what that looks like on a simple account request:

    Original: Please update the account for Priya Nair (SSN: 123-45-6789) and email the confirmation to Priya.
    Redacted: Please update the account for [REDACTED] (SSN: [REDACTED]) and email the confirmation to [REDACTED].

    The model can no longer tell that the person at the start of the request is the person at the end. A label like SSN sitting next to a blank also makes models more likely to decline the request outright. The four gaps line up against what reversible tokenization does:

    Redaction and maskingReversible tokenization
    Placeholders destroy entity relationshipsDeterministic tokens preserve them
    Placeholder redaction leaves nothing to restoreTokens are restored, so the application gets real data back
    Models often refuse scrubbed promptsContext neutralization prevents refusals
    Best effort on failureRequests are blocked by default when tokenization fails

    Inline masking still has a place. Many DLP suites and AI gateways include it as one feature among many, and it can be enough for traffic where the model never needs to tell people apart. For features that send customer records to a model and expect useful answers back, the difference between masking and tokenization decides whether the AI still works. Basic masking data in LLM requests copes with brief prompts about a single person and falls apart once several people appear in one thread.

    How Reversible Tokenization Keeps Sensitive Data From Reaching AI Models

    Reversible tokenization replaces each sensitive value with a consistent token before any request goes out and puts the real value back into the reply afterward. The provider sees only tokens, and the model can still tell people and accounts apart.

    Reversible means the change can be undone, but only by the vault that holds the mapping. To the provider, a token is meaningless. To your application, it is a pointer back to the real value.

    Here is the recruiting request from earlier, before and after:

    Before: Draft an interview invite for Arjun Mehta at arjun.mehta@example.com, and copy his referrer Lena Brooks.
    After:  Draft an interview invite for [NAME: Qk3Vm8t] at [EMAIL: Zr6Np1w], and copy his referrer [NAME: Hs9Lb4d].

    The model writes the invitation using the tokens, keeping Arjun and Lena separate. Four details make the approach dependable:

    • Deterministic tokens: identical values map to identical tokens, so Arjun keeps one identity whether he appears in the opening message or the twelfth.
    • Round-trip detokenization: tokens in the reply are swapped back for real values before your application receives it, so the recruiter reads a finished invitation.
    • Context phrase neutralization: labels that invite refusals are replaced with neutral wording, with social security number turning into ID number, credit card number into account number, date of birth into date and passport number into document number.
    • Safe direction on errors: a failed restore leaves the token showing in the reply, which looks odd but exposes nothing.

    Because references stay stable, multi-turn conversations stay coherent and multi-step reasoning stays intact, so protecting the data doesn't cost the feature its usefulness. For more on the mechanics, the primer on how tokenization works explains how vault-issued aliases map back to real values.

    Steps to Prevent Sensitive Data From Reaching AI in LLM Applications

    To prevent sensitive data from reaching AI, map every route to a model, decide what each model needs, cut unused fields, put a tokenizing layer in front of every provider, enable the right entity types, test and monitor.

    These seven steps work for a single feature or a whole product.

    Step 1: Map Every Route That Sends Data to a Model

    Start with an inventory, because any route you miss stays exposed. Teams often find more model calls than they expected once they look across services, scheduled jobs and fallback logic. List:

    • Each application and model provider in use, including fallback providers
    • Frameworks and endpoints that make model calls
    • Tools the model can call and retrieval steps that add context
    • Places where requests and responses get logged or traced

    Step 2: Decide What Each Model Actually Needs to See

    Go feature by feature and check if the real value matters to the output, or whether a stable stand-in with a label would do. A few examples from the recruiting assistant:

    FeatureReal value required?What to send
    Candidate summaryNo, it needs experience and skillsWork history and skills, with the name tokenized
    Interview invitationNo, it needs a consistent referenceTokens for the name, email address and phone number
    Sorting applicants by ID numberYes, the digits themselves matterNothing, since this task belongs in your own code

    Most features land in the first two rows. The third kind is rare, and it is usually a sign that the task doesn't need a model at all.

    Step 3: Remove Fields the Task Doesn't Use

    Narrow retrieval queries and trim the records your code adds to each request. In the recruiting example, a summary request that once carried the full candidate profile can carry role history, skills and location at city level, and still produce the same summary. Attachments such as IDs and statements are better kept in protected storage, passing along only the extracted text a task depends on. A protection layer later in the chain is never a reason to send whole records, since it can only protect what it recognizes.

    Step 4: Put a Tokenizing Layer in Front of Every Provider

    A reverse proxy that tokenizes requests and restores responses gives every model call the same protection, whichever provider it goes to. Applications usually connect by changing the base URL in their SDK, so existing features keep working without a rewrite:

    from openai import OpenAI
    
    client = OpenAI(base_url="https://your-proxy.example.com/v1")

    One layer for all providers also means one place to set rules, review detections and prove what was protected.

    Step 5: Turn On the Entity Types Your Data Contains

    Default entity types cover everyday identifiers. Regional types often need switching on, based on where your users are:

    Where your users areIdentifiers to enable
    United StatesSocial Security, passport, driver's license and bank account numbers, Medicare Beneficiary Identifiers, tax IDs
    IndiaAadhaar, PAN and voter ID
    United KingdomNHS and National Insurance numbers
    Spain, Italy, Poland and FinlandNational ID and tax codes for each country
    Australia and SingaporeTFN, ABN and Medicare numbers, plus NRIC and FIN

    Internal identifiers, such as employee or matter numbers, can usually be added as custom terms.

    Step 6: Test With Representative Records

    Run realistic samples through before launch, using the formats your customers actually send. Then check, in order:

    1. Which values are recognized and which are missed
    2. Which ordinary words or numbers are detected by mistake
    3. Whether streaming replies, JSON output and tool calls still work
    4. How the text leaving your backend compares with what reaches the provider

    Step 7: Launch, Monitor and Close Any Bypass

    Route every production call through the protected path and block or govern anything that tries to skip it, including fallback providers and scripts that call a model directly. After launch, compare detection counts per entity type against what you expect, because a category that never shows up usually means a format is slipping through. Benchmark latency and answer quality on real traffic, and repeat the inventory from step 1 whenever a team adds a new provider, tool or feature.

    Best Practices for Preventing Sensitive Data Leakage to AI Models

    Good practice means protecting all parts of a request, stopping on failure, keeping PII out of logs and traces, limiting who can reveal real values, planning erasure and rechecking coverage after every change to your AI features.

    The steps above get protection running. These practices keep it working as features grow:

    PracticeWhy it matters
    Cover streaming, tool calls and embeddingsData in these parts of a request is the easiest to miss
    Keep blocking as the defaultFailed checks should stop the request, never wave it through
    Keep observability free of PIITraces and logs usually reach more people than production data
    Decide where plaintext stopsTokenizing can be allowed widely, while revealing needs limits
    Plan erasure before you need itPurging tokens in your own vault beats chasing provider retention
    Recheck after every changeNew providers and features open new routes

    Reveal rules deserve the most thought. Real values should come back only to the end user who created a token, or inside a session no other user shares. Anyone else should need a grant that expires and records why it was issued, for instance a support ticket number, and reveals should be refused if the service that checks these rules is down. Audit records can then hold each token with a masked form of the value, so you keep evidence without building another store of plaintext. Reveal control often settles the question when a team sets data redaction for AI against tokenization.

    Step-by-Step: How to Block Sensitive Data Going to LLMs With Enigma Vault NoPII

    Your feature might call one model today and another next quarter. It doesn't matter which model vendor or SDK your team settles on. NoPII acts as the reverse proxy in front of it, and Enigma Vault serves as the underlying infrastructure behind each token. Teams put the steps above into practice with NoPII in this order.

    1. Create a free account: you get one million protected tokens a month on the free tier, and no credit card is needed.
    2. Connect your provider: use the provider key you already have. NoPII keeps a hash of the keys it issues and never keeps a copy of yours.
    3. Change the base URL: a two-line code change points your SDK at https://api.nopii.co.
    4. Set PII settings per workspace: choose entity types, switch on regional types, add custom terms and adjust detection sensitivity.
    5. Check detection before launch: use the detection preview and the live chat playground with sample records.
    6. Send production traffic: requests can go to any of nine providers, such as Anthropic, Google Gemini and OpenAI. Scanning covers the message content and system prompt, plus whatever enters and leaves each tool call, and 14 secret pattern families are checked in the same pass. Streamed replies are restored in flight, and the OpenAI Responses API, Anthropic Messages and embeddings for supported providers are covered.
    7. Watch the results: the dashboard and usage dashboard track activity, the audit log keeps masked values with no plaintext, and Langfuse traces record tokenized content only.
    8. Control reveals and erasure: reveal grants carry a recorded reason, and token purge removes the tokens for a list of values when an erasure request arrives.

    If tokenization ever fails, the request is blocked. That behavior is built into the design and can't be switched off. Deployment can be fully managed, or the proxy and vault can run inside your own environment. Everything rests on Enigma Vault, which holds PCI DSS Level 1 and SOC 2 Type II, and a BAA is available.

    The NoPII live demo shows a sample request being tokenized and restored.

    Teams ready to move real traffic can start free on NoPII in a few minutes.

    When Not to Use an LLM Privacy Proxy for Sensitive Data Protection

    Skip or supplement an LLM privacy proxy when a task has no personal data, needs the literal value, matches names loosely or involves images and audio. Public chatbots and tools that can't route traffic need other controls too.

    Even a well-built proxy has edges. Some tasks fit it poorly:

    • Pure code, math or public-data tasks with no personal data, where the proxy only adds an extra hop
    • Loose or semantic name matching, because two similar names become two unrelated tokens
    • Work that needs the literal value, such as sorting Social Security numbers numerically

    Other traffic sits outside its reach entirely:

    • Images and audio recordings that contain personal details, since a text-only proxy never reads them
    • Employees pasting records into consumer chatbot sites, where endpoint data-loss prevention fits
    • Closed tools and browser extensions that can't send their traffic through the proxy
    • Batch jobs and newer provider endpoints that haven't been tested with the proxy
    • Names in Chinese, Thai, Korean or Japanese scripts, which detection can't yet handle reliably

    Browser code is one more gap. Any script on the page sits where users type and can read the text long before a server-side layer gets involved. Knowing these limits early lets you pair the proxy with the right controls.

    How Enigma AI Vault Extends Sensitive Data Protection to AI Agents

    When an LLM feature grows into an agent, the data question widens. Agents retrieve records, hold cards and files, call tools and take actions over many steps, and sensitive data can spread into agent memory, vector stores, caches and connected vendors along the way.

    For teams heading in that direction, Enigma AI Vault is the next place to look. It brings together The Vault, NoPII and Triplets, giving teams control over what agents see, hold, spend and claim while the existing agent stack stays as it is. NoPII remains the layer that keeps PII and secrets out of model requests, while release decisions for real values are made outside the model.

    AK
    Abhilash Kumar Chief Growth Officer

    Abhilash Kumar is Chief Growth Officer at Enigma Vault, where he leads growth strategy, market positioning, and partnership development. He brings experience across B2B SaaS marketing, product marketing, brand building, and demand generation, with a career spanning technology companies and communications agencies.

    View full profile

    Frequently asked questions

    Can you use AI without sending sensitive data to the provider?
    Yes. Leave out fields a task doesn't use and tokenize the rest before each request. The provider reasons over tokens, while your application swaps real values back into each reply, so users see normal results.
    What is reversible tokenization for LLMs?
    It replaces each sensitive value with a consistent token before a model call and swaps the real value back into the response. Only the vault holding the mapping can reverse it, so the provider never sees the original.
    Why doesn't redaction keep sensitive data safe in AI?
    Redaction removes values the model may need to tell people apart, leaves nothing to restore and can trigger refusals. Many redaction filters also let requests through when they fail, so data still leaks.
    Does blocking sensitive data slow down LLM responses?
    The added processing is usually measured in milliseconds per round trip. Streamed replies can be restored as chunks arrive, though it pays to test speed and answer quality on your own traffic before launch.
    Does keeping sensitive data from AI make an app compliant?
    No single control does. It reduces what reaches third parties and simplifies erasure, while compliance also rests on your contracts, a BAA where one is required, access rules and a review of how data moves end to end.