[GH-ISSUE #4483] [Benchmark] bench run takes a credential-env value of "none" as a real key and redacts the word everywhere #2006

Closed
opened 2026-11-04 01:55:56 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @coryjett on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4483

Area

Benchmark

Desktop app, Terminal or source?

Terminal (Linux release 0.2.7, Control 0.1.52); the same code is on main at 46c152a1.

What happened

Our server runs without a key: the run config has "api_key": "none", which serve/server.py defines as "no key".
strata bench run --profile <run config> --no-start --credential-env STRATA_KEY with STRATA_KEY=none in the
environment then:

  1. Sent Bearer none on every request (results.json says "api_key_sent": true), and
  2. Redacted the word "none" wherever it occurred in the files it writes. The runner's README reads
    "Client monotonic time from request dispatch to the first mpty reasoning" for "nonempty".

Cause: strata_cli/cli.py (bench run, ~line 1255) takes os.environ.get(a.credential_env) as the key as it is; the
"none means no key" check (~line 1264) runs only for the config's own api_key. Then strata_cli/bench_facts.py
redactor() (add(key, "<key>"), ~lines 45-50 and 61) replaces the key as a case-insensitive substring with no word
boundary (the word flag is used for the user and host names, not for the key). Any key of 4 or more characters that
is also a common word, or a short hex string that occurs inside a hash, corrupts the README, outputs.jsonl,
config.json and engine.log. tools/strata_bench.py (~line 91) has the same substring replacement.

Suggested fix: treat a credential value of "none" (case-insensitive) as no key in both places; redact the key only
on word boundaries and case-sensitively; and warn when a key is shorter than, say, 8 characters instead of lowering
the 4-character floor. Happy to send a PR with tests (bench_facts.redactor has no test today).

Smallest steps or command that reproduce it

With a run config whose api_key is "none": STRATA_KEY=none strata bench run --profile <run config> --no-start --credential-env STRATA_KEY, then grep the output folder for <key>.

Reproduction status

Reproduced locally: the folder in #4468 (bench/results/2026-10-28-standard-rtx-3090-plus-rtx-3090-5250594b/,
README corrected by hand, noted there).

Strata version

0.2.7 (engine 0.1.52, Control 0.1.52); code checked on main 46c152a1.

Graphics card, memory and system

2x RTX 3090 24 GB, 2x Xeon E5-2620 v3, 256 GB, Ubuntu 26.10. Not hardware-specific.

Model, size and settings

Flash-Next IQ3_S; see #4468.

Logs

See above.

Originally created by @coryjett on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4483 ### Area Benchmark ### Desktop app, Terminal or source? Terminal (Linux release 0.2.7, Control 0.1.52); the same code is on `main` at 46c152a1. ### What happened Our server runs without a key: the run config has `"api_key": "none"`, which `serve/server.py` defines as "no key". `strata bench run --profile <run config> --no-start --credential-env STRATA_KEY` with `STRATA_KEY=none` in the environment then: 1. Sent `Bearer none` on every request (`results.json` says `"api_key_sent": true`), and 2. Redacted the word "none" wherever it occurred in the files it writes. The runner's README reads "Client monotonic time from request dispatch to the first <key>mpty reasoning" for "nonempty". Cause: `strata_cli/cli.py` (`bench run`, ~line 1255) takes `os.environ.get(a.credential_env)` as the key as it is; the "none means no key" check (~line 1264) runs only for the config's own `api_key`. Then `strata_cli/bench_facts.py` `redactor()` (`add(key, "<key>")`, ~lines 45-50 and 61) replaces the key as a case-insensitive substring with no word boundary (the `word` flag is used for the user and host names, not for the key). Any key of 4 or more characters that is also a common word, or a short hex string that occurs inside a hash, corrupts the README, outputs.jsonl, config.json and engine.log. `tools/strata_bench.py` (~line 91) has the same substring replacement. Suggested fix: treat a credential value of "none" (case-insensitive) as no key in both places; redact the key only on word boundaries and case-sensitively; and warn when a key is shorter than, say, 8 characters instead of lowering the 4-character floor. Happy to send a PR with tests (`bench_facts.redactor` has no test today). ### Smallest steps or command that reproduce it With a run config whose `api_key` is `"none"`: `STRATA_KEY=none strata bench run --profile <run config> --no-start --credential-env STRATA_KEY`, then grep the output folder for `<key>`. ### Reproduction status Reproduced locally: the folder in #4468 (`bench/results/2026-10-28-standard-rtx-3090-plus-rtx-3090-5250594b/`, README corrected by hand, noted there). ### Strata version 0.2.7 (engine 0.1.52, Control 0.1.52); code checked on `main` 46c152a1. ### Graphics card, memory and system 2x RTX 3090 24 GB, 2x Xeon E5-2620 v3, 256 GB, Ubuntu 26.10. Not hardware-specific. ### Model, size and settings Flash-Next IQ3_S; see #4468. ### Logs See above.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Hello coryjett,

Thank you. In Strata 0.2.11 a credential of "none" (any case) from --credential-env, from the serving suite of bench run, from models list --served and from tools/strata_bench.py is treated as no key: it is not sent as a Bearer token, api_key_sent is false, and the word "none" is no longer redacted. A real key is now replaced as a whole word in its own case, so it no longer eats ordinary words or parts of hashes. We kept the existing 4-character floor rather than 8 so that a short real key is still removed from the files. If it still goes wrong on 0.2.11, tell us which command you ran and where the word appeared.

The Strata project

<!-- gh-comment-id:6658428500 --> @Niko1221 commented on GitHub (Nov 5, 2026): Hello coryjett, Thank you. In Strata 0.2.11 a credential of "none" (any case) from `--credential-env`, from the serving suite of `bench run`, from `models list --served` and from `tools/strata_bench.py` is treated as no key: it is not sent as a Bearer token, `api_key_sent` is false, and the word "none" is no longer redacted. A real key is now replaced as a whole word in its own case, so it no longer eats ordinary words or parts of hashes. We kept the existing 4-character floor rather than 8 so that a short real key is still removed from the files. If it still goes wrong on 0.2.11, tell us which command you ran and where the word appeared. The Strata project
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2006
No description provided.