Rampart: Browser native on-device PII radaction
Rampart: Browser-Native, On-Device PII Redaction
By National Design Studio | June 22, 2026 Authored by Tai Groot and Edward Coristine
Executive Summary
Rampart, developed by the National Design Studio, is a privacy-first tool that operates entirely within the user's browser. It identifies and scrubs personally identifiable information (PII) before any data is transmitted to a remote server. By merging deterministic logic with machine learning, it achieves high-speed privacy protection in a matter of milliseconds.
The Privacy Dilemma
When interacting with modern AI chatbots, users often inadvertently leak sensitive data. Common examples include:
- Professional leaks: Including names of colleagues while asking for email edits.
- Financial leaks: Including account numbers or addresses when querying medical bills.
- Personal leaks: Revealing identity and location during emotional venting.
Once this data is sent, it resides on a remote server—an environment the user cannot inspect or control.
Core Design Principle: The only way to truly guarantee that personal information remains private is to ensure it .
To address this, we are open-sourcing Rampart, a first-generation filtering system designed to serve as a robust primary defense for local data privacy.
Architecture & Methodology
Rampart utilizes a dual-layer approach to identify sensitive data:
- Deterministic Layer: Uses regular expressions (regex) to catch structured data like Social Security Numbers (SSNs) and various ID formats.
- ML Layer: Employs
MiniLMto analyze context and identify unstructured PII, such as specific names and street addresses.
Why Local Redaction?
Traditional PII removal usually requires trusting a third-party server or installing heavy client-side binaries. This presents two major hurdles:
- The Trust Gap: It is fundamentally impossible to verify the security claims of AI vendors. New updates might accidentally enable logging, or systems may suffer from and insider threats.
- The "Bloat" Problem: Many PII models are massive. For instance, the OpenAI Privacy Filter is . On a connection, that is a download—unacceptable for a browser experience.
Technical Workflow
Rampart intercepts the message in the split second between the user typing and the message being sent.
Performance Metrics:
- Model Size (incl. tokenizer):
- P50 Runtime Latency (WebGPU):
- Private-term Recall (7 languages):
Practical Application
Consider a user typing a sensitive prompt. Instead of sending the raw text, Rampart transforms it locally.
Original Input:
My name is Maria Garcia, my Social Security number is 123-45-6789, and I make $1,950 a month.
Rampart Output:
"My name is [GIVEN_NAME] [SURNAME], my Social Security number is [SSN], and I make $1,950 a month."
Benchmarks
We validated Rampart using a synthetic generator and AI4Privacy’s OpenPII 1.5M dataset, focusing on 17 entity types within messy, chat-style inputs. The following data represents a 30,000-row held-out slice across seven Latin-script languages.
| System | Method | Size | Recall () |
|---|---|---|---|
| Rampart | Deterministic + Model | ||
| OpenAI Privacy Filter | Model | ||
| GLiNER small v2.1 | Model | ||
| Community BERT-small | Model | ||
| Microsoft Presidio | Deterministic + Model | ||
| AWS Bedrock Guardrails | Cloud Model | N/A |
Implementation & Limitations
Rampart is currently an alpha product. It is intended to be the first layer of a broader PII management strategy.
Supported Languages:
- English, Spanish, French, German, Italian, Portuguese, and Dutch.
Quick Start Code
You can integrate the guard into your TypeScript project as follows:
import { createGuard } from '@nationaldesignstudio/rampart';
const guard = await createGuard();
// The guard redacts PII locally before the LLM sees it
const safe = await guard.reveal(reply);
async function llm(text: string): Promise<string> {
return `Thanks [GIVEN_NAME_1], Brookvale CT 06482 works for eligibility.`;
}
// Input: "I live at 123 Main St, Brookvale, CT 06482."
// Result: "I live at [BUILDING_NUMBER_1] [STREET_NAME_1], Brookvale, CT 06482."
Next Steps
- Download the model via HuggingFace
- Install the NPM library
- Review the technical Whitepaper
- Join the National Design Studio (NDS) team
Connect with the creators:
- Tai Groot:
@taigrr - Edward Coristine:
@as400495 - ND Studio:
@ndstudio