feat(approvals): redact secret-shaped param values from display#658
Merged
Conversation
Audit caught that tool params on approval cards were JSON-stringified
verbatim. Anyone shoulder-surfing the dashboard could read out live
bearer tokens, API keys, session ids etc. from runHttpRequest or
connector-config approvals.
Walk the params object and redact values to "***" when the key matches
a secret-shaped pattern (token, secret, password, api[_-]?key, auth,
bearer, cookie, session[_-]?id, private[_-]?key). Case-insensitive
substring match.
Conservative by design: a key has to look secret-shaped. False positive
("api key" field that's actually a category id) is much less bad than
the false negative.
Applies to both the expanded card body and the "copy params" button —
copying a redacted blob avoids accidental paste of a real secret into
Slack/issue tracker.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Tool params on approval cards were JSON-stringified verbatim — anyone shoulder-surfing could read out live bearer tokens, API keys, session ids etc. from `runHttpRequest` / connector-config approvals.
Walks the params object and redacts string values to `"***"` when the key matches:
```
/(token|secret|password|api[-]?key|auth(orization)?|bearer|cookie|session[-]?id|private[_-]?key)/i
```
Case-insensitive substring match. Conservative by design — a key has to look secret-shaped. False positive (an "api key" that's a category id) is much less bad than a false negative.
Applies to both the expanded card body and the "copy params" button so copying a redacted blob avoids accidental paste of a real secret into Slack/issue tracker.
Display-only: bridge keeps the real params for the actual tool call; approval flow only signals approve/reject via callId.
Test plan
🤖 Generated with Claude Code