Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/permission-gateway/scripts/permission-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ fi

# --- Tier 1: Safe patterns ---
# Safe read-only commands (anchored to start — first command in chain)
if echo "$command_normalized" | grep -qE '^(ls|cat|head|tail|wc|jq|echo|pwd|which|whoami|date|file|stat|diff|sort|uniq|tr|cut|tee|less|more|env|printenv|type|grep|rg|find|fd|tree|awk|sed|hexdump|hex|xxd|od)\b'; then
if echo "$command_normalized" | grep -qE '^(ls|cat|head|tail|wc|jq|echo|pwd|which|whoami|date|file|stat|diff|sort|uniq|tr|cut|tee|less|more|env|printenv|type|grep|rg|find|fd|tree|awk|sed|hexdump|hex|xxd|od|basename|dirname|realpath|cd)\b'; then
approve
fi

Expand Down
3 changes: 3 additions & 0 deletions plugins/permission-gateway/tests/test-permission-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ assert_decision "type" "type node" "silent"
assert_decision "cargo bench" "cargo bench" "silent"
assert_decision "npm ci" "npm ci" "silent"
assert_decision "jj bookmark" "jj bookmark create feature-x" "silent"
assert_decision "basename" "basename /some/path" "silent"
assert_decision "dirname" "dirname /some/path/file.txt" "silent"
assert_decision "cd" "cd /some/dir" "silent"
assert_decision "sed (piped)" "echo hello | sed 's/hello/world/'" "silent"
assert_decision "sed (no -i)" "sed 's/foo/bar/' file.txt" "silent"
assert_decision "hexdump" "hexdump -C binary.bin" "silent"
Expand Down
Loading