Rampart: Browser native on-device PII radaction
Recorded: Oct. 10, 2026, 4:01 p.m.
| Original | Summarized |
Introducing Rampart - National Design StudioSkip to contentNational Design Studio markNational Design StudioAboutNewsDev IndexJoin the MissionMenuCloseAboutNewsDev IndexJoin the MissionFollow on XDesigned in D.C. By National Design Studio‚Üê All postsJune 22,¬Ý2026Introducing RampartTai Groot & Edward Coristine3 min readTL;DRBuilt by National Design Studio, Rampart runs entirely in the browser, identifying and removing personal information before a message is sent. It combines deterministic rules and machine learning to deliver privacy protection in milliseconds.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 that never leaves your device.Today, we open source Rampart ‚Äî 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. Rampart is 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 RampartOften times, doing PII removal means either trusting a remote server or downloading binaries to the client, which present a few key challenges: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.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 worksEverything 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.7MBp50 runtime latency, in the browser (WebGPU)3.9msPrivate-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 deviceThe browser stores relevant PII temporarily on your device to fill in the blanksMy 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?Hi Maria, Here are affordable housing options in New York.The ElizaInwood, Manhattan | Affordable homesSendero VerdeEast Harlem, Manhattan | Affordable homesMessageOriginal: 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?BenchmarksWe trained Rampart on 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 MB98.42%OpenAI Privacy Filter‚Üó(opens in new tab)Model ¬∑ ~2.8 GB97.4%GLiNER small v2.1Model ¬∑ ~600 MB94.2%Community BERT-small PIIModel ¬∑ ~29 MB81.5%Microsoft PresidioDeterministic + model ¬∑ ~13 MB65%AWS Bedrock GuardrailsModel ¬∑ Cloud63.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)LimitationsRampart is 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 startedDownload 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.chat.ts‚Äãimport { createGuard } from "@nationaldesignstudio/rampart‚Äã"‚Äã;‚Äã‚Äã‚Äãconst guard = await createGuard‚Äã(‚Äã)‚Äã;‚Äã‚Äã‚Äãconst safe = await guard‚Äã.‚Äãprotect‚Äã(‚Äã "‚ÄãMy name is John Wick‚Äã. I live at 88 Cedar Lane‚Äã, Brookvale‚Äã, CT 06482‚Äã.‚Äã"‚Äã,‚Äã‚Äã)‚Äã;‚Äã‚Äã‚Äãconsole‚Äã.‚Äãlog‚Äã(‚Äãsafe‚Äã.‚Äãtext‚Äã)‚Äã;‚Äã‚Äã// "My name is [GIVEN_NAME_1]. I live at [BUILDING_NUMBER_1] [STREET_NAME_1], Brookvale, CT 06482."‚Äã‚Äã‚Äãconst reply = await llm‚Äã(‚Äãsafe‚Äã.‚Äãtext‚Äã)‚Äã;‚Äã‚Äãconsole‚Äã.‚Äãlog‚Äã(‚Äãguard‚Äã.‚Äãreveal‚Äã(‚Äãreply‚Äã)‚Äã)‚Äã;‚Äã‚Äã‚Äãasync function llm‚Äã(‚Äãtext: string‚Äã): Promise<string> {‚Äã return "‚ÄãThanks [GIVEN_NAME_1]‚Äã, Brookvale CT 06482 works for eligibility‚Äã.‚Äã"‚Äã;‚Äã‚Äã}‚Äã‚Äã// "Thanks John Wick, Brookvale CT 06482 works for eligibility."‚ÄãHuggingFace‚Üó(opens in new tab)NPM library‚Üó(opens in new tab)Whitepaper‚Üó(opens in new tab)Interested in contributing to this work? Join usFollow on XTai Groot @taigrr (opens in a new tab)Edward Coristine @as400495 (opens in a new tab)ND Studio @ndstudio (opens in a new tab)National Design StudioEisenhower Executive Office Building1650 17th St NW,Washington, DC 20006AboutNewsDev IndexJoinFollow on X (opens in a new tab)AccessibilityPrivacyGet updates fromNational Design StudioSubscribe ‚Üí |
Rampart is an on-device personal information filtering system developed by National Design Studio, designed to ensure that personal information is identified and removed from messages in real-time before transmission, operating entirely within the web browser. The foundational design principle of Rampart is that personal information should remain private by never leaving the user's device. This approach addresses the inherent vulnerability of transmitting sensitive data to remote servers, which introduces uncertainties regarding privacy and security when relying on third-party AI services. The motivation behind creating Rampart stemmed from the challenges associated with existing methods of Personally Identifiable Information (PII) removal. Traditional approaches often require trusting remote servers or downloading large models, which poses significant privacy and practical hurdles. Specifically, guarantees of privacy from large AI vendors are difficult to verify from first principles, as newly deployed models may inadvertently log sensitive user data, and services introduce unknown security risks. Furthermore, many PII removal models are excessively large, creating barriers for users with limited bandwidth, such as the OpenAI Privacy Filter requiring substantial download time and space. Rampart operates by executing the PII filtering process locally in the browser instantaneously, eliminating the need to send sensitive data externally. The system employs a dual mechanism combining deterministic rules and machine learning to achieve robust privacy protection in milliseconds. The deterministic layer utilizes regular expressions coupled with real-time validation to precisely identify structured information, including Social Security numbers, credit cards, phone numbers, email addresses, IP addresses, and government IDs. This layer provides a fast and predictable means of flagging information with inherent structure. Complementing this deterministic layer is a small language model, MiniLM, which provides contextual understanding. This model analyzes the sentence for entities such as names and street addresses, allowing it to infer the context and redact the information found within specific categories. This combination enables Rampart to handle complex, unstructured data by not only identifying exact patterns but also understanding the context of the surrounding text for more accurate redaction. For example, if a user inputs a sentence containing personal details, Rampart redacts the PII on-device, replacing the sensitive data with placeholders, ensuring that the raw, sensitive information never leaves the user's device. Performance benchmarks demonstrate Rampart's effectiveness when compared to other established PII removal pipelines, including the OpenAI Privacy Filter, GLiNER, Community BERT-small PII, Microsoft Presidio, and AWS Bedrock Guardrails. The system was trained on a large PII dataset and a synthetic generator to reinforce entity recognition across seven Latin-script languages, providing private-term recall across a test set of thirty thousand rows. These results indicate high accuracy, confirming the efficacy of the integrated deterministic and model approaches in protecting user data. Currently, Rampart is an alpha product aimed at establishing a strong first line of defense for managing PII in AI chat experiences. It supports multiple languages, including English, Spanish, French, German, Italian, Portuguese, and Dutch. The system is available for use through open-source resources, allowing users to download the model or utilize the provided library to implement the privacy protection in their applications. |