Repository navigation
Redact forwarded credentials from check diagnostics - #1745
Conversation
Architecture-Review: unchanged; check environments and outcomes retain their existing authority while captured diagnostics redact forwarded values. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 581c25e6a944c5f4850bc9b337dd4df0ecfa905a, 70.7s: approve (0 critical, 0 important, 3 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| normalized = value.strip() | ||
| if not normalized: | ||
| return False | ||
| if _CREDENTIAL_ENV.search(name): |
There was a problem hiding this comment.
suggestion: Credential-named variables with very short values remove ordinary text everywhere
_private_check_value treats any non-empty value as secret when the variable name matches _CREDENTIAL_ENV, however short the value is. The test even expects the 3-character value p1n to be redacted. If a project forwards a credential-named flag such as DISABLE_AUTH=1, SKIP_AUTH=true or HF_HUB_DISABLE_TOKEN=1, _redact_check_output replaces every 1 or true in the stage output. That mangles line numbers, counts and messages like tests/x.py:[REDACTED]2, which goes against the acceptance criterion "Preserve ordinary diagnostic text". Smallest fix: skip trivial values in the credential branch too, such as a minimum length of about 3–4 characters plus a check that excludes plain numbers and booleans.
| if _CREDENTIAL_ENV.search(name): | ||
| return True | ||
| mode = name == "ENV" or name.endswith(("_ENV", "_ENVIRONMENT", "_MODE")) | ||
| return len(normalized) >= 6 and not (mode and normalized.casefold() in _CHECK_MODES) |
There was a problem hiding this comment.
suggestion: Every forwarded value of 6+ characters is redacted, including paths and usernames
Any variable outside _CHECK_CONTEXT_ENV whose value has at least 6 characters is treated as a secret. Common allowlisted or configured variables hold paths or identities, such as USER, CARGO_HOME, GOPATH, JAVA_HOME, VIRTUAL_ENV, PYTHONPATH and SHELL=/bin/bash. Their values then get replaced inside tracebacks and compiler errors. For example, with USER=marcin allowlisted, the worktree path becomes /home/[REDACTED]/.... Verdicts are unaffected, but diagnostics become harder to use. Consider not redacting values that are absolute paths, or names ending in _HOME, _PATH or _DIR, in the non-credential branch. Alternatively, document the trade-off and test a path-valued variable so the behavior is intentional.
| return CheckResult(command, TIMEOUT_EXIT, timeout, | ||
| _check_tail(exc.stdout + f"\n[loopzero] timed out after {timeout:g}s")) | ||
| return CheckResult(command, done.exit_code, done.duration_s, _check_tail(done.stdout)) | ||
| _check_tail(exc.stdout, config, suffix=f"\n[loopzero] timed out after {timeout:g}s")) |
There was a problem hiding this comment.
suggestion: Redaction happens after _proc.run has already cut the output, so part of a secret can survive
_run_one passes tail_chars=CHECK_TAIL_BYTES to _proc.run, so the output is cut to its last 16K characters before _check_tail redacts it. If a secret straddles that cut, the remaining fragment no longer matches the full value and is kept. This shows up in the retained tail when the output is long but has few lines (single-line or minified output), because _proc.tail then keeps that first line. The same applies to runner-provided frame["tail"] and the ProcTimeout.stdout paths. Smallest fix: before redacting, drop the first partial line (or the first max(len(secret)) characters) of a tail that was cut, or redact any secret prefix found at the very start of the text.
|
waits for test headroom after #1663 |
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on ee665d210434e8e909f2ae602b5489eee345c63e, 20.9s: approve (0 critical, 0 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| def _runner_environment(config: Config) -> dict[str, str]: | ||
| return {**SANDBOX_ENV, **dict(config.env)} | ||
|
|
||
|
|
There was a problem hiding this comment.
suggestion: Extra blank line left from conflict resolution
The merge kept the + blank line from the conflict block, so _runner_environment and check_environment are now separated by three blank lines instead of two. The ruff config doesn't select E3, so lint still passes and nothing changes at runtime. To fix, delete the extra blank line.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Redact forwarded credentials from check diagnostics
Context and goal
Closes #1250
Acceptance
Base
Base: aa563c2
Notes
Carries forward the reviewed redaction idea from #1414. The check and runner receive their normal environment. The redaction runs on diagnostic text before it is retained, including timeout and old cached tails.
Validation
Recorded for
ee665d210434uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review