Skip to content

feat(approvals): redact secret-shaped param values from display#658

Merged
Oolab-labs merged 1 commit into
mainfrom
feat/approvals-redact-secrets
May 19, 2026
Merged

feat(approvals): redact secret-shaped param values from display#658
Oolab-labs merged 1 commit into
mainfrom
feat/approvals-redact-secrets

Conversation

@kungfuk3nnyyy
Copy link
Copy Markdown
Collaborator

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

  • Approval card with `{Authorization: "Bearer abc123"}` → renders `***`
  • `{api_key, apiKey, API-KEY, secretToken}` all redacted
  • `{recipient, message}` rendered verbatim
  • Nested: `{headers: {Authorization: "…"}}` → redacted in nested object
  • Copy params → clipboard contains redacted JSON, not real secret

🤖 Generated with Claude Code

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>
@Oolab-labs Oolab-labs merged commit b391ede into main May 19, 2026
18 checks passed
@Oolab-labs Oolab-labs deleted the feat/approvals-redact-secrets branch May 19, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants