Repository navigation
Conversation
…written and as a whole word (Niko1221#4483) bench run took a credential-env value of "none" (serve's own no-key value) as a real key, sent it as a bearer token and, because the redactor replaced the key as a case-insensitive substring, wrote "nonempty" as "<key>mpty" in its README. credential_value() treats none/empty as no key, as the run-config path already did; the key pattern is now exact-case and word-bounded in both runners. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
Problem and result
Fixes #4483. With a run config whose
api_keyis"none"andSTRATA_KEY=nonein the environment,strata bench run --profile ... --credential-env STRATA_KEYsentBearer noneon every request and, because theredactor replaced the key as a case-insensitive substring, wrote "the first mpty reasoning" for "nonempty" in its
README (the run in #4468). Any key of four or more characters that is also a common word, or a short hex string that
occurs inside a hash, corrupted the README, outputs.jsonl, config.json and engine.log the same way.
After:
bench_facts.credential_value()treats an empty or "none" (any case) credential as no key, the same rule therun-config path already applied;
bench runuses it for--credential-env. The key is redacted exactly as written(case-sensitive) and only as a whole word, in
strata_cli/bench_facts.pyand intools/strata_bench.py. User andhost names, home folders and private addresses are redacted as before.
Related discussion
#4483
Approach
A small helper plus an
exactflag on the redactor'sadd()in both runners. TheBearer <token>pattern isunchanged, so an authorization header is still hidden whatever the key. Touches
strata_cli/cli.pyat thebench runkey read (~line 1255), well away from #4476's_redact_argvchange; the two apply independently.Validation
Passed:
python3.12 -m unittest tests.terminal.test_bench_redactor tools.test_strata_bench tests.terminal.test_bench_standard tests.terminal.test_bench_facts_amd:Ran 106 tests in 54.144s, OK (1 skipped). Strata Control 0.1.52's bundled Python 3.12.15, Ubuntu 26.10, this branch (main 46c152a + this commit).
bench_facts.py,cli.pyandtools/strata_bench.py(production files stashed, tests kept): Ran 11 tests in 0.012s FAILED (failures=3, errors=2) (credential_valueis missing on main; the substring and case cases fail).Failed:
Not run:
strata bench runwith this branch.Limits
Bearerpattern needs eight).Warning on short keys would be a separate change.
-or a word character (abcd1234-x) is not a whole word and is not replaced; theold substring match would have caught it, at the cost above.
🤖 Generated with Claude Code