Strip emails, SSNs, and credit cards before they hit OpenAI. One npm install. Zero dependencies. <1ms per call.
You're shipping AI features, but your team is nervous. "What if a user's SSN or email gets logged by OpenAI? What about SOC 2? What about HIPAA?" You can't send sensitive user data to third-party APIs, but you can't not ship AI.
RedactPII is a zero-dependency, blazing-fast regex-based library that finds and strips sensitive data before it ever leaves your server.
No setup required - just install and use
// 1. Install
import { Redactor } from '@redactpii/node';
// 2. Redact
const redactor = new Redactor();
const clean = redactor.redact(
'Hi David Johnson, call 555-555-5555'
);
// Result: "Hi PERSON_NAME, call PHONE_NUMBER"Detects emails, SSNs, credit cards, phone numbers, and names using optimized regex patterns. Works completely offline.
Built for production. <1ms per operation and zero external dependencies. Pure, modern TypeScript.
Enable or disable specific patterns, add custom regex rules, configure replacements, and enable anonymization mode.
Protect data before it hits OpenAI, Anthropic, or LangChain. Copy-paste examples to secure your LLM features in minutes.
Built-in regex patterns for common PII types
Person identification (greeting-based detection)
Email addresses
US phone numbers (all formats)
Visa, Mastercard, Amex, Diners Club
US Social Security Numbers
Install the free module and get your first redaction running in 60 seconds.