Repository navigation
feat(cli): allow opting out of log redaction - #1176
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc99a6b4f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ); | ||
| function safePatchText( | ||
| value: string, | ||
| environment: NodeJS.ProcessEnv = {}, |
There was a problem hiding this comment.
Honor the opt-out in patch-risk diagnostics
When a patch-risk assessment contains a credential-shaped line, runPatchRiskAssessment() displays it through safePatchReport(), whose calls to safePatchText() omit the environment; this {} default therefore keeps logErrorMessage() redacting the report even when CODEX_SECURITY_REDACT_LOGS=0. Thread dependencies.environment into the stderr-display path while retaining default redaction for the pull-request body.
AGENTS.md reference: AGENTS.md:L47-L50
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f7c399d90
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| errorOutput.write( | ||
| `codex-security: warning: ${diagnosticMessage(warning)}\n`, | ||
| ); |
There was a problem hiding this comment.
Preserve the existing default warning output
When CODEX_SECURITY_REDACT_LOGS is unset, any scan warning containing credential-shaped text is now replaced wholesale with [redacted], whereas this callback previously printed the warning unchanged. This changes the default behavior while implementing an opt-out for existing redaction and forces users to disable redaction globally to recover warning context; restrict the new environment switch to boundaries that were already sanitized rather than introducing a new policy for scan status messages.
AGENTS.md reference: AGENTS.md:L38-L43
Useful? React with 👍 / 👎.
| for (const kind of ["discovery", "dedup"]) { | ||
| for (const resumeThreadId of [undefined, "fixture-resumed-thread"]) { | ||
| launches.length = 0; | ||
| restoreEnv("CODEX_SECURITY_REDACT_LOGS", redactLogs); |
There was a problem hiding this comment.
Retain the redaction setting across worker launches
This reset before every executor.run() masks the cross-launch case the test claims to cover: production calls snapshotWorkerEnvironment() inside each run(), so if the parent environment changes after a discovery worker finishes, a subsequent reducer or resumed worker on the same executor inherits the new CODEX_SECURITY_REDACT_LOGS value rather than the scan's captured value. Capture the setting once per coordinator (or pass an immutable per-scan environment) and let this test leave the mutated parent value in place before later launches.
AGENTS.md reference: AGENTS.md:L30-L34
Useful? React with 👍 / 👎.
soyeon-oai
left a comment
There was a problem hiding this comment.
LGTM at f56dbfd. Reviewed diagnostic callers, exact opt-out/default/verbose behavior, concurrent invocation isolation, worker display routing, and persisted/published-summary protections. The opt-out stays confined to diagnostics while stored failure and PR-summary redaction remains intact. Verified the new regression cases in hosted CI (merge b335780 containing this head); no independent local test run. The earlier patch-risk environment omission is addressed in current source, and the proposed worker environment change was removed.
Summary
Credential-shaped text can replace an entire CLI diagnostic with
[redacted], hiding context needed for local troubleshooting. AddCODEX_SECURITY_REDACT_LOGS=0to disable CLI diagnostic redaction independently of verbosity, and make scan warnings and errors follow the same redaction setting across plain stderr, verbose diagnostics, progress displays, and JSON errors.Changes
0disables diagnostic redaction; unset and other values keep it enabled. Existing verbosity controls retain their behavior. No flags or log levels are added.Testing
2950192658): 3,306 passed, 51 skipped, 0 failed across 152 files.12345: 3,305 passed, 51 skipped, 1 test-environment failure. The isolated test working directory resolved a second React installation for a TUI subprocess. Linking the package dependencies into that test directory fixed the affected test; its rerun passed without source changes.0,1, andfalse; stderr policy, JSON errors, exit codes, and verbosity stayed independent.Risk and rollout
Redaction remains enabled by default. This intentionally changes some scan warnings and errors that previously appeared raw on stderr: credential-shaped messages now show
[redacted]unlessCODEX_SECURITY_REDACT_LOGS=0is set. Verbosity does not disable redaction, and disabling redaction does not enable more verbose output.Raw model output, result data, session capture, and dedicated path fields remain unchanged. The setting does not change credential configuration, SDK sanitization, stored failure summaries, publication receipts, or native Codex/OpenTelemetry redaction, and cannot recover content already redacted upstream. Settings are not saved in scan recipes; choose them again when resuming or rerunning a scan. Output can contain sensitive information, especially with redaction disabled; keep it private and review it before sharing.
Public disclosure review