A version pin is not a credential - #297
Merged
Merged
Conversation
The env-var redaction rule matched any name CONTAINING key/token/secret/password/
credential/auth, case-insensitively, followed by "=". A pip requirement satisfies
that. "tiktoken==0.12.0" is a name ending in "token" followed by "=", so the VERSION
was redacted as though it were a credential, and the published freeze carried
'tiktoken==[REDACTED]'
No installer can execute that, so the recorded environment could not be rebuilt --
the one thing a freeze exists to make possible. It cost a completed 3.5-hour training
run its reproducibility gate: the model trained, the lineage published, the AI-BOM
scored 100/100, every public URL resolved, and the row still could not claim tier 1.
Not specific to tiktoken. authlib, keyring, tokenizers, python-jose and secretstorage
all contain a keyword and are all ordinary dependencies.
The rule is now case-sensitive and requires a single "=". Environment variables are
uppercase by convention and POSIX reserves that space for them, so HF_TOKEN=,
OPENAI_API_KEY= and MYTOKEN= are still redacted while every lowercase package name is
spared; requiring a single "=" spares version pins whatever their case.
The gap this leaves is a lowercase-named variable holding a secret with no
recognisable prefix. That is unconventional, and the value-shaped rules -- hf_, sk-,
ghp_, glpat-, AKIA -- catch the real providers by token format rather than by variable
name, which is asserted.
Fourteen tests pin both directions: six real dependencies survive, a generated install
line survives intact, and five environment assignments are still redacted. Negative
control: restoring the old rule fails six of them. Full unit suite green, 1227 tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 9, 2026
Merged
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.
The bug
The env-var redaction rule matched any name containing
key|token|secret|password|passwd|pwd|credential|auth, case-insensitively, followed by=.A pip requirement satisfies that.
tiktoken==0.12.0is a name ending in token followed by=, so the version was redacted as though it were a credential:No installer can execute that, so the recorded environment cannot be rebuilt — the one thing a freeze exists to make possible.
It cost a completed 3.5-hour training run its reproducibility gate. The model trained, the lineage published, the AI-BOM scored 100/100, every public URL resolved — and the row still could not claim tier 1, because one dependency version in the generated install command was the string
[REDACTED].Not specific to tiktoken. All of these contain a keyword and are ordinary dependencies:
The fix
Case-sensitive, and a single
=only:Both restrictions are load-bearing:
HF_TOKEN=,OPENAI_API_KEY=andMYTOKEN=are still redacted; every lowercase package name is spared.=. Spares version pins whatever their case, so an uppercase package name would not trip it either.What this gives up
A lowercase-named variable holding a secret with no recognisable prefix —
hf_token=...where the value is nothf_.... That is unconventional, and the value-shaped rules (hf_,sk-,ghp_,glpat-,AKIA) catch the real providers by token format rather than by variable name. There is a test asserting exactly that.Verification
pip installline survives intact; five environment assignments are still redacted, including inside a longer command where--depth=14must also survive.tests/unit/test_register_secrets.pyandtest_omit_filter_git_urls.pystill green.