Skip to content

fix: stop redacting the model provider's name from masked output - #942

Open
brahyam wants to merge 1 commit into
yc-software:mainfrom
brahyam:mask-model-provider-not-a-secret
Open

fix: stop redacting the model provider's name from masked output#942
brahyam wants to merge 1 commit into
yc-software:mainfrom
brahyam:mask-model-provider-not-a-secret

Conversation

@brahyam

@brahyam brahyam commented Sep 4, 2026

Copy link
Copy Markdown

createSecretValueMasker treats every env value of eight characters or more
as a secret to redact. A provider env that carries MODEL_PROVIDER therefore
has the literal words openrouter (10) and anthropic (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_PROVIDER names a provider; it is never a credential.
NON_SECRET_ENV_KEYS already carries BROWSE_LAB_MODEL_PROVIDER for exactly
this 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.ts and 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 and
prettier --check pass.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant