docs: document redact_secrets agent flag#2581
Merged
dgageot merged 1 commit intodocker:mainfrom Apr 28, 2026
Merged
Conversation
aheritier
approved these changes
Apr 28, 2026
trungutt
approved these changes
Apr 28, 2026
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.
Documents the
redact_secretsagent flag introduced in #2577.That PR added a single agent-level switch that wires up two complementary defenses:
pre_tool_usebuiltin hook that scrubs detected secrets from every tool call's arguments before the tool runs.before_llm_callmessage transform that scrubs the same patterns from outgoing chat messages (content, multi-part text, prior reasoning content, and JSON-encoded tool-call arguments) before they reach the model provider.Detection uses the docker-agent
secretsscanruleset (GitHub PATs, AWS keys, Stripe / Slack / GitLab / Hugging Face tokens, JWTs, PEM private keys, Docker Hub PATs, …); each detected span is replaced with the literal[REDACTED].Changes
docs/configuration/agents/index.md— addedredact_secretsto the YAML schema example and the properties reference table, plus a new Redacting Secrets section with example YAML, ruleset coverage, and callouts about false negatives and the equivalent manual hook entry.docs/configuration/hooks/index.md— added theredact_secrets(pre_tool_use) row to the Available built-ins table, and updated the Auto-injected built-ins callout to mentionredact_secrets: trueand that the agent flag also wires up the chat-side message transform.docs/guides/secrets/index.md— added a Preventing Secret Leaks section pointing readers toredact_secretsfor defense-in-depth against secrets leaking through the conversation itself, with a cross-link to the agent configuration page.