Flare Redact โ€“ scoped secret redaction for JavaScript AI agents Flare Redact, a new open-source JavaScript library, provides scoped secret and PII redaction for AI agents, detecting and masking sensitive data in logs, prompts, and text across 24 languages with zero runtime dependencies. The library, available via npm as flare-redact 1.0, offers context-aware detection, secure vaults, and middleware for wrapping any SDK, including LLM clients, to strip secrets from prompts before they reach models. It aims to prevent data leaks from logging and AI interactions, supporting Node 20+, browsers, and edge runtimes. Hide secrets & PII in logs, prompts, and text โ€” before they leak. ๐ŸŒ International by default โ€” 24 languages ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡จ๐Ÿ‡ณ ๐Ÿ‡ฎ๐Ÿ‡ณ ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡ธ๐Ÿ‡ฆ ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ท๐Ÿ‡บ ๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ฐ๐Ÿ‡ท ๐Ÿ‡น๐Ÿ‡ท ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ‡ฎ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡บ๐Ÿ‡ฆ ๐Ÿ‡ณ๐Ÿ‡ฑ ๐Ÿ‡ป๐Ÿ‡ณ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡น๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ท ๐Ÿ‡ฎ๐Ÿ‡ฑ ๐Ÿ‡ฆ๐Ÿ‡ฟ ๐Ÿ‡ท๐Ÿ‡ด Live playground https://flare-collection.github.io/flare-redact/ ยท Practical redaction guides https://flare-collection.github.io/flare-redact/guides/ ยท LLM-friendly API reference https://flare-collection.github.io/flare-redact/llms-full.txt Every leaked secret has the same origin story: someone logged an object, and a password, token, or API key was sitting inside it. The code looked innocent โ€” logger.info { user } โ€” but user carried a session token, and now it's in your log aggregator, your error tracker, and three vendors' systems forever. flare-redact is one function you wrap around that data. It reads the content , not just the field names, so it catches the AWS key someone pasted into a free-text note , the JWT in an Authorization header, the card number in a stack trace โ€” and masks them, keeping just enough of a hint to stay debuggable. js import { redact } from 'flare-redact'; redact 'User alice@corp.com paid with 4242 4242 4242 4242, token ghp ' + 'a'.repeat 36 ; // โ†’ 'User a @ paid with 4242, token ghp ' Nothing to configure. No list of field paths to maintain. No native build step. The same problem now has a new address: your LLM calls.Wrap your OpenAI or Anthropic client and detected secrets are stripped from prompts and restored in the reply โ€” the model never sees those original values, while references survive. Jump to it โ†“ ๐Ÿ” Context-aware โ€” spans carry risk and confidence | ๐Ÿ” Secure vaults โ€” opaque tokens, optional AES-GCM persistence | ๐ŸŽญ Useful test data โ€” keyed pseudonyms and typed surrogates | ๐Ÿค– Scoped LLM + tool boundaries โ€” stops cross-tool placeholder restore | ๐Ÿ”Œ Universal middleware โ€” wrap any SDK, handler, queue, or RPC function | ๐Ÿชถ Zero runtime dependencies โ€” Node, browser, and edge | Install install Practical guides https://flare-collection.github.io/flare-redact/guides/ Runnable examples runnable-examples Redact anything redact-anything Integrate any SDK or framework integrate-any-sdk-or-framework Redact prompts before they reach an LLM redact-prompts-before-they-reach-an-llm Ways to hide a value ways-to-hide-a-value Reversible redaction reversible-redaction Contextual and model-assisted PII contextual-and-model-assisted-pii Learned confidence, fewer false positives learned-confidence-fewer-false-positives Build a private chat app build-a-private-chat-app Protect tool calls and MCP loops protect-tool-calls-and-mcp-loops Your own words your-own-words See what leaks, and why see-what-leaks-and-why Guard your logger in one line guard-your-logger-in-one-line One policy, everywhere one-policy-everywhere Anonymize a dataset for staging anonymize-a-dataset-for-staging Guard what leaves your app guard-what-leaves-your-app Streams streams Fail a build when a secret sneaks in fail-a-build-when-a-secret-sneaks-in CLI cli What it catches what-it-catches Multilingual secret vocabulary and IDs multilingual-secret-vocabulary-and-ids Custom detectors & allowlists custom-detectors--allowlists API api Security boundaries security-boundaries Why not a field allowlist? why-not-a-field-allowlist npm install flare-redact Node 20+, and it runs in the browser and edge runtimes too โ€” zero dependencies. Upgrading from 0.9.x ? Read the 1.0 migration guide /flare-collection/flare-redact/blob/main/MIGRATION.md . Existing projects are not forced across the major version; upgrade explicitly with npm install flare-redact@^1.0.0 .The core is plain ESM with no Node built-ins, is tree-shakeable sideEffects: false , and uses the standard Web Crypto API โ€” so redact , scan , vaults, and the LLM helpers work unchanged in React, Vue, and edge functions. CI smoke-tests the core on Bun and Deno on every push. js import { redact } from 'flare-redact'; function SupportTicket { text } { // Mask pasted keys and card numbers before the ticket is rendered or sent on. return