feat(config): enable redact_secrets by default#2889
Merged
Conversation
Change agent-level `redact_secrets` to a tri-state `*bool` so an omitted field now defaults to true. Existing configs gain redaction automatically; set `redact_secrets: false` to opt out. - pkg/config/latest: pointer field + RedactSecretsEnabled() helper - teamloader: call the helper when wiring the agent option - agent-schema.json: add `default: true` and update description - examples/redact_secrets*.yaml: note the new default - pkg/config/latest: unit tests for the default and YAML round-trip
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Reviewed 6 changed files (183 diff lines). The bool → *bool tri-state pattern for RedactSecrets is correctly implemented:
RedactSecretsEnabled()correctly handles nil receiver and nil pointer (default-on).- The only production call site (
teamloader.go:167) already usesRedactSecretsEnabled()— no unupdated callers. pkg/runtime/hooks.gocallsa.RedactSecrets()on*Agent(not*AgentConfig), which returns the already-resolved bool set byteamloaderviaWithRedactSecrets(agentConfig.RedactSecretsEnabled())— correct downstream path.omitemptyon*boolcorrectly omits only nil (unset), notfalse(explicitly disabled).- Test coverage in
redact_secrets_test.gocovers nil cfg, nil field, explicit true, and explicit false cases.
No bugs found in the changed code.
aheritier
approved these changes
May 24, 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.
Make the agent-level
redact_secretsflag opt-out instead of opt-in.pkg/config/latest: field is now*bool; nil means enabled. NewRedactSecretsEnabled()helper centralises the default.pkg/teamloader: uses the helper when wiringagent.WithRedactSecrets.agent-schema.json:default: trueand updated description.redact_secrets: falseopts out.Existing configs that omit the field gain redaction automatically. Configs that explicitly set
true/falseare unchanged. Auto-injection still dedupes against manually-written hook entries, so theredact_secrets_hooks.yamlexample keeps working.Tests: new unit tests cover default/explicit-true/explicit-false and YAML round-trip; existing redact_secrets builtin + teamloader tests pass.