logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·30.10.26
← Back to news

Rampart: Browser native on-device PII radaction

Original article
ndstudio.gov|42 points|14 comments|by nateb2022|Oct 9, 2026

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 never leaves the local device\text{never leaves the local device}never leaves the local device.

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:

  1. Deterministic Layer: Uses regular expressions (regex) to catch structured data like Social Security Numbers (SSNs) and various ID formats.
  2. ML Layer: Employs MiniLM to 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 zero-day vulnerabilities\text{zero-day vulnerabilities}zero-day vulnerabilities and insider threats.
  • The "Bloat" Problem: Many PII models are massive. For instance, the OpenAI Privacy Filter is ≈2.8GB\approx 2.8\text{GB}≈2.8GB. On a 10mbps10\text{mbps}10mbps connection, that is a ∼38-minute\sim 38\text{-minute}∼38-minute 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): 14.7MB14.7\text{MB}14.7MB
  • P50 Runtime Latency (WebGPU): 3.9ms3.9\text{ms}3.9ms
  • Private-term Recall (7 languages): 98.4%98.4\%98.4%

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."

Rampart Redaction Example


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.

SystemMethodSizeRecall (%\%%)
RampartDeterministic + Model14.7MB14.7\text{MB}14.7MB98.42%98.42\%98.42%
OpenAI Privacy FilterModel∼2.8GB\sim 2.8\text{GB}∼2.8GB97.4%97.4\%97.4%
GLiNER small v2.1Model∼600MB\sim 600\text{MB}∼600MB94.2%94.2\%94.2%
Community BERT-smallModel∼29MB\sim 29\text{MB}∼29MB81.5%81.5\%81.5%
Microsoft PresidioDeterministic + Model∼13MB\sim 13\text{MB}∼13MB65%65\%65%
AWS Bedrock GuardrailsCloud ModelN/A63.8%63.8\%63.8%

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