Add default allowlist patterns for read-only operations#464
Add default allowlist patterns for read-only operations#464basre-velocity wants to merge 1 commit into
Conversation
Greptile SummaryThis PR extends the default
Confidence Score: 4/5Safe to merge with awareness of the read-allowlist asymmetry: The wildcard fix ( src/renderer/src/stores/useSettingsStore.ts — specifically the absence of Important Files Changed
Reviews (2): Last reviewed commit: "Add default allowlist patterns for read-..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c9eea5fba
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| 'grep: * in *', | ||
| 'glob: *' |
There was a problem hiding this comment.
Use slash-aware wildcards for grep/glob defaults
The new default patterns grep: * in * and glob: * do not actually auto-approve many common commands because the matcher treats * as [^/]* for non-bash tools (matchPattern), so any grep path like /workspace/hive or glob pattern like src/**/*.ts will miss the allowlist and still prompt. Since formatCommandString for grep/glob includes path/pattern text that often contains /, this change does not fulfill its stated goal for real-world inputs when command filtering is enabled; use ** where slash-containing arguments are expected.
Useful? React with 👍 / 👎.
Include read, grep, and glob patterns in default security allowlist so new users don't get prompted for safe read-only operations. - read: ** - auto-approve all file reads - grep: ** in ** - auto-approve all grep searches (matches paths with slashes) - glob: ** - auto-approve all glob file pattern searches Fixes issue where grep commands are formatted as "grep: <pattern> in <path>" and paths often contain slashes (e.g., "grep: foo in src/lib/utils"). Using ** wildcard allows matching paths with forward slashes. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2c9eea5 to
fda4f28
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fda4f28f19
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| allowlist: [ | ||
| 'edit: **', | ||
| 'write: **', | ||
| 'read: **', |
There was a problem hiding this comment.
Keep sensitive files out of read allowlist
When a user enables the command filter with the default ask behavior, this new broad read: ** allowlist entry auto-approves reads of every path, but the default blocklist only covers edit: and write: secrets such as .env, *.key, and credentials*. Since CommandFilterService.formatCommandString() emits reads as read: <path> and blocklist checks only help when a matching read: block exists, a request like read: /workspace/project/.env is silently allowed instead of prompting; add matching sensitive-file blocks for read (and any read-like defaults such as grep if intended) or narrow this default.
Useful? React with 👍 / 👎.
Summary
read: **,grep: * in *, andglob: *to default security allowlistProblem
Users who approved
grep: *were still being prompted because grep commands are actually formatted asgrep: <pattern> in <path>, so the pattern didn't match.Solution
Update default allowlist in
useSettingsStore.tsto include properly formatted patterns for common read-only operations:read: **- all file readsgrep: * in *- all grep searches (with correct format)glob: *- all glob file pattern searchesImpact
Test plan
🤖 Generated with Claude Code