Data as of Sep 16, 2026 · Based on 296 AI responses from ChatGPT Search and Google AI Mode · See how Parse measures this
To anonymize data before sharing with public LLM APIs, you can use enterprise-focused managed privacy vaults for compliance and security or lightweight tools for local development. For high-compliance enterprise needs, solutions like Skyflow or
Protecto use dedicated vaults to replace sensitive data with tokens. For developers building systems, libraries like Microsoft
or allow for custom, self-hosted integration directly within your application code.
Brands AI recommends here
Named in 66% of answers
Best for enterprise-grade security where compliance with SOC2 or HIPAA is required; it provides a mature, purpose-built vault that isolates and tokenizes sensitive data before it reaches any public LLM provider.
Named in 44% of answers
Best for developers needing a flexible, cost-effective, and open-source way to detect and mask PII within their own infrastructure. It is highly adaptable for custom anonymization workflows but requires self-hosting.
Named in 36% of answers
Named in 28% of answers
Building a local privacy vault/proxy that intercepts, anonymizes (masks/tokenizes) PII locally, and de-anonymizes LLM responses on the fly is the gold standard for safely leveraging public APIs (OpenAI, Anthropic, Gemini) without leaking sensitive data.[](https://github.com/malteos/awesome-anonymization-for-llms)…
Building a local privacy vault/proxy that intercepts, anonymizes (masks/tokenizes) PII locally, and de-anonymizes LLM responses on the fly is the gold standard for safely leveraging public APIs (OpenAI, Anthropic, Gemini) without leaking sensitive data.
The architecture for this setup relies on an OpenAI-compatible local gateway paired with a robust PII detection and reversible masking engine.
text``` [Your App / Client] │ (Sends standard OpenAI/Anthropic payload) ▼ [Local Privacy Proxy / Vault]
Use code with caution.
### Top Open-Source Building Blocks & Tools
Instead of building from scratch, you can assemble a production-grade stack using these proven open-source components:
1. **The PII Detection & Anonymization Engine**
- **[Microsoft Presidio](https://github.com/microsoft/presidio):** The industry standard for context-aware, localized PII detection and anonymization/pseudonymization. It runs locally, supports custom entity recognizers, and integrates with spaCy or Hugging Face Transformers.
- **LLM Guard (by Protect AI):** Includes robust input scanners specifically built to detect, redact, and anonymize PII before it reaches an LLM call.
- **DataFog / GLiNER:** Lightweight, fast extraction models if you need cutting-edge zero-shot NER (Named Entity Recognition) locally.[](https://www.youtube.com/watch?v=RfxnD00xxwo&t=760) [[1]](https://www.youtube.com/watch?v=RfxnD00xxwo&t=760)[[2]](https://www.youtube.com/watch?v=zpCX9bTb6fE&t=57)[[3]](https://www.youtube.com/watch?v=_dAzcCk-3U4&t=43)[[4]](https://langfuse.com/blog/2024-06-monitoring-llm-security)[[5]](https://github.com/malteos/awesome-anonymization-for-llms)
2. **The Gateway / Proxy Layer**
- **Kiji Privacy Proxy:** An open-source local privacy proxy (supporting MacOS/Linux) designed to mask and revert PII locally using ONNX before forwarding requests to closed-source models.
- **Custom Lightweight FastAPI / LiteLLM Proxy:** You can spin up a quick Python proxy that mimics the OpenAI `/v1/chat/completions` schema. It catches the incoming JSON, passes the `messages` array through Presidio or LLM Guard, swaps out entities while maintaining a conversation-stable dictionary map, forwards the clean payload to your target LLM, and reverses the replacement on the way back.
- **Pre-built ecosystems:** Explore collaborative curated lists like [Awesome Anonymization for LLMs on GitHub](https://github.com/malteos/awesome-anonymization-for-llms) for plug-and-play dockerized proxies and community-built gateways.[](https://github.com/malteos/awesome-anonymization-for-llms) [[1]](https://github.com/malteos/awesome-anonymization-for-llms)[[2]](https://github.com/malteos/awesome-anonymization-for-llms)
### Key Implementation Gotchas to Keep in Mind
- **Context & Token Stability:** Ensure your mapping engine retains the *same* token for the same entity throughout a multi-turn conversation (e.g., `John` should always map to `<<PERSON_1>>` in turn 1 and turn 2, otherwise the LLM gets confused about pronoun references and context).[](https://github.com/malteos/awesome-anonymization-for-llms) [[1]](https://github.com/malteos/awesome-anonymization-for-llms)
- **State Management:** If your proxy is stateless, you cannot de-anonymize the response properly unless you use reversible pseudonymization backed by a short-lived, encrypted local cache (like an encrypted Redis or local in-memory LRU cache with AES-GCM).[](https://github.com/malteos/awesome-anonymization-for-llms) [[1]](https://github.com/malteos/awesome-anonymization-for-llms)
- **Regex vs. NLP Models:** Relying purely on Regex will miss contextual names or loosely structured data. Combining rule-based regex (for emails, credit cards, phones) with local transformer/NER models (for names, locations, organizations) gives the best balance of speed and safety.
To help tailor the exact implementation approach:
- Are you looking for a **ready-to-deploy open-source proxy binary/Docker container** , or do you want a **code snippet (Python/FastAPI)** to build a custom gateway?
- Which **LLM provider APIs** (OpenAI, Anthropic, etc.) are you targeting?
Yes. What you’re describing is essentially a **privacy gateway/vault**: `Your app → privacy vault → anonymize/tokenize → public LLM API → response → re-identify locally → your app` ### Good options
Yes. What you’re describing is essentially a privacy gateway/vault:
Your app → privacy vault → anonymize/tokenize → public LLM API → response → re-identify locally → your app
For a self-hosted "privacy vault," I'd use:
┌─────────────────────┐
│ Your application │
└──────────┬──────────┘
│
plaintext request
│
┌──────────▼──────────┐
│ Privacy Gateway │
│ │
│ PII/secret detector │
│ ↓ │
│ Tokenizer / vault │
│ ↓ │
│ Policy enforcement │
└──────────┬──────────┘
│
sanitized request
│
┌──────────────▼──────────────┐
│ Public LLM API │
│ OpenAI / Anthropic / Gemini │
└──────────────┬──────────────┘
│
sanitized response
│
┌──────────▼──────────┐
│ Re-identification │
│ + policy validation │
└──────────┬──────────┘
│
original context
The important distinction is tokenization rather than simply redaction. For example:
John Smith emailed [email protected] about Acme Corp.becomes:
[PERSON_1] emailed [EMAIL_1] about [ORG_1].The LLM can still reason about relationships and references. Your vault maintains:
PERSON_1 → John Smith
EMAIL_1 → [email protected]
ORG_1 → Acme Corp.
and only the vault can resolve those tokens.
Don't treat a PII detector as a guarantee of anonymity. Presidio itself explicitly warns that automated detection can miss sensitive information.
For a serious deployment I'd combine PII detection + secret detection + deterministic tokenization + encryption + allow/deny policies + outbound DLP checks. I'd also prevent the public LLM from ever receiving the token→real-value mapping.
If you tell me whether you want open-source/self-hosted, commercial/SaaS, or something you can deploy in your own VPC, I can narrow this to the best 3 choices and give you an architecture for it.
Yes. What you want is essentially an **LLM privacy gateway / privacy vault**: **Your app → PII detection + tokenization → public LLM API → tokenized response → re-identification → your app** ### Best fit: Skyflow
Yes. What you want is essentially an LLM privacy gateway / privacy vault:
Your app → PII detection + tokenization → public LLM API → tokenized response → re-identification → your app
Skyflow is probably the closest off-the-shelf match to your description. Its LLM privacy tooling is specifically designed to detect sensitive information, replace it with tokens, send the de-identified content to external LLMs, and control when those tokens can be re-identified.
For example:
Original:
"Tell John Smith at [email protected] that his $14,500 invoice is overdue."
↓ privacy gateway
LLM sees:
"Tell [PERSON_7] at [EMAIL_3] that his [AMOUNT_12] invoice is overdue."
↓ public LLM
LLM response:
"Please contact [PERSON_7] regarding [AMOUNT_12]."
↓ vault
Your application sees:
"Please contact John Smith regarding $14,500."
Skyflow supports de-identification of text and other unstructured data, configurable token formats, and controlled re-identification. Skyflow Documentation It also provides APIs and gateway-style connections, so you can put it in front of downstream services rather than modifying every application individually.
A good lower-level building block is Microsoft Presidio. It's open source and provides PII detection, masking, redaction, and anonymization for text and images.
A self-hosted architecture could be:
┌─────────────────────┐
│ Your application │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Privacy Gateway │
│ │
│ 1. Detect PII │
│ 2. Tokenize │
│ 3. Policy checks │
└──────────┬──────────┘
│
"John" → USER_123
"john@..." → EMAIL_456
│
▼
┌─────────────────────┐
│ Public LLM API │
│ OpenAI / Anthropic / │
│ Google / etc. │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Re-identification │
│ + output filtering │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Your application │
└─────────────────────┘
Presidio can be installed as Python packages or Docker services, which makes this approach practical for a self-hosted gateway.
[NAME] placeholders.The important architectural point is that anonymization alone isn't enough. If you need the application to recover the original values, use reversible tokenization and keep the mapping outside the LLM provider. Skyflow explicitly supports this vault/token model.
If you tell me whether this is for a personal project, an internal company system, or a production/compliance-sensitive system, I can recommend a concrete architecture and stack (including the API gateway, token store, PII detector, and LLM proxy).
Original:
"Tell John Smith at [email protected] that his $14,500 invoice is overdue."
↓ privacy gateway
LLM sees:
"Tell [PERSON_7] at [EMAIL_3] that his [AMOUNT_12] invoice is overdue."
↓ public LLM
LLM response:
"Please contact [PERSON_7] regarding [AMOUNT_12]."
↓ vault
Your application sees:
"Please contact John Smith regarding $14,500."
Skyflow supports de-identification of text and other unstructured data, configurable token formats, and controlled re-identification. Skyflow Documentation It also provides APIs and gateway-style connections, so you can put it in front of downstream services rather than modifying every application individually.
A good lower-level building block is Microsoft Presidio. It's open source and provides PII detection, masking, redaction, and anonymization for text and images.
A self-hosted architecture could be:
┌─────────────────────┐
│ Your application │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Privacy Gateway │
│ │
│ 1. Detect PII │
│ 2. Tokenize │
│ 3. Policy checks │
└──────────┬──────────┘
│
"John" → USER_123
"john@..." → EMAIL_456
│
▼
┌─────────────────────┐
│ Public LLM API │
│ OpenAI / Anthropic / │
│ Google / etc. │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Re-identification │
│ + output filtering │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Your application │
└─────────────────────┘
Presidio can be installed as Python packages or Docker services, which makes this approach practical for a self-hosted gateway.
A privacy vault and proxy architecture intercepts user prompts, **detects and masks Personally Identifiable Information (PII) using a secure local vault, forwards an anonymized payload to public LLM APIs, and deanonymizes the returned response** before showing it to the end…
A privacy vault and proxy architecture intercepts user prompts, detects and masks Personally Identifiable Information (PII) using a secure local vault, forwards an anonymized payload to public LLM APIs, and deanonymizes the returned response before showing it to the end user.
The implementation relies on an open-source interceptor proxy combined with an entity-recognition and pseudonymization engine.
| Tool / Framework | Function | Primary Use Case |
|---|---|---|
| Microsoft Presidio | PII Identification & Anonymization | Analyzing text, detecting secrets, and masking entities locally. |
| CloakPipe | Privacy Proxy Middleware | Sitting between apps and LLM APIs to handle masking and unmasking. |
| Tonic Textual | Enterprise De-identification | Masking unstructured text securely before cloud transmission. |
If you'd like to proceed, tell me:
A privacy vault or proxy for LLM APIs acts as a local interceptor: it scans outgoing prompts for Personally Identifiable Information (PII) or sensitive data, replaces/vaults it with safe tokens or pseudonyms locally, sends the sanitized payload to public LLM providers (like OpenAI or Anthropic), and then…
A privacy vault or proxy for LLM APIs acts as a local interceptor: it scans outgoing prompts for Personally Identifiable Information (PII) or sensitive data, replaces/vaults it with safe tokens or pseudonyms locally, sends the sanitized payload to public LLM providers (like OpenAI or Anthropic), and then unmasks/restores the original values when the response comes back.
The primary open-source architectures and tools capable of handling this pattern vary depending on your operational setup:
If you want to build a custom vault or integrate anonymization into an existing gateway (like LiteLLM or Portkey), Microsoft Presidio is the underlying open-source engine of choice.
To help point you to the best implementation, tell me:
If you need a **privacy vault / gateway that strips or tokenizes sensitive data before sending prompts to public LLM APIs**, look for an **LLM privacy gateway** (also called a PII redaction gateway, AI firewall, or de-identification proxy). These sit between your application and providers like OpenAI, Anthropic, or…
If you need a privacy vault / gateway that strips or tokenizes sensitive data before sending prompts to public LLM APIs, look for an LLM privacy gateway (also called a PII redaction gateway, AI firewall, or de-identification proxy). These sit between your application and providers like OpenAI, Anthropic, or Google and replace sensitive values with placeholders before the request leaves your environment.
Here are some options:
| Solution | Best for | Notes |
|---|---|---|
| Microsoft Presidio | Self-hosted privacy layer | Detects and anonymizes PII in text, images, and structured data. It can replace, mask, hash, encrypt, or redact detected entities, and can run locally via Python or containers. microsoft.github.io |
| Privian LLM Gateway | Drop-in API gateway | Sits in front of LLM providers, masks sensitive data before provider calls, and restores protected values afterward. privian.iomicrosoft.github.io |
| Treza Labs AI Gateway | Enterprise gateway controls | Provides a routing layer with PII redaction, policy enforcement, and audit capabilities across multiple model providers. www.trezalabs.com |
| Zero Node AI Privacy Gateway | Redaction + rehydration workflow | Replaces sensitive data before sending to AI systems and can restore authorized values afterward. zero-node.com |
| piast-gate GitHub project | Open-source gateway experimentation | An LLM proxy pattern that detects PII, replaces it with placeholders, and restores values in responses. github.com |
A typical architecture looks like:
Your App
|
v
Privacy Vault / LLM Gateway
|
| "John Smith" → "<PERSON_1>"
| "[email protected]" → "<EMAIL_1>"
|
v
Public LLM API
|
v
Gateway restores values (if allowed)
|
v
Your App
For a production deployment, I’d look for these capabilities:
A strong open-source starting point is Presidio + an API gateway layer if you want full control. If you want a ready-made proxy with minimal engineering, an LLM gateway product is usually faster to deploy.
If you tell me your environment (AWS/Azure/GCP/on-prem, language stack, compliance needs like HIPAA/GDPR/SOC 2, and whether you need reversible anonymization), I can narrow this down to a few best-fit choices.
To safely use public LLM APIs (like OpenAI, Anthropic, or Gemini) without leaking sensitive personal or corporate data, you need an **LLM Privacy Proxy with an in-memory/encrypted vault** . This architecture intercepts your prompt, detects and masks Personally Identifiable Information (PII), forwards the sanitized…
To safely use public LLM APIs (like OpenAI, Anthropic, or Gemini) without leaking sensitive personal or corporate data, you need an LLM Privacy Proxy with an in-memory/encrypted vault . This architecture intercepts your prompt, detects and masks Personally Identifiable Information (PII), forwards the sanitized text to the LLM, and then unmasks/restores the original data in the returned response if needed.
Several open-source projects, tools, and architectural stacks handle this exact workflow:
How the Architecture Works
<PERSON_1> ) goes to the public LLM.To help narrow down the right setup, tell me:
Yes. What you want is essentially a **privacy gateway/vault** sitting between your application and public LLM providers: `Your app → Privacy Vault → anonymize/tokenize → public LLM → de-tokenize → your app` ### Best options
Yes. What you want is essentially a privacy gateway/vault sitting between your application and public LLM providers:
Your app → Privacy Vault → anonymize/tokenize → public LLM → de-tokenize → your app
For a serious implementation, don't merely redact:
"John Smith's account 483921 has a problem"into:
"REDACTED's account REDACTED has a problem"Instead, use consistent reversible tokens:
"Customer <PERSON_7>'s account <ACCOUNT_42> has a problem"The vault maintains something like:
<PERSON_7> ↔ John Smith
<ACCOUNT_42> ↔ 483921
The public LLM sees only the tokenized prompt. Its response can then pass back through the vault, where authorized tokens are restored.
I'd also put the vault behind an API gateway and enforce:
One important caveat: automated anonymization isn't perfect. Presidio itself warns that automated detection can miss sensitive information, so it should be supplemented with rules, secret detection, allow/deny lists, and testing against your actual data.
If you're building this yourself, I'd choose Presidio + a small token vault + an LLM proxy. If you want a managed enterprise product, I'd start with Skyflow.
"Customer <PERSON_7>'s account <ACCOUNT_42> has a problem"The vault maintains something like:
<PERSON_7> ↔ John Smith
<ACCOUNT_42> ↔ 483921
The public LLM sees only the tokenized prompt. Its response can then pass back through the vault, where authorized tokens are restored.
I'd also put the vault behind an API gateway and enforce:
One important caveat: automated anonymization isn't perfect. Presidio itself warns that automated detection can miss sensitive information, so it should be supplemented with rules, secret detection, allow/deny lists, and testing against your actual data.
Yes. What you want is usually called a **reversible pseudonymization/privacy proxy**: your application sends data to the vault, the vault replaces sensitive values with consistent synthetic tokens, the public LLM sees only those tokens, and the vault restores the originals in the response. A good architecture is: ```
Yes. What you want is usually called a reversible pseudonymization/privacy proxy: your application sends data to the vault, the vault replaces sensitive values with consistent synthetic tokens, the public LLM sees only those tokens, and the vault restores the originals in the response.
A good architecture is:
Your app
│
▼
┌──────────────────────────────┐
│ Privacy Vault │
│ │
│ 1. Detect PII/secrets │
│ 2. Generate stable tokens │
│ 3. Encrypted mapping store │
│ 4. Audit / policy controls │
└──────────────┬───────────────┘
│
sanitized prompt
│
▼
Public LLM API
OpenAI / Anthropic / Gemini
│
response
▼
Privacy Vault
│
detokenize response
▼
Your app
I would not make simple redaction your default:
John Smith owes $500→[PERSON] owes $500A better vault does:
John Smith owes $500→Marcus Hale owes $500and remembers:
Marcus Hale → John Smith
The synthetic identity preserves relationships and makes the prompt much more useful to the LLM. Recent research specifically finds surrogate substitution can preserve substantially more semantic utility than ordinary placeholder redaction.
For a serious implementation, I'd also make the entire conversation history use surrogates—not merely sanitize the latest message. Otherwise real PII can remain in the API-side conversation history and get retransmitted later.
If you tell me whether this is for a personal/local setup, an internal company service, or a production SaaS, I can recommend the best architecture and give you a concrete stack (e.g. Docker + Presidio + encrypted vault + OpenAI/Anthropic-compatible proxy).
To anonymize and protect sensitive data before it reaches public LLM endpoints (like OpenAI, Anthropic, or Google), you need a **sandwich-pattern privacy proxy or gateway** . This setup intercepts the prompt, detects and masks Personally Identifiable Information (PII) / sensitive tokens, sends the sanitized payload to…
To anonymize and protect sensitive data before it reaches public LLM endpoints (like OpenAI, Anthropic, or Google), you need a sandwich-pattern privacy proxy or gateway . This setup intercepts the prompt, detects and masks Personally Identifiable Information (PII) / sensitive tokens, sends the sanitized payload to the external LLM, and then reverses the process (de-anonymizes) on the incoming response stream before presenting it back to your application.
The leading tools, architectural approaches, and open-source stacks available to build or deploy a privacy vault for LLMs include:
A robust privacy vault doesn't just "erase" data (which often breaks the LLM's grammatical context or conversational logic); it pseudonymizes or tokenizes it.
- Your application sends the raw prompt to your local proxy/vault instead of the public LLM.
- The engine scans the text using NER models and custom rules.
- Sensitive entities (e.g., `Jane Doe` → `<PERSON_1>`, `Acme Corp` → `<ORG_1>` ) are swapped using a deterministic or session-locked lookup table stored securely inside your local boundary.[](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/introducing-pii-shield-a-privacy-proxy-for-every-llm-call/4514726) [[1]](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/introducing-pii-shield-a-privacy-proxy-for-every-llm-call/4514726)[[2]](https://www.youtube.com/watch?v=RfxnD00xxwo&t=760)[[3]](https://langfuse.com/resources/engineering/pii-masking-llm-applications)[[4]](https://www.youtube.com/watch?v=zpCX9bTb6fE&t=57)
- The public LLM receives clean, contextually sound text stripped of real-world secrets.[](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/introducing-pii-shield-a-privacy-proxy-for-every-llm-call/4514726) [[1]](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/introducing-pii-shield-a-privacy-proxy-for-every-llm-call/4514726)
- The LLM generates a response referencing `<PERSON_1>`.
- The privacy proxy intercepts the response, matches the session identifiers, swaps the placeholders back to `Jane Doe` , and streams the clean output to your user.[](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/introducing-pii-shield-a-privacy-proxy-for-every-llm-call/4514726) [[1]](https://techcommunity.microsoft.com/blog/azuredevcommunityblog/introducing-pii-shield-a-privacy-proxy-for-every-llm-call/4514726)[[2]](https://www.reddit.com/r/LLMDevs/comments/1sm61t9/i_built_an_opensource_token_proxy_that/)
3. Key Design Choices to Consider
Jane Doe always maps to the same placeholder (<PERSON_1> ) throughout that specific chat thread.0.0.0.0 ) can destroy logic if you are asking the LLM to debug server logs or analyze security events. Advanced implementations use context-aware or subnet-preserving pseudonymization.If you'd like to narrow this down, let me know: