techlist.io

Pii Detection

2 posts

Cloudflare2026-05-283 min readCurated summary

How we built Cloudflare's data platform and an AI agent on top of it

Cloudflare built Town Lake to unify data scattered across production databases, analytics systems, streams, and object storage behind one governed SQL interface. The platform combines Trino, Iceberg on R2, DataHub, and custom access-control and PII-detection services to make data fresher, more discoverable, and safer to use. Skipper extends Town Lake with a natural-language AI interface intended to provide fast, accurate, and auditable answers without requiring users to write SQL. ## The Data Sprawl Problem - Cloudflare processes over a billion events per second across a network spanning more than 330 cities and 120 countries. - Relevant data was distributed across: - Postgres - ClickHouse - BigQuery - Kafka - Google Cloud Storage and R2 - Numerous pipelines and production databases - Users needed separate credentials, query languages, retention expectations, and system knowledge for each source. - Sampled analytics data worked for dashboards but was unsuitable for billing, usage calculations, and security investigations. - External vendors created cost and dependency concerns. - Important data was difficult to discover because table locations, schemas, joins, and customer-ID mappings depended on tribal knowledge. - Data infrastructure had historically been treated as a back-office service rather than core company infrastructure. ## Goals for the New Platform Cloudflare wanted a single place where authorized employees could answer questions about customers, traffic, billing, security events, and support activity. - Support both: - Fresh, accurate, unsampled data for billing and investigations - Fast, downsampled data for dashboards and exploration - Provide built-in governance: - Automatic PII detection - Sensitive tables locked down by default - Auditable access - Time-limited permission grants - Build the system using Cloudflare’s own products, including R2, Workers, Access, and Workflows. - Eventually let employees ask questions in plain English rather than requiring SQL knowledge. - That natural-language interface became Skipper. ## Town Lake’s Lakehouse Architecture Town Lake is a lakehouse: a query engine combines data from object storage and operational systems while a metadata layer makes the data behave like a unified database. - **Trino** serves as the query engine. - A single query can join Postgres, ClickHouse, and Iceberg tables stored on R2. - Trino pushes filters into source systems and combines results without requiring intermediate materialization. - **R2 Data Catalog and Apache Iceberg** store warm and cold data. - Iceberg provides schema evolution, time travel, partition evolution, and compaction. - Data can be rolled from per-minute to hourly and eventually daily granularity as it ages. - Older data becomes cheaper to store while remaining queryable. - Parquet files on R2 cost less than retaining equivalent data in an OLAP database. - **DataHub** provides the metadata catalog. - It stores table and column descriptions, owners, lineage, and glossary terms. - Users can discover what a table contains, which teams maintain it, and how it relates to upstream and downstream data. ## Access Control and Privacy - **Lifeguard** manages access policies. - Rules are stored in D1. - User and group memberships are retrieved dynamically from Cloudflare’s internal access-management system. - Lifeguard produces JSON policies that Trino reads over HTTP. - It also supplies access information to Skipper and the Gateway, allowing users to be blocked before queries execute. - **Skimmer** continuously scans tables for PII. - It samples rows from columns across the data platform. - Workers AI classifies whether columns contain personally identifiable information. Cloudflare’s overall approach is to combine unified querying, durable low-cost storage, rich metadata, and policy enforcement so data can be broadly useful without sacrificing accuracy or governance.

OpenAI2026-04-213 min readCurated summary

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.