fix: add security.display_redaction_only to keep secrets usable in tools#16849
Open
HiddenPuppy wants to merge 2 commits into
Open
fix: add security.display_redaction_only to keep secrets usable in tools#16849HiddenPuppy wants to merge 2 commits into
HiddenPuppy wants to merge 2 commits into
Conversation
Root cause: redact_sensitive_text() was applied uniformly to both tool results (file reads, terminal output) and display/logging paths. When the LLM received partially-masked values (sk-a***c12) from tool results, it could not use them in subsequent commands — breaking Bitwarden CLI workflows (NousResearch#16700) and terminal credential usage (NousResearch#16843). Fix: - Add security.display_redaction_only config flag - redact_sensitive_text() skips patterns when flag is active (tool results) - New redact_for_display() always redacts (chat output, logs) - RedactingFormatter uses redact_for_display (always redact logs) - All gateway/platform/cli entry points bridge the new flag When display_redaction_only=true: ✓ LLM sees real values in tool results ✓ User sees redacted values in chat ✓ Logs are always redacted Closes NousResearch#16843 Closes NousResearch#16700
Collaborator
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
security.redact_secretswas redacting credential values in **both** tool results (file reads, terminal output) and display/logging paths. When the LLM received partially-masked values (sk-a***c12) from tool results, it could not use them in subsequent commands — breaking:htpasswdand similar tools that pass passwords via command-line arguments (Secret redaction breaks functional credential use in terminal commands #16843)Changes
New config:
security.display_redaction_onlyfalse(default)trueHow it works
redact_sensitive_text()— used by tool results (file reads, terminal output, code execution). Respects the new flag: skips patterns whendisplay_redaction_only=trueso the LLM gets real values.redact_for_display()— new function that **always** redacts, used by chat output (send_message), logs (RedactingFormatter), and context summaries. Never skips even when the flag is active.Testing
tests/agent/test_redact.py: 75 tests, all passing ✅Closes #16843
Closes #16700