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