flare-redact

Redact secrets & PII before they leak

A zero-dependency JavaScript & TypeScript library that masks API keys, tokens, credit cards, emails and national IDs in logs, LLM prompts, HTTP and datasets — reversibly, in 24 languages.

npm i flare-redact GitHub ★ npm
0 dependencies 24 languages reversible ReDoS-safe Node · browser · edge
Live playground

Paste anything — watch the secrets disappear

mode

Input

Redacted


          
Why flare-redact

One redaction layer for everywhere

🔍 Content-aware

Reads the values, not just field names — it catches the key pasted into a free-text note or a stack trace.

♻️ Reversible

A vault swaps secrets for placeholders and restores them — send a redacted prompt to an LLM, then restore the reply.

🤖 LLM-safe

wrapOpenAI, wrapAnthropic, and createSession keep private data out of your model calls.

🌍 24 languages

Password/secret/token keywords in 24 languages, plus checksum-validated national IDs and IBAN.

🧩 Everywhere

pino, winston, HTTP middleware, streams, CSV datasets, a fetch egress guard — one policy across them all.

🛡️ ReDoS-safe · 0 deps

Bounded, linear-time patterns you can point at untrusted input. Nothing to install, runs anywhere JS runs.