Repository navigation
Releases
Releases · flare-collection/flare-redact
flare-redact v1.10.4
Security: password-only connection strings were not redacted (GHSA-h8xg-cv97-3pfp)
url_credentialsrequired a username before:password@, so a URL with an
empty username, the usual form for Redis and Valkey and also used by
RabbitMQ, Postgres and others, passed through in clear text:
redis://:SuperSecret123@localhost:6379now becomesredis://:***@localhost:6379.
Hosts that look like a domain were sometimes caught by the email detector,
butlocalhost, IP addresses and service names leaked in full.- In the JavaScript engine a password containing a colon was only partly
masked:postgres://user:pa:ss@dbbecamepostgres://user:pa:***@db. The
whole password is masked now, as the Python, Go and Rust engines already did. - The JavaScript, Python, Go and Rust engines change together, and the
conformance corpus has both cases. Reported by Pranshu Raghav
(@Zureno).
flare-redact v1.10.3
Fixed: an error keeps its cause
- Redacting an error dropped its
causeand anAggregateError'serrors,
because both are non-enumerable. A failedfetchlogged through
--import flare-redact/registershowed onlyTypeError: fetch failed, without
theECONNREFUSEDunderneath. Both are now kept, redacted and still
non-enumerable;scan()reports findings inside them (cause.message), and
FlareFlow checks a placeholder inside a cause before restoring it. - Python keeps an exception's
__cause__and__context__the same way.
flare-redact v1.10.2
Fixed: a value redacted from JSON text comes back escaped once
- Since 1.10.0 an original restored into JSON text is JSON-escaped. When the
redacted input was itself JSON text and the captured value held an escape,
such asp\"ssin{"url":"https://user:p\"ss@db.example.com/x"}, the
vault stored the escaped form and the restore escaped it a second time, so a
round trip added a backslash (#34). - A vault now stores a value captured from a string that is a JSON document in
decoded form, when it is valid JSON string content. Restored into JSON it is
escaped exactly once; restored into other text it reads as the value itself.
Anything else is still stored as captured, so restored JSON stays valid. - FlareFlow applies the same rule when it mints a placeholder. A
mask
function now also receivestext, the whole string the match was found in. - The JavaScript, Python, Go and Rust engines change together; FRS-1 section 11
describes the rule and three new conformance cases cover it.
flare-redact v1.10.1
Fixed: the IPv6 detector
- Times of day such as
12:30:45are no longer masked as IPv6 addresses. The
old pattern accepted any three to eight colon-separated hex groups, so clock
times in logs and FIX messages were redacted whenipv6was enabled (it is
part of thegdprandstrictpresets). - A compressed address is now masked whole.
2001:db8::8a2e:370:7334used to
come out as2001:db8::[REDACTED IPv6], leaving the network prefix visible.
The pattern now knows every::form,fe80::1,::1, a trailing::and
an embedded IPv4 address (::ffff:192.168.1.10,64:ff9b::192.0.2.33). - MAC addresses and code such as
dead::beeforFoo::abcare not matched. - The JavaScript, Python, Go and Rust engines change together; new conformance
cases cover compressed addresses, clock times and letter-only matches.
flare-redact v1.10.0
Security: restored values keep the structure of JSON (GHSA-4c5j-9f3p-p7mh)
- An original put back into a string that is JSON is now JSON-escaped: tool-call
arguments, Anthropicpartial_json, JSON-mode output, and any string that
is a JSON object or array passed tovault.restore()orrestore(). Before,
a value containing"broke the JSON, and a value containing","key":could
add a field to tool-call arguments or replace an earlier one, since JSON
parsers keep the last duplicate key. Text that is not JSON is restored exactly
as before. - Covered:
wrapOpenAIandwrapAnthropic(buffered and streamed), the tool
boundaries,authorizeForSink, the CLI's--restore, and the gateway. The
gateway now restores streamed responses event by event and field by field, so
a placeholder split across two events is put back and tool arguments that are
JSON inside a JSON event are escaped at both levels.response.streamEscape: 'none'keeps the old byte-level behaviour. - OpenAI
json_object/json_schemaand Anthropicoutput_config.format
requests have their streamed text restored escaped too. - The Python, Go and Rust engines follow the same rule, described in FRS-1
section 11 and checked by new conformance cases. Python'swrap_openaiand
wrap_anthropicnow restore streamed tool arguments (they were left as
placeholders) and no longer drop text held back at the end of a field. Go and
Rust add a JSON stream restorer (StreamJSON,stream_json) for callers that
restore tool arguments themselves. - Known limits: JSON carried as a string inside tool arguments gets one level of
escaping, and the deprecated streamingfunction_callis not restored.
Security: url_credentials in linear time (GHSA-x2x8-c4pf-r947)
- The URL scheme in
url_credentialsis limited to 64 characters. Unbounded, a
long run of scheme characters such asa-b.a-b.…made matching take time
quadratic in its length: about 7 s for 80 kB through the defaultredact(),
and the same in the Python engine. 1 MB now takes about 130 ms. - The scheme may contain
_, so passwords in SQLAlchemy URLs such as
oracle+cx_oracle://scott:tiger@dbandredshift+redshift_connector://…
are masked. They were not masked before. - Ships in the FRS-1 pack, which moves to version 1.10.0, with new conformance
cases and a new case innpm run benchmark:adversarial.
Vercel AI SDK
- Add
flare-redact/ai-sdk.wrapLanguageModel({ model, middleware: flareRedactMiddleware() })keeps secrets and personal data out of prompts for
every provider the AI SDK supports (OpenAI, Anthropic, Google, Bedrock,
Mistral, Groq and the rest). System, user and assistant text, reasoning,
tool-call inputs and tool results become placeholders before the call; text,
reasoning, tool calls and structured output are restored after it, streamed or
not, including placeholders split across chunks. Files and images pass through
unchanged. - It takes the same options as
wrapOpenAI, plussessionto keep placeholders
stable across calls, and works with AI SDK 5, 6 and 7 without depending on
ai.flare-redact initrecognises theaipackage and prints the line.
39 more detectors (90 to 129)
- 25 service tokens, on by default:
aws_bedrock_key,langsmith_key,
pinecone_key,tavily_key,pypi_token,rubygems_key,
dockerhub_token,jfrog_token,google_oauth_secret,
alibaba_access_key,heroku_api_key,flyio_token,
terraform_cloud_token,pulumi_token,planetscale_token,
onepassword_token,age_secret_key,sentry_auth_token,grafana_token,
dynatrace_token,atlassian_token,slack_webhook,mailchimp_key,
brevo_keyandresend_key. gitlab_tokencatches GitLab 17's longer personal access tokens and the
deploy, runner, trigger, CI job and other GitLab token types.
digitalocean_tokencatches OAuth (doo_v1_) and refresh (dor_v1_) tokens.- 14 national IDs, off by default and reached through
enableor thellm,
gdprandstrictpresets, each validated by its check digit and, where the
number carries one, its birth date:ro_cnp,se_personnummer,fi_hetu,
no_fodselsnummer,be_national_number,pt_nif,za_id,mx_curp,
cl_rut,ar_cuit,sg_nric,il_teudat_zehut,gr_amkaanduk_nino
(prefix and suffix rules; it has no check digit). Withzaorroenabled, a
South African ID or Romanian CNP is masked whole instead of as a card number. - Every detector ships in all four engines through the FRS-1 pack, with match
and near-miss tests and hostile-input cases in the adversarial benchmark.
Where people already look
- Add
.pre-commit-hooks.yaml:id: flare-redactstops a commit for the lines
it adds, andid: flare-redact-filesscans whole files for
pre-commit run --all-filesand pre-commit.ci. The package now builds in
prepack, so installing it from a git checkout works. - Add a GitHub Action:
uses: flare-collection/flare-redact@v1scans the
checkout, annotates each finding on the pull request, writes a job summary,
can upload SARIF to code scanning, and never prints a value. Each release
moves thev1tag. - The Python and Rust engines are published to PyPI and crates.io from this
release on, and the Go module getssdk/go/vX.Y.Ztags sogo getsees real
versions. Both packages now include the licence file.
Platforms
- CI runs the whole suite on Windows and macOS.
--scanreports file paths with
forward slashes on every platform; on Windows they used backslashes, which also
made SARIF URIs invalid there. - The Python engine requires 3.9 or newer, the oldest version CI tests.
flare-redact v1.9.1
Documentation
- The README is now a short overview: what it does, a quick start, where it
plugs in (logs, LLM prompts, Sentry, commits), how it compares with logger
path redaction, Sentry scrubbing, gitleaks and Presidio, and an FAQ. - The complete documentation moved, unchanged, to
docs/guide.md, which also ships in the npm package so
coding assistants readingnode_modulesfind it. - Tests check that every README link lands on a real heading in the guide and
that every detector count matches the code.
No code changes.
flare-redact v1.9.0
Turn it on without touching the code
- Add
flare-redact/register.node --import flare-redact/register app.js(or
NODE_OPTIONS="--import flare-redact/register") redacts every
console.log,info,warn,erroranddebugcall with no code
change.FLARE_REDACT_PRESETpicks the preset; an unknown name stops the
process at startup. It is the only module marked as having side effects. - Add
flare-redact/sentry.Sentry.init({ dsn, ...sentryRedact({ preset: 'gdpr' }) })redacts error events, transactions, spans, Sentry Logs and
breadcrumbs before they are sent, masks cookies whole, and keeps Sentry's own
fields (event, trace, span and debug ids, release, timestamps, SDK metadata,
the file and function of each stack frame) exactly, so grouping, tracing and
source maps keep working even withpreset: 'strict'. A field is put back
only where Sentry keeps it and only when its value has the shape that field
has and no detector but entropy fires on it, soextra.release, a request
field calledsidor an email in an exception type is redacted like any
other user data. A stack frame's file is kept only when it names a file and
has no query string. Cookies are masked whatever the options and wherever
they sit: the request, the response context, span attributes, breadcrumbs.
The caller's event is never written to, frozen or not. Checked against
@sentry/node11:sentryRedact(opts, { traceLifecycle: 'stream' })leaves
outbeforeSendTransaction, which Sentry 11 no longer calls and warns about.
Two things Sentry sends pass through no hook and so cannot be redacted here:
the release-health session and the trace header carrying the root span name. flare-redact initrecognises the Sentry SDKs and prints the no-code
--importline alongsidewrapConsole.
Stop a secret before the commit exists
- Add
flare-redact --staged: scan only the lines the next commit adds, read
from the staged diff, and report each finding at its line in the staged file.
A commit is stopped for what it introduces, not for old findings elsewhere in
the file, and a renamed file is compared with its old path, so moving a file
reports nothing. Files that change type and files a.gitattributesrule
marks-difforbinaryare scanned too, and line numbers do not depend on
the repository's diff settings.--exclude,--max-file-sizeand the default
excluded directories apply. - Add
flare-redact init --hook, which writes a git pre-commit hook that runs
it, preferring the project's own copy and falling back to the pinned release.
An existing hook is kept unless--forceis given; with husky, or a hooks
folder shared outside the repository, it prints the line to add instead of
writing anything, and it never writes through a symlink. If Node is not on the PATH of the git client, the hook lets
the commit through and says so rather than block every commit.
Scans that do not cry wolf
--scanand--stagedleave outgeneric_assignmentfindings whose value
is plainly code: a variable or template (${SECRET},$DB_PASSWORD,
{{ secret }}), an environment read (process.env.TOKEN,
os.getenv("KEY"),ENV["KEY"]), a field named like a secret
(config.apiKey,user.password), a call with no arguments, a type
(password: string), the variable of the same name, or a placeholder. It
does not try to understand code: from the operator to the end of the line
there must be exactly one of those forms and nothing else but closing
punctuation or a comment. A default value, a second argument, a string, a
number, or a.envand YAML styleDB_PASSWORD=valuekeeps the finding. A
more specific finding under a dropped assignment is still reported.
--no-code-filterturns it off.- Redaction is not affected.
redact(),scan()from code, the detector
pack and the Python, Go and Rust engines behave exactly as in 1.8.0: an
assignment is masked whether its value is code or not. - Exclude globs are matched with a table instead of a regular expression, so a
pattern with several**no longer takes unbounded time on a deep path. flare-redact init /absolute/pathreads that directory.
Docs
- The README has no long dashes, its version and CI badges point at fresh URLs
so a cached image cannot show an old release, and a test keeps the detector
and language counts in the badges equal to what ships. - The website playground was still running the August build, without the 1.7.0
fixes. It is rebuilt from this release, and a test now fails when the bundle
and the shipped detectors differ.
flare-redact v1.8.0
Simpler setup
- Add presets, so a caller names a goal instead of a list of tags:
logs(defaults plus phone numbers),llm(every personal identifier plus
theentitiesrecogniser),gdpr(llmplus network, device and wallet
identifiers) andstrict(every detector).redact(text, { preset: 'llm' }),
--preseton the CLI and the gateway, andFLARE_REDACT_PRESET.enable
anddisableapply on top andonlyignores a preset. An unknown name throws
ERR_UNKNOWN_PRESET; the gateway refuses one at startup and answers a client
that sends one with HTTP 400. - Add
flare-redact init. It readspackage.json, prints a ready-to-paste
step for each library it recognises (openai,@anthropic-ai/sdk, pino,
winston, express, with console as the fallback) and never edits source
files.--ciwrites a GitHub workflow that runsflare-redact --scanon
every pull request, and keeps an existing one unless--forceis given. - Export
PRESETSand thePresettype.
No existing option changed meaning; code without preset behaves as before.
flare-redact v1.7.0
Security: printed values and broken PEM blocks (GHSA-2jx3-6xv8-798v)
- IBANs printed in groups of four (
GB82 WEST 1234 5698 7654 32) are masked by
the default policy. Groups may be separated by spaces, no-break spaces, thin
spaces or narrow no-break spaces. The match stops at each country's registry
length, so a currency code or BIC after the number is left alone, and the
check digits are still validated. - US SSNs, Brazilian CPFs and German tax IDs written with spaces are masked like
their compact forms. - A private key whose END footer is missing or carries another label is masked
through that footer, or to the end of the input when no footer follows. Before,
such a block passed through unmasked.redactStream()buffers it the same way. - The fixes ship in all four engines (Node, Python, Go and Rust) and in the FRS-1
pack, which moves to version 1.7.0, with new conformance cases. Thanks to
roshcompanylabs for the report.
Free-text PII without a model
- Add
enable: ['entities'](orentities: true): a model-free recogniser for
private_person,private_address,private_phone,private_date,
account_number,private_handle,private_urlandsecret, the label set
of OpenAI's privacy-filter. It combines cue phrases in the 24 library
languages, name lists, address, phone and date shapes, context scoring and
propagation to later mentions of a name. - Add
recognizeEntities(),createEntityRecognizer(),ENTITY_LABELSand the
flare-redact/entitiessubpath. The labels are ordinary detectors, so
disable,only, vaults, every replacement mode, streams, the CLI and the
gateway take them. - Add
npm run benchmark:entitiesand a hand-labelled corpus. On a holdout
written after tuning stopped, the first run reached 84.1% F1 with 12.0% of PII
characters left visible, against 35.1% F1 and 67.4% for the regex detectors
alone. - Every pattern is bounded; 200,000-character hostile inputs finish in
milliseconds and the suite checks it.
Fixes
- The label-only
person_namedetector no longer runs across a line break:
Name: Fatima Haddadfollowed byAddress: ...used to take
Fatima Haddad\nAddress. Fixed in all four engines.
flare-redact v1.6.1 — NeMo Guardrails interoperability
NeMo Guardrails IORails + FlareFlow
This compatibility release adds a tested application-side boundary for combining NeMo Guardrails tool-call validation with FlareFlow source-to-sink declassification.
- New deterministic, no-network
nemo-guardrails-flareflowexample - Blocks a protected database value transplanted into a valid HTTP tool call
- Restores the same value only at the approved database sink and JSON path
- New original integration guide, README/LLM docs, sitemap entry, and CI smoke coverage
- Explicitly documents responsibilities, limitations, and project independence
No runtime API changed; existing 1.x code remains compatible.
Verification: 374 Node tests, 88 Python tests, Go vet/tests, Rust clippy/tests, Bun/Deno smoke, Docker gateway build/health check, all five examples, and npm provenance publishing.