The Research Report
OpenAI Just Made Privacy a Preprocessing Step
A 1.5B-parameter model that scrubs your secrets in-browser before any cloud API ever sees them
Every day, millions of people paste things into ChatGPT they probably should not. Tax returns. Medical records. Work emails with client names. The API key they swore they would rotate next week. The data leaves the machine before anyone thinks twice.
OpenAI just released a tool that changes that equation. It is called Privacy Filter, and it runs locally. On your laptop. In your browser. Before a single token reaches the cloud.
Here is why that matters, how it works, and what it means for anyone building with AI.
What Privacy Filter Does
Privacy Filter is a bidirectional token-classification model that detects and masks personally identifiable information in text. Feed it a block of text. It hands back the same text with sensitive bits swapped for generic placeholders like [PRIVATEPERSON], [PRIVATEEMAIL], or [ACCOUNT_NUMBER].
OpenAI provides a clear example. Paste in this email:
"Thanks again for meeting earlier today. For reference, the project file is listed under 4829-1037-5581. If anything changes on your side, feel free to reply here at [email protected] or call me at +1 (415) 555-0124."
Privacy Filter returns:
"Thanks again for meeting earlier today. For reference, the project file is listed under [ACCOUNTNUMBER]. If anything changes on your side, feel free to reply here at [PRIVATEEMAIL] or call me at [PRIVATE_PHONE]."
The original data never leaves your machine. The scrubbed version is all that travels downstream.
Eight Categories of Detection
The model identifies spans across eight privacy categories:
- private_person — real names of private individuals
- private_address — home or personal addresses
- private_email — personal email addresses
- private_phone — phone numbers tied to individuals
- private_url — URLs containing PII
- private_date — dates that could identify individuals
- account_number — credit card numbers, bank accounts, routing numbers
- secret — passwords, API keys, tokens
These labels are decoded with BIOES span tags (Begin, Inside, Outside, End, Single). This produces cleaner masking boundaries than simple per-token classification. The model does not just flag individual tokens. It identifies coherent spans.
How It Works: Architecture That Prioritizes Speed
Privacy Filter is not a generative model. It does not produce text token by token. Instead, it labels every token in an input sequence in a single forward pass, then decodes coherent spans using a constrained Viterbi procedure.
The architecture breaks down like this:
- Base: A pretrained autoregressive checkpoint, similar to gpt-oss architecture, converted into a bidirectional token classifier
- Parameters: 1.5B total, but only 50M active parameters per token due to mixture-of-experts routing
- Attention: Grouped-query attention with rotary positional embeddings. 14 query heads, 2 KV heads (group size of 7)
- Feed-forward: Sparse mixture-of-experts with 128 experts, top-4 routing per token
- Context window: 128,000 tokens. No chunking required for long documents
- Model dimension: d_model = 640
- Output: 33 token-level classes (1 background + 8 categories × 4 BIOES tags each)
The banded attention mechanism uses a band size of 128, giving an effective attention window of 257 tokens including self. This enables efficient long-context processing without the quadratic cost of full attention.
At inference time, the model produces per-token logits that feed into a constrained Viterbi decoder. This decoder enforces allowed BIOES boundary transitions and scores complete label paths with start, transition, and end terms. Six transition-bias parameters control background persistence, span entry, span continuation, span closure, and boundary-to-boundary handoff.
Why Constrained Decoding Matters
Independent argmax per token produces fragmented boundaries. A phone number like "+1 (415) 555-0124" might get split across inconsistent labels. The Viterbi decoder solves this by making each token decision depend on sequence-level structure. The result is cleaner, more coherent spans.
Configurable Operating Points
Developers can tune the transition-bias parameters at runtime. Crank up span entry and continuation biases for higher recall (catch more, risk over-redaction). Dial them back for higher precision (fewer false positives, risk missing edge cases). This is not a fixed black box. It is a dial you can turn.
The Local-First Advantage
The entire point of Privacy Filter is that it runs locally. Your raw text never needs to travel to a server for de-identification.
This matters because the current alternative is broken. Most companies that need PII scrubbing send raw data to a cloud service that promises to be secure. Then they trust that promise. That arrangement does not always age well.
With Privacy Filter:
- Small businesses can use AI to summarize customer emails without handing customer names to a third party
- Freelance lawyers can feed case notes into a chatbot without leaking client identity
- Doctors can draft patient referrals without exposing patient data
- Developers can debug code with AI without pasting their API keys straight into the prompt
- Regular people can ask ChatGPT to rewrite an angry email to their landlord without sharing their home address
The data gets sanitized on your device. Only the scrubbed version goes anywhere else.
Running In-Browser via WebGPU
This is where it gets interesting for builders. Privacy Filter ships with Transformers.js support. That means it runs directly in the browser using WebGPU acceleration. No server. No backend. No deployment.
import { pipeline } from "@huggingface/transformers";
const classifier = await pipeline(
"token-classification",
"openai/privacy-filter",
{ device: "webgpu", dtype: "q4" }
);
const input = "My name is Harry Potter and my email is [email protected].";
const output = await classifier(input, { aggregation_strategy: "simple" });
console.dir(output, { depth: null });
Output:
[
{
entity_group: "private_person",
score: 0.9999957978725433,
word: " Harry Potter"
},
{
entity_group: "private_email",
score: 0.9999990728166368,
word: " [email protected]"
}
]
WebGPU gives the model GPU-level compute directly in the browser. The q4 quantization keeps the model small enough to load quickly. The result is a privacy layer that runs entirely client-side, with no installation, no backend, and no data leaving the browser.
This changes the architecture of privacy-aware applications. Instead of trusting a cloud service to scrub data, you can build scrubbing into the client. The user's text gets processed locally. Only sanitized output hits your API.
Performance
OpenAI reports that Privacy Filter achieves 96% F1 on the PII-Masking-300k benchmark out of the box. A corrected version of the same evaluation pushes it to 97.43%. The correction addresses annotation issues OpenAI identified during their own evaluation.
For context, pattern-matching approaches typically struggle with anything context-dependent. Is "Annie" a private name or a brand? Is "123 Main Street" a person's home or a business address on a storefront? Regex cannot tell. Privacy Filter can, because it reads the sentence around the entity.
Why This Matters for Prompt Pipeline Design
Privacy Filter adds a new preprocessing layer to system prompt design. Here is what that looks like in practice.
The Old Pipeline
User input → Cloud API → Response
PII travels with the prompt. You hope the API provider handles it responsibly. You hope your logs do not leak. You hope nobody on the other end reads your debug traces.
The New Pipeline
User input → Privacy Filter (local) → Sanitized prompt → Cloud API → Response
PII gets stripped before the prompt ever leaves the machine. The cloud API never sees the original names, addresses, or secrets. If you need the original data back for display, you can maintain a local mapping table that restores PII after the response arrives.
Practical Integration Patterns
Browser extension. Intercept text before it reaches ChatGPT, Claude, or Gemini. Run Privacy Filter in-browser via WebGPU. Replace sensitive spans with placeholders. Send the sanitized version.
API proxy. Build a local proxy that sits between your application and the LLM API. Every request passes through Privacy Filter first. No code changes required in the application layer.
Preprocessing in data pipelines. Before indexing documents for RAG, before logging user interactions, before training on user data. Run Privacy Filter as a preprocessing step. This reduces the blast radius of any downstream data breach.
Fine-tuning for domain-specific PII. The model is fine-tunable. If your domain has unusual PII patterns (medical record formats, legal case identifiers, financial instrument codes), you can adapt the model to your data distribution. OpenAI designed it for this.
What It Is Not
OpenAI was direct about the limits. Privacy Filter "is not an anonymization tool, a compliance certification, or a substitute for policy review."
96% accuracy is not 100% accuracy. The model can miss unusual identifiers. It can over-redact short sentences. It performs unevenly across languages. It is one tool in a stack, not a compliance checkbox.
If you work in a hospital, law firm, or bank, do not use this as your only line of defense. Use it as the first line. Then add policy review, access controls, and audit trails behind it.
The Bigger Picture
OpenAI built Privacy Filter because it uses a fine-tuned version internally for its own privacy-preserving workflows. They are releasing the base model because they believe they can raise the standard for privacy beyond what already exists on the market.
The Apache 2.0 license means anyone can download it, use it, modify it, and sell products built on top of it. No legal gymnastics required.
The model lives on Hugging Face and GitHub. It weighs 1.5B parameters. It runs on a regular laptop. It runs in a browser. It processes 128,000 tokens of context in a single pass.
For years, the privacy conversation around AI has been about what happens to your data after you send it. Privacy Filter shifts the question to something more useful: what if you never have to send the sensitive parts at all?
OpenAI Privacy Filter is available now on Hugging Face under the Apache 2.0 license. The Transformers.js integration supports WebGPU inference with q4 quantization for in-browser deployment.