fix(agent): redact secrets from assistant output - #21044
Conversation
|
Packaging follow-up as of 2026-05-07.
|
|
merge conflicts This PR does not merge cleanly with the base branch. Please rebase or merge current Signed: GPT-5.5-low in Codex |
|
Thanks for this, and for the careful scoping — the intent (scrub secrets at every assistant-output boundary) is exactly right. Closing without merging for three reasons: 1. The core of this already landed and closed the issue. The stored-assistant-content scrub you add is already on 2. Force-redacting stored 3. The reporter's own follow-up notes regex can't solve the reported problem. The dangerous case — natural-language leakage ("I used the password XXXX to log in") — matches no pattern; the durable fix is taint-tracking / opaque credential references, which is a separate design track. The safe subset of your change — redacting streamed display deltas / interim commentary (output the model never sees echoed back) — is a legitimate defense-in-depth addition, but it needs to be ported onto the refactored |
Summary
Why This Matters
Issue #20785 reports systemic secret leakage in assistant-visible output paths. This PR keeps the response scoped to that boundary: force redaction on streamed deltas, interim commentary, reasoning callbacks, persisted assistant content, and iteration-limit summaries even when broader log-redaction settings are off.
Verification
scripts/run_tests.sh tests/run_agent/test_agent_output_redaction.pyscripts/run_tests.sh tests/run_agent/test_agent_output_redaction.py tests/cli/test_reasoning_command.py::TestReasoningDeltasFiredFlag tests/run_agent/test_run_agent_codex_responses.py::test_stream_delta_strips_leaked_memory_context tests/run_agent/test_run_agent_codex_responses.py::test_stream_delta_strips_leaked_memory_context_across_chunks tests/run_agent/test_run_agent_codex_responses.py::test_interim_commentary_is_not_marked_already_streamed_without_callbacks tests/run_agent/test_run_agent_codex_responses.py::test_interim_commentary_is_not_marked_already_streamed_when_stream_callback_fails tests/run_agent/test_run_agent_codex_responses.py::test_interim_commentary_preserves_assistant_contentscripts/run_tests.sh tests/agent/test_redact.py tests/run_agent/test_agent_output_redaction.pypython -m py_compile run_agent.py tests/run_agent/test_agent_output_redaction.pygit diff --checkCloses #20785