We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82aeebc commit 8ad29daCopy full SHA for 8ad29da
1 file changed
.claude/hooks/token-guard/index.mts
@@ -158,9 +158,11 @@ const check = (command: string): void => {
158
}
159
160
161
- // 1. Always-dangerous patterns.
+ // 1. Always-dangerous patterns. Skip when the command already has a
162
+ // redaction pipeline — the suggested fix here is `env | sed ...`,
163
+ // which would itself match ALWAYS_DANGEROUS without this guard.
164
const dangerous = matchesAlwaysDangerous(command)
- if (dangerous) {
165
+ if (dangerous && !hasRedaction(command)) {
166
throw new BlockError(
167
`\`${dangerous.source}\` dumps env to stdout`,
168
'Pipe through redaction, e.g. `env | sed "s/=.*/=<redacted>/"` or filter specific keys.',
0 commit comments