Introducing OpenAI Privacy Filter
# OpenAI Privacy Filter: An Open-Weight Model for Context-Aware PII Redaction OpenAI has released Privacy Filter, a small open-weight model for detecting and redacting personally identifiable information in unstructured text. Unlike traditional rule-based tools that rely on patterns like phone number formats, it uses language understanding to judge context, so it can separate public information from private information about individuals. Because it is small enough to run locally, text can be redacted without ever leaving the user's machine. The model is released under Apache 2.0 on Hugging Face and GitHub as a preview, and OpenAI positions it as one component of a privacy-by-design system rather than a complete anonymization or compliance solution. ## Why Rule-Based PII Detection Falls Short - Deterministic rules handle narrow formats such as emails and phone numbers well - They often miss subtler personal information and cannot reason about context - Privacy Filter aims to close this gap with a model that combines language understanding and a privacy-specific labeling scheme ## Model Architecture - It is a bidirectional token classifier with span decoding, adapted from an autoregressive pretrained checkpoint by replacing the language modeling head with a token-classification head - All tokens are labeled in a single forward pass, rather than generated token by token - A constrained Viterbi procedure decodes the token labels into coherent spans - It supports up to 128,000 tokens of context - The released model has 1.5B total parameters, with 50M active parameters - Recall and precision can be tuned by adjusting operating points for a given workflow - Spans use BIOES tags, which produce cleaner masking boundaries ## Label Taxonomy The model predicts spans across eight categories: - **private_person**, **private_address**, **private_email**, **private_phone**, **private_url**, and **private_date** cover personal identifiers and contact details - **account_number** covers credit cards, bank accounts, and similar financial identifiers - **secret** covers passwords and API keys ## Training Approach - Stage one defined a privacy taxonomy of the span types to detect - Stage two converted the pretrained language model into a token classifier using a supervised objective - Stage three trained on a mix of public and synthetic data, using model-assisted annotation to fill gaps where public labels were incomplete - Synthetic examples were generated to broaden coverage of formats, contexts, and privacy subtypes ## Benchmark Results - On PII-Masking-300k, the model achieves an F1 score of 96% (94.04% precision, 98.04% recall) - After correcting annotation issues found during review, the F1 score is 97.43% (96.79% precision, 98.08% recall) - Fine-tuning on a small amount of domain data raised F1 from 54% to 96% on a domain-adaptation benchmark - Additional evaluations cover long documents, ambiguous references, mixed-format strings, secret detection in codebases, and multilingual or adversarial examples ## Limitations - Behavior depends on the label taxonomy and decision boundaries it was trained on, so organizations may need in-domain evaluation or fine-tuning - Performance may vary across languages, scripts, naming conventions, and domains - It can miss uncommon identifiers or ambiguous references, and may over- or under-redact when context is limited - High-sensitivity domains such as legal, medical, and financial workflows still require human review ## Conclusion For teams building AI pipelines, Privacy Filter is worth evaluating as a local preprocessing step before data reaches training, indexing, logging, or review systems. Because it can be fine-tuned and runs on-device, it fits workflows where sensitive text should not be sent to a third-party server. It should be validated against the organization's own data and policies before being relied on in high-stakes settings.