Repository navigation
fix(security): decouple request PII redaction from injection mode - #8102
Merged
diegosouzapw merged 2 commits intoJul 22, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Jul 22, 2026
Contributor
Author
This was referenced Jul 22, 2026
PII_REDACTION_ENABLED now rewrites request PII independently of INPUT_SANITIZER_MODE, so the enterprise recipe (MODE=block + PII on) actually redacts. Also cover Responses API string input/prompt shapes and correct docs that claimed MODE=redact strips injection text. Refs: #8092 #8093 #8094 #8096 #8097
Unblocks CI lint/quality ratchet on the PII redaction PR by typing chat-like payloads instead of casting to any.
diegosouzapw
force-pushed
the
fix/sanitizer-correctness-docs
branch
from
July 22, 2026 20:25
dc26102 to
c78885b
Compare
diegosouzapw
merged commit Jul 22, 2026
7ae1716
into
cheaper-inference:release/v3.8.49
5 checks passed
Collaborator
|
Obrigado, @RaviTharuma — mergeado na |
Merged
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
…eaper-inference#8102) * fix(security): decouple request PII redaction from injection mode PII_REDACTION_ENABLED now rewrites request PII independently of INPUT_SANITIZER_MODE, so the enterprise recipe (MODE=block + PII on) actually redacts. Also cover Responses API string input/prompt shapes and correct docs that claimed MODE=redact strips injection text. Refs: cheaper-inference#8092 cheaper-inference#8093 cheaper-inference#8094 cheaper-inference#8096 cheaper-inference#8097 * test(security): drop no-explicit-any in sanitizer unit tests Unblocks CI lint/quality ratchet on the PII redaction PR by typing chat-like payloads instead of casting to any. --------- Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…eaper-inference#8102) * fix(security): decouple request PII redaction from injection mode PII_REDACTION_ENABLED now rewrites request PII independently of INPUT_SANITIZER_MODE, so the enterprise recipe (MODE=block + PII on) actually redacts. Also cover Responses API string input/prompt shapes and correct docs that claimed MODE=redact strips injection text. Refs: cheaper-inference#8092 cheaper-inference#8093 cheaper-inference#8094 cheaper-inference#8096 cheaper-inference#8097 * test(security): drop no-explicit-any in sanitizer unit tests Unblocks CI lint/quality ratchet on the PII redaction PR by typing chat-like payloads instead of casting to any. --------- Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the sanitizer/guardrail config footgun where request PII redaction required
INPUT_SANITIZER_MODE=redact, which made the documented enterprise recipe (MODE=block+PII_REDACTION_ENABLED=true) detect PII but still forward it upstream.Also closes related docs/coverage gaps from the sanitizer audit.
Closes #8092
Closes #8094
Related: #8093, #8095, #8096, #8097
Changes
Code
pii-maskerpreCall:PII_REDACTION_ENABLED=truenow redacts request PII independently of injection modeinput[]items, top-level stringinput, andpromptsanitizeRequest/redactBody: same independent PII rewrite + broader body walk (string messages/system/input/prompt)Docs
INPUT_SANITIZER_MODE=redactstrips injection patternsPII_REDACTION_ENABLEDTests
MODE=blockinput/ top-level stringinputinput-sanitizer-pii-redaction.test.tsmatrixTest plan
node --import tsx/esm ... --test tests/unit/input-sanitizer-pii-redaction.test.ts(3/3 pass)node --import tsx/esm ... --test tests/unit/guardrails-registry.test.ts(7/7 pass)Notes / intentional non-goals in this PR
INPUT_SANITIZER_ENABLED(still opt-out / default on in code; docs already say defaulttruein current tree) — docs: remove stale packaged ENVIRONMENT.md showing INPUT_SANITIZER_ENABLED=false (live docs/code agree: true) #8093 may already be largely doc-alignedpii-maskerpostCall+ streaming transform in current main; this PR only clarifies request-side independence