Public: anyone can read this; the crew can change it.
A secret's value is masked in every run log line and check log line #13180
Check · Review · Land · Live done — Landed and live in production.
Run and check log lines now mask a secret by value, and a short value only when it stands as a whole word.
shipped production is serving it deploy 59903fa
Run and check log lines now mask a secret by value, and a short value only when it stands as a whole word. Most of this was already in place: every line, from runs and checks alike, goes through redactHeld in src/runs/log.ts before it is stored or streamed, and granted secrets and the model credential were already held. This pull fixes two gaps:
- Short values (
src/kernel/log.ts): a 4–5 character secret used to be masked inside other words too. Now a value of 6 characters or more, and its base64 and URL-encoded forms, is replaced with[redacted]wherever it appears. A shorter value is replaced only as a whole word, so a secrethellono longer turnsothellointoot[redacted]. All the short values go into one pattern, so the cost stays linear in the line's length. Values under 4 characters are still not masked, as before. - The run's own token (
src/crew/runner.ts): it was caught only by itsforge_…shape, so a tool echoing it base64-encoded leaked it. It is now held by value for the life of the run and released in the run'sfinally.
redactValues called with an explicit list of values behaves as before (masked wherever they appear), so the app deploy log and leak-file callers are unchanged. The forms of a short value are not held: its base64 form is barely longer than the value itself and would mask unrelated text.
test/run-log-mask.test.ts covers the matcher: a long value inside a word, a short one only as a whole word, values with regex characters taken literally, and a 2 MB line masked in under 2 s. It then writes one line holding a long secret, a short secret, a near-miss pq7z9 and the run token's encoded forms. It reads that line back masked from the stored file, the live stream, the API log, the run page and the MCP run_log tool. Without the change it fails.
scripts/gate.ts, tsc --noEmit and test/mcp-size.test.ts pass. fast.ts couldn't name tests for a change to kernel/log.ts, so I ran the 68 test files that touch redaction or held values: 778 pass, 55 skipped, 2 failed:
looks.test.ts(the chromium capture) fails the same way on unchanged code, because the sandbox has no chromium.merge-queue.test.tspassed when run on its own; it timed out only under the load of the large run.
There was no keep_plan or estimate tool in this run, so the issue has no plan posted and no estimate recorded.
To try it, run bun test test/run-log-mask.test.ts.
🤖 Generated with Claude Code
Clean. Short values (4-5 chars) are masked only as whole words through one linear-time pattern, and the run token is held by value for the run and released in the finally. Explicit-list callers keep the old behaviour. The test reads one line back masked from the file, the stream, the API, the run page and the MCP run_log tool, and it would fail on the old code. No new dependency, no TODOs, and the README is untouched.
Run and check log lines now mask a secret by value, and a short value only when it stands as a whole word. Most of this was already in place: every line, from runs and checks alike, goes through
redactHeldinsrc/runs/log.tsbefore it is stored or streamed, and granted secrets and the model credential were already held. This pull fixes two gaps:src/kernel/log.ts): a 4–5 character secret used to be masked inside other words too. Now a value of 6 characters or more, and its base64 and URL-encoded forms, is replaced with[redacted]wherever it appears. A shorter value is replaced only as a whole word, so a secrethellono longer turnsothellointoot[redacted]. All the short values go into one pattern, so the cost stays linear in the line's length. Values under 4 characters are still not masked, as before.src/crew/runner.ts): it was caught only by itsforge_…shape, so a tool echoing it base64-encoded leaked it. It is now held by value for the life of the run and released in the run'sfinally.redactValuescalled with an explicit list of values behaves as before (masked wherever they appear), so the app deploy log and leak-file callers are unchanged. The forms of a short value are not held: its base64 form is barely longer than the value itself and would mask unrelated text.test/run-log-mask.test.tscovers the matcher: a long value inside a word, a short one only as a whole word, values with regex characters taken literally, and a 2 MB line masked in under 2 s. It then writes one line holding a long secret, a short secret, a near-misspq7z9and the run token's encoded forms. It reads that line back masked from the stored file, the live stream, the API log, the run page and the MCPrun_logtool. Without the change it fails.scripts/gate.ts,tsc --noEmitandtest/mcp-size.test.tspass.fast.tscouldn't name tests for a change tokernel/log.ts, so I ran the 68 test files that touch redaction or held values: 778 pass, 55 skipped, 2 failed:looks.test.ts(the chromium capture) fails the same way on unchanged code, because the sandbox has no chromium.merge-queue.test.tspassed when run on its own; it timed out only under the load of the large run.There was no
keep_planorestimatetool in this run, so the issue has no plan posted and no estimate recorded.To try it, run
bun test test/run-log-mask.test.ts.🤖 Generated with Claude Code
Closes #13159