Rampart: Browser native on-device PII radaction

Hacker News Top Tools

Summary

开源了 Rampart——一个浏览器原生的端侧 PII 过滤系统,结合正则规则与 MiniLM 小模型在数据离开设备前完成脱敏,模型仅 14.7MB、WebGPU 上 p50 延迟 3.9ms,七种语言的私有词召回率达 98.4%。

No content available
Original Article
View Cached Full Text

Cached at: 10/10/26, 03:32 PM

# Introducing Rampart Source: [https://ndstudio.gov/posts/say-hello-to-rampart](https://ndstudio.gov/posts/say-hello-to-rampart) When you type into a chatbot, you might reveal more about yourself than you intend\. A request to clean up an email carries your name and your coworker’s; a question about a medical bill carries your address and account number; a vented frustration carries who you are and where you live\. And whatever you type doesn’t stay with you — it travels to a remote server you have no way to inspect\. Our core design principle is that the only personal information you can be sure is private is the information thatnever leaves your device\. Today, we open sourceRampart— a first\-generation on\-device personal information filtering system that is a strong first line of defense in ensuring your personal information never leaves your device\.Rampartis a combination of a deterministic layer, based on regular expressions to catch SSNs and ID numbers, and MiniLM to catch names and street addresses\. ## Why we built Rampart Often times, doing PII removal means either trusting a remote server or downloading binaries to the client, which present a few key challenges: 1. 1\.AI privacy guarantees are almost impossible to verify\.From first principles, it is impossible to verify the privacy and security claims of AI vendors\. A newly deployed version of an AI runtime may accidentally begin logging sensitive user information, and services carry unknown internal security risks such as zero\-day vulnerabilities and insider threats\. 2. 2\.Most models for PII removal are gigantic, narrowing the group of users that can benefit from them\.For example, OpenAI Privacy Filter is ~2\.8GB, which would take approximately 38 minutes to download to a browser on a relatively poor connection \(10mbps\)\. ## How it works Everything happens in the browser, in the moment between typing a message and sending it; there is no server in the loop\. Model size, including tokenizer14\.7MB p50 runtime latency, in the browser \(WebGPU\)3\.9ms Private\-term recall, seven languages98\.4% Before the message goes anywhere, two readers look at it on your device\. The first is a set of rules\.Regular expressions paired with real validations handle the information that has structure: Social Security numbers, credit cards, phone numbers, routing and account numbers, emails, IP addresses, government IDs\. It is deterministic and fast\. The second is a small language model\.Rules can’t anticipate every name or street address, so MiniLM reads the sentence for the personal information with a deeper understanding of the context of the sentence, then redacts information it finds within a specific category\. For example, say you type a sentence full of personal information into chat: Rampart redacts PII on\-device so it doesn’t have to leave your device The browser stores relevant PII temporarily on your device to fill in the blanks My name is\[GIVEN\_NAME\]\[SURNAME\], my Social Security number is\[SSN\], and I make $1,950 a month\. Can you help me find affordable housing? Original:My name is Maria Garcia, my Social Security number is 123\-45\-6789, and I make $1,950 a month\. Can you help me find affordable housing? After redaction:My name is \[GIVEN\_NAME\] \[SURNAME\], my Social Security number is \[SSN\], and I make $1,950 a month\. Can you help me find affordable housing? ## Benchmarks We trainedRamparton AI4Privacy’s OpenPII 1\.5M dataset and a synthetic generator that reinforces all 17 entity types with deliberately messy chat\-style input\. The headline numbers below come from a 30,000\-row held\-out OpenPII slice spanning seven Latin\-script languages, scored end\-to\-end by the shipped pipeline\. RampartDeterministic \+ model·14\.7 MB 98\.42% GLiNER small v2\.1Model·~600 MB 94\.2% Community BERT\-small PIIModel·~29 MB 81\.5% Microsoft PresidioDeterministic \+ model·~13 MB 65% AWS Bedrock GuardrailsModel·Cloud 63\.8% Private\-term recall on a 30,000\-row held\-out OpenPII test set across seven supported languages\. Higher is better\.[Benchmark\(opens in new tab\)](https://inference.ndstudio.gov/rampart/whitepaper.pdf) ## Limitations Rampartis an alpha product intended to be the first line of defense in a more thorough effort to manage personally identifiable information for AI chat experiences\. It currently supports English, Spanish, French, German, Italian, Portuguese, and Dutch\. ## Get started Download the model on HuggingFace, install the NPM library, or read the whitepaper\. If the work of building elegant and useful tools for Americans speaks to you, consider joining NDS\.

Similar Articles

nationaldesignstudio/rampart

Hugging Face Models Trending

Rampart is a 14.7 MB ONNX token-classification model for client-side PII detection, designed to redact personal information before it leaves the user's device, supporting multiple languages and running via ONNX Runtime Web.

@vista8: An open-source browser project that bypasses all major anti-bot detection: CloakBrowser. It is said to bypass all major anti-bot measures, such as Cloudflare. Directly modified from Chromium C++ source code, it changes 57 fingerprinting details at compile time. As the saying goes, the measure is high, the devil is higher, hahaha. Github…

X AI KOLs Timeline

CloakBrowser is an open-source browser project directly modified from Chromium C++ source code, bypassing anti-bot measures like Cloudflare by changing 57 fingerprinting details at compile time.

Running RAG with a (small) language model in the browser

Lobsters Hottest

作者在博客中演示了如何完全在浏览器端运行 RAG:用静态嵌入检索段落,再通过 transformers.js 在 WebGPU/WASM 上运行小型模型(如 Qwen3-0.6B、SmolLM2-360M)生成两句话摘要,全程数据不出本地。文章还评估了这些小模型的忠实度局限。