Flare Redact
БесплатноПоддерживаетсяKeep secrets and PII out of logs, Sentry, LLM prompts and commits. Reads values, not field names. Zero dependencies.
Описание
Keep secrets and PII out of logs, Sentry, LLM prompts and commits. Reads values, not field names. Zero dependencies.
README
flare-redact
Keep secrets and personal data out of your logs, Sentry, LLM prompts and commits.
It reads the values, not the field names. Zero dependencies.
Playground · Guide · API · Recipes · Docs for AI assistants
Someone logs an object, a session token was inside it, and now that token sits
in your log aggregator, your error tracker and an LLM provider's servers.
Redaction by field name only hides the fields you remembered to list.
flare-redact looks at the values themselves, so the AWS key pasted into a
note field and the card number inside a stack trace are masked too.
import { redact } from 'flare-redact';
redact('User [email protected] paid with 4242 4242 4242 4242, token ghp_' + 'a'.repeat(36));
// → 'User a***@*** paid with **** **** **** 4242, token ghp_***'
redact({ user: '[email protected]', password: 'hunter2', note: 'my key is AKIAIOSFODNN7EXAMPLE' });
// → { user: 'b***@***', password: '***', note: 'my key is AKIA***' }
Highlights
- 🔍 Reads content, not field names. 129 detectors for API keys, tokens, JWTs, private keys, cards, IBANs, emails and national IDs, checksum-validated wherever a checksum exists.
- ⚡ No code change needed.
node --import flare-redact/register app.jsredacts everyconsole.*call. - 🤖 Private LLM calls. Wrap the OpenAI or Anthropic client, or add one middleware to the Vercel AI SDK for every provider: the model sees placeholders, your app gets the real values back, streaming included.
- 🔌 Fits what you already run. pino, winston, Sentry, Express,
fetch, streams, and any SDK through one middleware. - 🚫 Stops leaks before the commit. A pre-commit hook that scans only the lines you add, and a CI scan with SARIF output.
- 🌍 International by default: 24 languages of secret vocabulary and national ID formats.
- 🪶 Zero dependencies. Node 20+, browsers, edge runtimes, Bun and Deno.
- 🐍 Python, Go and Rust engines that run the same detector spec and pass the same conformance suite.
🇬🇧 🇨🇳 🇮🇳 🇪🇸 🇸🇦 🇫🇷 🇵🇹 🇷🇺 🇯🇵 🇩🇪 🇰🇷 🇹🇷 🇮🇹 🇮🇷 🇵🇱 🇺🇦 🇳🇱 🇻🇳 🇮🇩 🇹🇭 🇬🇷 🇮🇱 🇦🇿 🇷🇴
Quick start
npm install flare-redact
Then pick the way that suits you:
# No code change: every console.* call is redacted
node --import flare-redact/register app.js
# Let it read your package.json and print the lines to paste
npx flare-redact init # openai, @anthropic-ai/sdk, ai, Sentry, pino, winston, express
npx flare-redact init --hook # also stop any commit that adds a secret
npx flare-redact init --ci # also scan every pull request
Want more than the defaults? Choose a goal instead of a detector list:
{ preset: 'logs' }, 'llm', 'gdpr' or 'strict' (what each adds).
Where it plugs in
Logs
import pino from 'pino';
import { pinoRedact } from 'flare-redact/pino';
const log = pino(pinoRedact());
log.info({ user: '[email protected]', token: 'ghp_…' }, 'login');
// {"user":"b***@***","token":"***","msg":"login", …}
winston has winstonRedact() from flare-redact/winston, and plain console
has wrapConsole() or the --import flag above.
LLM prompts
import OpenAI from 'openai';
import { wrapOpenAI } from 'flare-redact/llm';
const openai = wrapOpenAI(new OpenAI());
your app sends → Email the invoice to [email protected], card 4242 4242 4242 4242
the model sees → Email the invoice to [FR_EMAIL_7f2a…], card [FR_CREDIT_CARD_19be…]
your app gets → Sent to [email protected]. Card 4242 4242 4242 4242 wasn't stored.
wrapAnthropic does the same for Claude. On the Vercel AI SDK, one middleware
covers every provider: wrapLanguageModel({ model, middleware: flareRedactMiddleware() })
from flare-redact/ai-sdk (details).
Tool calls, MCP messages and agent tool boundaries are covered too: see
the guide.
Sentry
import * as Sentry from '@sentry/node';
import { sentryRedact } from 'flare-redact/sentry';
Sentry.init({ dsn: process.env.SENTRY_DSN, ...sentryRedact({ preset: 'gdpr' }) });
Events, spans, logs and breadcrumbs are redacted in your process, before they leave it. Sentry's own ids, release and stack frames stay intact, so grouping and source maps keep working. Details and limits.
Commits and CI
On GitHub, uses: flare-collection/flare-redact@v1 annotates each finding on the pull request (inputs).
npx flare-redact init --hook # pre-commit: scans only the lines being added
npx flare-redact --scan . --sarif # CI: exits 1 on a finding, never prints the secret
Using pre-commit? Add repo: https://github.com/flare-collection/flare-redact with id: flare-redact (setup).
No Node in the stack?
Point any service at the sidecar gateway and it redacts request bodies on the way to OpenAI or Anthropic, with no code change. Or use the Python, Go and Rust engines:
from flare_redact import create_session
session = create_session(enable=["pii"])
safe = session.redact("Email the invoice to [email protected]")
How it compares
| Tool | What it does well | What flare-redact adds |
|---|---|---|
Logger path redaction (pino redact, fast-redact) |
Fast masking of the fields you list | Finds secrets in fields you never listed and inside free text |
| Sentry server-side scrubbing | Scrubs sensitive-looking fields once events reach Sentry | Redacts in your process, before the event leaves it |
| gitleaks, TruffleHog | Find secrets in git history and files | Masks secrets at runtime in logs, errors and prompts. Use both |
| Microsoft Presidio | Model-based PII detection in prose, as a Python service | Runs in-process with no model and no dependencies; plug a model in with semanticProvider when you need that recall |
FAQ
How do I hide API keys and passwords in Node.js logs?
Start the app with node --import flare-redact/register app.js, or add
pinoRedact() or winstonRedact() to your logger. Nothing else to configure.
How do I keep customer data out of OpenAI or Claude API calls?
Wrap the client with wrapOpenAI or wrapAnthropic, or on the Vercel AI SDK
add flareRedactMiddleware() to the model. Sensitive values become
placeholders before the request is sent and are restored in the reply.
Will it slow my app down?
It runs in your process with no model and no network call, and its patterns are
bounded and tested against hostile input. npm run benchmark measures it on
your own runtime.
Does it catch everything? No tool does. Detection is best-effort, and names in prose are found by rules, not a trained model. Read the security boundaries before relying on it for compliance.
For AI coding assistants
The docs site serves llms.txt
and llms-full.txt.
Add one line to your AGENTS.md, CLAUDE.md or .cursor/rules so generated
code uses the library instead of ad-hoc regexes:
For masking secrets or PII in logs, prompts or datasets, use the flare-redact
package (API: https://flare-collection.github.io/flare-redact/llms-full.txt).
Documentation
- Guide: every feature, option and integration, with examples
- What it catches: the full detector list
- API reference and CLI
- Recipes and runnable examples
- Changelog, migrating from 0.9, security policy
Contributing
Bug reports, new detectors and fixes are welcome: see CONTRIBUTING.md. Found a leak that flare-redact missed? Please report it privately through SECURITY.md.
If flare-redact kept a secret out of your logs, a ⭐ helps other people find it.
License
MIT © Umud Hasanli
Установить Flare Redact в Claude Desktop, Claude Code, Cursor
unyly install flare-redactСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add flare-redact --env FLARE_REDACT_SECRET="" --env FLARE_REDACT_VAULT_PASSWORD="" -- npx -y flare-redactПошаговые гайды: как установить Flare Redact
FAQ
Flare Redact MCP бесплатный?
Да, Flare Redact MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Flare Redact?
Да, требуются переменные окружения: FLARE_REDACT_SECRET, FLARE_REDACT_VAULT_PASSWORD. Unyly подставит их в конфиг при установке.
Flare Redact — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Flare Redact в Claude Desktop, Claude Code или Cursor?
Открой Flare Redact на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Изменения
Версии и запрашиваемые доступы со временем.
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
- Новая версия опубликована
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectServer Sequential Thinking
MCP server for sequential thinking and problem solving
автор: GitHub ActionsUnyly Deploy
Deploy sites and MCP servers to Unyly straight from your AI agent
автор: UnylyAmap Maps Mcp Server
MCP server for using the AMap Maps API
автор: duxiaohuiPayMCP
Lightweight payments layer for MCP servers: turn tools into paid endpoints with a two-line decorator. [PyPI](https://pypi.org/project/paymcp/) · [npm](https://w
автор: blustAIServer For Power BI
Enables exploring Microsoft Fabric / Power BI workspaces and semantic models, and executing ad-hoc DAX queries.
автор: Mitsubishi-FusoGpt Image 2 Mcp
RunAPI GPT Image 2 MCP server for image generation: create tasks, poll results, and check pricing across 1 model from Claude Code, Codex, Cursor, and VS Code.
автор: runapi-aiCompare Flare Redact with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
