flare-redact 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +113 -0
- package/README.md +122 -1225
- package/bench/adversarial-runtime.mjs +27 -6
- package/dist/ai-sdk.d.ts +62 -0
- package/dist/ai-sdk.d.ts.map +1 -0
- package/dist/ai-sdk.js +263 -0
- package/dist/ai-sdk.js.map +1 -0
- package/dist/checksums.d.ts +43 -0
- package/dist/checksums.d.ts.map +1 -1
- package/dist/checksums.js +184 -0
- package/dist/checksums.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/detectors.d.ts.map +1 -1
- package/dist/detectors.js +7 -4
- package/dist/detectors.js.map +1 -1
- package/dist/extra.d.ts.map +1 -1
- package/dist/extra.js +229 -1
- package/dist/extra.js.map +1 -1
- package/dist/file-discovery.d.ts +5 -0
- package/dist/file-discovery.d.ts.map +1 -1
- package/dist/file-discovery.js +5 -1
- package/dist/file-discovery.js.map +1 -1
- package/dist/gateway/body.d.ts.map +1 -1
- package/dist/gateway/body.js +2 -1
- package/dist/gateway/body.js.map +1 -1
- package/dist/gateway/config.d.ts +5 -3
- package/dist/gateway/config.d.ts.map +1 -1
- package/dist/gateway/config.js.map +1 -1
- package/dist/gateway/index.d.ts +1 -0
- package/dist/gateway/index.d.ts.map +1 -1
- package/dist/gateway/index.js +1 -0
- package/dist/gateway/index.js.map +1 -1
- package/dist/gateway/server.d.ts.map +1 -1
- package/dist/gateway/server.js +17 -1
- package/dist/gateway/server.js.map +1 -1
- package/dist/gateway/sse.d.ts +35 -0
- package/dist/gateway/sse.d.ts.map +1 -0
- package/dist/gateway/sse.js +217 -0
- package/dist/gateway/sse.js.map +1 -0
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +11 -5
- package/dist/help.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +12 -3
- package/dist/init.js.map +1 -1
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +20 -9
- package/dist/llm.js.map +1 -1
- package/dist/locales.d.ts +3 -2
- package/dist/locales.d.ts.map +1 -1
- package/dist/locales.js +152 -3
- package/dist/locales.js.map +1 -1
- package/dist/pack.d.ts.map +1 -1
- package/dist/pack.js +14 -1
- package/dist/pack.js.map +1 -1
- package/dist/vault.d.ts +26 -1
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +61 -3
- package/dist/vault.js.map +1 -1
- package/docker/README.md +8 -5
- package/docs/guide.md +1416 -0
- package/package.json +10 -3
- package/spec/SPEC.md +40 -3
- package/spec/conformance/README.md +8 -1
- package/spec/conformance/cases.json +60 -1
- package/spec/conformance/expected.json +815 -7
- package/spec/detectors.json +1118 -222
- package/spec/detectors.schema.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.10.0 (2026-11-18)
|
|
4
|
+
|
|
5
|
+
### Security: restored values keep the structure of JSON (GHSA-4c5j-9f3p-p7mh)
|
|
6
|
+
|
|
7
|
+
- An original put back into a string that is JSON is now JSON-escaped: tool-call
|
|
8
|
+
`arguments`, Anthropic `partial_json`, JSON-mode output, and any string that
|
|
9
|
+
is a JSON object or array passed to `vault.restore()` or `restore()`. Before,
|
|
10
|
+
a value containing `"` broke the JSON, and a value containing `","key":` could
|
|
11
|
+
add a field to tool-call arguments or replace an earlier one, since JSON
|
|
12
|
+
parsers keep the last duplicate key. Text that is not JSON is restored exactly
|
|
13
|
+
as before.
|
|
14
|
+
- Covered: `wrapOpenAI` and `wrapAnthropic` (buffered and streamed), the tool
|
|
15
|
+
boundaries, `authorizeForSink`, the CLI's `--restore`, and the gateway. The
|
|
16
|
+
gateway now restores streamed responses event by event and field by field, so
|
|
17
|
+
a placeholder split across two events is put back and tool arguments that are
|
|
18
|
+
JSON inside a JSON event are escaped at both levels. `response.streamEscape:
|
|
19
|
+
'none'` keeps the old byte-level behaviour.
|
|
20
|
+
- OpenAI `json_object`/`json_schema` and Anthropic `output_config.format`
|
|
21
|
+
requests have their streamed text restored escaped too.
|
|
22
|
+
- The Python, Go and Rust engines follow the same rule, described in FRS-1
|
|
23
|
+
section 11 and checked by new conformance cases. Python's `wrap_openai` and
|
|
24
|
+
`wrap_anthropic` now restore streamed tool arguments (they were left as
|
|
25
|
+
placeholders) and no longer drop text held back at the end of a field. Go and
|
|
26
|
+
Rust add a JSON stream restorer (`StreamJSON`, `stream_json`) for callers that
|
|
27
|
+
restore tool arguments themselves.
|
|
28
|
+
- Known limits: JSON carried as a string inside tool arguments gets one level of
|
|
29
|
+
escaping, and the deprecated streaming `function_call` is not restored.
|
|
30
|
+
|
|
31
|
+
### Security: url_credentials in linear time (GHSA-x2x8-c4pf-r947)
|
|
32
|
+
|
|
33
|
+
- The URL scheme in `url_credentials` is limited to 64 characters. Unbounded, a
|
|
34
|
+
long run of scheme characters such as `a-b.a-b.…` made matching take time
|
|
35
|
+
quadratic in its length: about 7 s for 80 kB through the default `redact()`,
|
|
36
|
+
and the same in the Python engine. 1 MB now takes about 130 ms.
|
|
37
|
+
- The scheme may contain `_`, so passwords in SQLAlchemy URLs such as
|
|
38
|
+
`oracle+cx_oracle://scott:tiger@db` and `redshift+redshift_connector://…`
|
|
39
|
+
are masked. They were not masked before.
|
|
40
|
+
- Ships in the FRS-1 pack, which moves to version 1.10.0, with new conformance
|
|
41
|
+
cases and a new case in `npm run benchmark:adversarial`.
|
|
42
|
+
|
|
43
|
+
### Vercel AI SDK
|
|
44
|
+
|
|
45
|
+
- Add `flare-redact/ai-sdk`. `wrapLanguageModel({ model, middleware:
|
|
46
|
+
flareRedactMiddleware() })` keeps secrets and personal data out of prompts for
|
|
47
|
+
every provider the AI SDK supports (OpenAI, Anthropic, Google, Bedrock,
|
|
48
|
+
Mistral, Groq and the rest). System, user and assistant text, reasoning,
|
|
49
|
+
tool-call inputs and tool results become placeholders before the call; text,
|
|
50
|
+
reasoning, tool calls and structured output are restored after it, streamed or
|
|
51
|
+
not, including placeholders split across chunks. Files and images pass through
|
|
52
|
+
unchanged.
|
|
53
|
+
- It takes the same options as `wrapOpenAI`, plus `session` to keep placeholders
|
|
54
|
+
stable across calls, and works with AI SDK 5, 6 and 7 without depending on
|
|
55
|
+
`ai`. `flare-redact init` recognises the `ai` package and prints the line.
|
|
56
|
+
|
|
57
|
+
### 39 more detectors (90 to 129)
|
|
58
|
+
|
|
59
|
+
- 25 service tokens, on by default: `aws_bedrock_key`, `langsmith_key`,
|
|
60
|
+
`pinecone_key`, `tavily_key`, `pypi_token`, `rubygems_key`,
|
|
61
|
+
`dockerhub_token`, `jfrog_token`, `google_oauth_secret`,
|
|
62
|
+
`alibaba_access_key`, `heroku_api_key`, `flyio_token`,
|
|
63
|
+
`terraform_cloud_token`, `pulumi_token`, `planetscale_token`,
|
|
64
|
+
`onepassword_token`, `age_secret_key`, `sentry_auth_token`, `grafana_token`,
|
|
65
|
+
`dynatrace_token`, `atlassian_token`, `slack_webhook`, `mailchimp_key`,
|
|
66
|
+
`brevo_key` and `resend_key`.
|
|
67
|
+
- `gitlab_token` catches GitLab 17's longer personal access tokens and the
|
|
68
|
+
deploy, runner, trigger, CI job and other GitLab token types.
|
|
69
|
+
`digitalocean_token` catches OAuth (`doo_v1_`) and refresh (`dor_v1_`) tokens.
|
|
70
|
+
- 14 national IDs, off by default and reached through `enable` or the `llm`,
|
|
71
|
+
`gdpr` and `strict` presets, each validated by its check digit and, where the
|
|
72
|
+
number carries one, its birth date: `ro_cnp`, `se_personnummer`, `fi_hetu`,
|
|
73
|
+
`no_fodselsnummer`, `be_national_number`, `pt_nif`, `za_id`, `mx_curp`,
|
|
74
|
+
`cl_rut`, `ar_cuit`, `sg_nric`, `il_teudat_zehut`, `gr_amka` and `uk_nino`
|
|
75
|
+
(prefix and suffix rules; it has no check digit). With `za` or `ro` enabled, a
|
|
76
|
+
South African ID or Romanian CNP is masked whole instead of as a card number.
|
|
77
|
+
- Every detector ships in all four engines through the FRS-1 pack, with match
|
|
78
|
+
and near-miss tests and hostile-input cases in the adversarial benchmark.
|
|
79
|
+
|
|
80
|
+
### Where people already look
|
|
81
|
+
|
|
82
|
+
- Add `.pre-commit-hooks.yaml`: `id: flare-redact` stops a commit for the lines
|
|
83
|
+
it adds, and `id: flare-redact-files` scans whole files for
|
|
84
|
+
`pre-commit run --all-files` and pre-commit.ci. The package now builds in
|
|
85
|
+
`prepack`, so installing it from a git checkout works.
|
|
86
|
+
- Add a GitHub Action: `uses: flare-collection/flare-redact@v1` scans the
|
|
87
|
+
checkout, annotates each finding on the pull request, writes a job summary,
|
|
88
|
+
can upload SARIF to code scanning, and never prints a value. Each release
|
|
89
|
+
moves the `v1` tag.
|
|
90
|
+
- The Python and Rust engines are published to PyPI and crates.io from this
|
|
91
|
+
release on, and the Go module gets `sdk/go/vX.Y.Z` tags so `go get` sees real
|
|
92
|
+
versions. Both packages now include the licence file.
|
|
93
|
+
|
|
94
|
+
### Platforms
|
|
95
|
+
|
|
96
|
+
- CI runs the whole suite on Windows and macOS. `--scan` reports file paths with
|
|
97
|
+
forward slashes on every platform; on Windows they used backslashes, which also
|
|
98
|
+
made SARIF URIs invalid there.
|
|
99
|
+
- The Python engine requires 3.9 or newer, the oldest version CI tests.
|
|
100
|
+
|
|
101
|
+
## 1.9.1 (2026-11-17)
|
|
102
|
+
|
|
103
|
+
### Documentation
|
|
104
|
+
|
|
105
|
+
- The README is now a short overview: what it does, a quick start, where it
|
|
106
|
+
plugs in (logs, LLM prompts, Sentry, commits), how it compares with logger
|
|
107
|
+
path redaction, Sentry scrubbing, gitleaks and Presidio, and an FAQ.
|
|
108
|
+
- The complete documentation moved, unchanged, to
|
|
109
|
+
[`docs/guide.md`](docs/guide.md), which also ships in the npm package so
|
|
110
|
+
coding assistants reading `node_modules` find it.
|
|
111
|
+
- Tests check that every README link lands on a real heading in the guide and
|
|
112
|
+
that every detector count matches the code.
|
|
113
|
+
|
|
114
|
+
No code changes.
|
|
115
|
+
|
|
3
116
|
## 1.9.0 (2026-11-14)
|
|
4
117
|
|
|
5
118
|
### Turn it on without touching the code
|