Repository navigation
Redact credentials from reviewer authentication errors - #1380
Conversation
Architecture-Review: unchanged; the runner keeps existing credential forwarding and authentication failure behavior and scrubs native diagnostic text. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 36aac2b46a2206bc72d0657b6ed73dda4610904a, 37.4s: approve (0 critical, 0 important, 2 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.
| raise RunnerAuthFailed(f"{family}: CLI is not authenticated\n{_tail(combined)}") | ||
| raise _auth_failure(family, combined) | ||
| if _subscription_exhausted(combined, envelope): | ||
| raise RunnerUsageLimit(f"{family}: usage limit reached", _tail(combined)) |
There was a problem hiding this comment.
suggestion: Native diagnostics on non-auth failure paths are still forwarded without redaction
Only the RunnerAuthFailed paths go through _auth_failure. A provider can echo the same forwarded key in output that the auth check misses. For example, a message like Invalid x-api-key does not match _AUTH_PATTERNS. That output then reaches stderr unredacted through RunnerUsageLimit/RunnerPromptTooLong/RunnerBadOutput tails here: runners.py:286 (timeout tail), 296, 298, 299 in _run, and 1164, 1170, 1171 in _review_claude. The task scopes acceptance to auth failures, so this does not block. The goal, though, is to keep credentials out of logs. Smallest fix: split the scrubbing out of _auth_failure into a _redact(family, text) helper and apply it inside _tail for runner diagnostics, or at least in the RunnerBadOutput constructor. Then every runner tail is scrubbed once at a single boundary instead of only at the auth call sites.
| def _auth_failure(family: str, diagnostic: str) -> RunnerAuthFailed: | ||
| names = CLAUDE_AUTH_ENV if family == "claude" else CODEX_AUTH_ENV | ||
| env = _proc.build_env(names) | ||
| values = {variant for value in env.values() if value for variant in (value, json.dumps(value)[1:-1])} |
There was a problem hiding this comment.
suggestion: Very short forwarded env values redact unrelated text
Every non-empty forwarded value becomes a literal redaction pattern. If someone sets ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN to a placeholder such as 1, x or test, every occurrence of that substring is replaced. This can mangle the failure text the acceptance criteria say must be preserved, e.g. Not logged in becomes No[REDACTED] logged in when the value is t. Smallest fix: skip values below a minimum length, e.g. len(value) >= 8. The provider-shaped sk-/JWT patterns still cover real credentials.
Architecture-Review: unchanged; credential redaction stays within the reviewer diagnostic boundary. Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; this clean base merge preserves reviewer diagnostic redaction. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on caf666c65ca377cf9befebd8ee4e7a73f592a534, 23.7s: approve (0 critical, 0 important, 0 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.
Architecture-Review: unchanged; this clean base merge preserves the approved credential-redaction change. Co-Authored-By: Codex <noreply@openai.com>
|
@Mergifyio queue |
❌ Left the queue ·
|
|
No description provided. |
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Redact credentials from reviewer authentication errors
Context and goal
Closes #1254
Acceptance
Notes
Scrub native diagnostics at the shared authentication failure boundary before clipping. Existing credential forwarding, authentication detection, and login remedies continue to use the existing routes.
The fake CLI regression failed before the fix and passes with both login remedies and the original failure exit. Runner tests also exercise authenticated-error envelopes. Security review traced both providers through the shared exception formatter before truncation.
The posted head exceeds the test-line cap by nine lines. Focused CLI and runner regressions pass and the full gate stops at size.
Base
Base: 09d75eb
Validation
Recorded for
8057285a6466uv 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 0Review
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Security review lens
Apply the security-review checklist to this delta. Trace untrusted reviewer stdout, stderr, and error envelopes through authentication classification, redaction, truncation, exception formatting, alternate-runner output, and local or published diagnostics. Verify raw and JSON-escaped synthetic credentials are removed without losing the corrective action. Treat a reachable credential disclosure as blocking. Cite only synthetic or redacted evidence and return the standard review JSON.