From d471ccfd9ce2e6bb83bef7c8c3f1abc0d7a76659 Mon Sep 17 00:00:00 2001 From: Elle Najt Date: Tue, 3 Feb 2026 13:45:55 -0800 Subject: [PATCH] fix: Bash permission rules should only match Bash tool calls Previously, a Bash(...) permission rule would incorrectly match against any tool. The code checked if the rule was a Bash rule, but didn't verify that the tool being invoked was actually the Bash tool. This caused Bash rules like `Bash(./inbox:*)` to inadvertently allow Edit/Write operations on files matching the pattern, since the rule's argument would be interpreted as a glob pattern against file paths. The fix adds a check to ensure Bash rules only apply when the tool being called is mcp__acp__Bash. Co-Authored-By: Claude Opus 4.5 --- src/settings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings.ts b/src/settings.ts index 048943dd..cc4e997c 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -156,7 +156,7 @@ function matchesRule(rule: ParsedRule, toolName: string, toolInput: unknown, cwd // - "Claude will make a best-effort attempt to apply Read rules to all built-in tools // that read files like Grep, Glob, and LS." const ruleAppliesToTool = - rule.toolName === "Bash" || + (rule.toolName === "Bash" && toolName === acpToolNames.bash) || (rule.toolName === "Edit" && FILE_EDITING_TOOLS.includes(toolName)) || (rule.toolName === "Read" && FILE_READING_TOOLS.includes(toolName));