UNPKG

@nationaldesignstudio/rampart

Version:

Rampart — client-side PII redaction for AI assistants: deterministic recognizers + a 14.7 MB ONNX classifier (transformers.js), default-deny policy, and reversible placeholders. Runs entirely in the browser.

12 lines (8 loc) • 325 B
import { createGuard } from "../index.ts"; const guard = await createGuard(); const safe = await guard.protect("My name is Alex Rivera. My SSN is 472-81-0094."); const reply = await llm(safe.text); console.log(guard.reveal(reply)); async function llm(text: string): Promise<string> { return "Got it, [GIVEN_NAME_1]."; }