-
Notifications
You must be signed in to change notification settings - Fork 0
feat: align permission defaults with Claude Code #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,9 +6,116 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "permission": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Read operations: allow by default, deny sensitive files | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Mirrors Claude Code's Read allow + .env/.secrets deny | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "*": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".env": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".env.*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "**/.env": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "**/.env.*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "secrets/**": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "**/secrets/**": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Edit operations: allow by default (Claude Code's acceptEdits mode) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Deny migration files and sensitive configs | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "edit": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "*": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "packages/opencode/migration/*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".env": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".env.*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "**/.env": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "**/.env.*": "deny", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
+29
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| // File search: always allow (Claude Code allows Glob/Grep unconditionally) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "glob": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "grep": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "list": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Bash: pattern-based control mirroring Claude Code's Bash whitelist | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "bash": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "*": "ask", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // JS/TS toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "node *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "npm *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "npx *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pnpm *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "bun *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "bunx *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "yarn *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "turbo *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "tsc *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Python toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "python *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "python3 *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pip *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "pip3 install *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "uv *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Linters/formatters | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "eslint *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "prettier *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "biome *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Test runners | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "jest *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "vitest *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "playwright *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Git operations | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "git *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "gh *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // System utilities | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ls *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "wc *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "lsof *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "test *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "set *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "dig *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "nslookup *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cat *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "head *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| "tail *": "allow", | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+72
to
+74
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| "cat *": "allow", | |
| "head *": "allow", | |
| "tail *": "allow", | |
| // File-reading commands must not bypass sensitive-file deny rules | |
| "cat .env": "deny", | |
| "cat .env.*": "deny", | |
| "cat **/.env": "deny", | |
| "cat **/.env.*": "deny", | |
| "cat secrets/**": "deny", | |
| "cat **/secrets/**": "deny", | |
| "head .env": "deny", | |
| "head .env.*": "deny", | |
| "head **/.env": "deny", | |
| "head **/.env.*": "deny", | |
| "head secrets/**": "deny", | |
| "head **/secrets/**": "deny", | |
| "tail .env": "deny", | |
| "tail .env.*": "deny", | |
| "tail **/.env": "deny", | |
| "tail **/.env.*": "deny", | |
| "tail secrets/**": "deny", | |
| "tail **/secrets/**": "deny", | |
| "cat *": "ask", | |
| "head *": "ask", | |
| "tail *": "ask", |
Copilot
AI
Apr 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git push --force* won't match common force-push forms like git push origin main --force or git push --force-with-lease because the pattern requires --force immediately after git push. Since git * is allowed above, those commands would be allowed. Consider adding deny patterns such as git push * --force* (and potentially git push * --force-with-lease*) to reliably block force pushes.
| "git push --force*": "deny", | |
| "git push --force*": "deny", | |
| "git push * --force*": "deny", | |
| "git push * --force-with-lease*": "deny", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
read, patterns like.envand.env.*are unlikely to match because the Read tool checks permissions against an absolute file path (e.g./repo/.env). The**/.env*entries will work, but the non-globbed variants are effectively dead rules and can be misleading. Consider using patterns like*.env/*.env.*(as in the guardrails configs) or dropping the redundant entries to keep the rule set clear.