fix: stop redacting the model provider's name from masked output - #942
Open
brahyam wants to merge 1 commit into
Open
fix: stop redacting the model provider's name from masked output#942brahyam wants to merge 1 commit into
brahyam wants to merge 1 commit into
Conversation
createSecretValueMasker treats every env value of eight characters or more as a secret to redact. A provider env carrying MODEL_PROVIDER therefore has the literal words "openrouter" and "anthropic" replaced with <redacted:MODEL_PROVIDER> wherever they appear in the text being masked, including in prose that has nothing to do with the variable. MODEL_PROVIDER names a provider; it is never a credential. NON_SECRET_ENV_KEYS already carries BROWSE_LAB_MODEL_PROVIDER for the same reason, so declare this one beside it. The existing plumbing-keys case gains the key rather than a new case being added beside it, because that test is already the one place asserting the allowlist is honoured. Its command string now contains the provider name, so the case fails if the entry is dropped again -- verified by reverting the one-line change and watching it go red, since an allowlist entry that no test can distinguish from its own absence is not pinned by anything.
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.
createSecretValueMaskertreats every env value of eight characters or moreas a secret to redact. A provider env that carries
MODEL_PROVIDERthereforehas the literal words
openrouter(10) andanthropic(9) replaced with<redacted:MODEL_PROVIDER>everywhere they occur in the masked text —including in prose that has nothing to do with the variable.
MODEL_PROVIDERnames a provider; it is never a credential.NON_SECRET_ENV_KEYSalready carriesBROWSE_LAB_MODEL_PROVIDERfor exactlythis reason, so this declares the plain one beside it.
The existing "plumbing keys and short values are not masked" case gains the
key rather than a new case being added beside it — that test is already the
one place asserting the allowlist is honoured, and its command string now
contains the provider name, so the case goes red if the entry is dropped
again. Verified by reverting the one-line change and watching it fail: an
allowlist entry no test can distinguish from its own absence is not pinned by
anything.
test/secret-masking.test.tsand the masker's callers(
test/memory-provider-config.test.ts,test/memorable-capture.test.ts,test/memorable-relay.test.ts) pass: 42 tests.npm run typecheck, eslint andprettier --checkpass.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.