Skip to content

Commit 2a7ec82

Browse files
terisukeclaude
andcommitted
fix(agents): use selective denies instead of top-level wildcard deny (#51)
Problem: investigate.md and security.md had top-level "*": deny which blocked ALL tools including read, grep, glob — agents couldn't read files at all. planner.md had bash "*": deny at the END which overrode all specific allow rules before it (findLast returns last match). Fix: Replace top-level "*": deny with selective edit/write denies. Let read/grep/glob/list inherit from the profile. In bash sections, place "*": deny FIRST so specific allows come after and win via findLast evaluation order. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent a7a1529 commit 2a7ec82

3 files changed

Lines changed: 28 additions & 30 deletions

File tree

‎packages/guardrails/profile/agents/investigate.md‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
description: Deep codebase investigation. Read-only, no structured output requirement.
33
mode: subagent
44
permission:
5-
"*": deny
6-
grep: allow
7-
glob: allow
8-
list: allow
9-
lsp: allow
5+
edit:
6+
"*": deny
7+
write:
8+
"*": deny
109
bash:
1110
"*": deny
12-
"git log *": allow
13-
"git diff *": allow
14-
"git show *": allow
15-
"git blame *": allow
16-
"git status *": allow
17-
"git branch *": allow
11+
"git log*": allow
12+
"git diff*": allow
13+
"git show*": allow
14+
"git blame*": allow
15+
"git status*": allow
16+
"git branch*": allow
1817
"ls *": allow
1918
"find *": allow
2019
"wc *": allow

‎packages/guardrails/profile/agents/planner.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ permission:
55
plan_enter: allow
66
plan_exit: allow
77
question: allow
8-
bash:
9-
"git log *": allow
10-
"git diff *": allow
11-
"git show *": allow
12-
"git status *": allow
13-
"git branch *": allow
14-
"ls *": allow
15-
"pwd": allow
16-
"which *": allow
17-
"*": deny
188
edit:
199
"*": deny
2010
write:
2111
"*": deny
12+
bash:
13+
"*": deny
14+
"git log*": allow
15+
"git diff*": allow
16+
"git show*": allow
17+
"git status*": allow
18+
"git branch*": allow
19+
"ls *": allow
20+
"pwd": allow
21+
"which *": allow
2222
---
2323

2424
You are a planning agent. Your job is to explore the codebase, understand the request, and produce an implementation plan.

‎packages/guardrails/profile/agents/security.md‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
description: Security review specialist. OWASP Top 10, secrets detection, auth audit.
33
mode: subagent
44
permission:
5-
"*": deny
6-
grep: allow
7-
glob: allow
8-
list: allow
9-
lsp: allow
5+
edit:
6+
"*": deny
7+
write:
8+
"*": deny
109
bash:
1110
"*": deny
12-
"git log *": allow
13-
"git diff *": allow
14-
"git show *": allow
15-
"git status *": allow
11+
"git log*": allow
12+
"git diff*": allow
13+
"git show*": allow
1614
"git blame*": allow
15+
"git status*": allow
1716
"ls *": allow
1817
"pwd": allow
1918
---

0 commit comments

Comments
 (0)