You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Permission rules configured in opencode.json are not enforced on the glob tool when paths are provided via the path parameter. Other tools (read, bash, grep, edit) correctly respect these rules.
Plugins
No response
OpenCode version
1.14.31
Steps to reproduce
Configure opencode.json with permission rules to deny access to specific paths (e.g., external drives on Windows):
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"glob": {
"": "allow",
"D:/": "deny",
"E:/": "deny",
"D:": "deny",
"E:*": "deny"
},
"external_directory": {
"D:/": "deny",
"E:/": "deny"
}
}
}
Restart opencode to load the new config.
Attempt to glob files on the restricted drives:
glob with path="D:" pattern=""
glob with path="E:" pattern=""
Expected behavior:
The glob tool should be blocked by the permission rules, same as read and bash are. The glob tool receives the target directory via the path parameter, and permission rules should match against it.
Actual behavior:
The glob tool returns results from D:\ and E:\ without being blocked. The permission rules for glob only match against the pattern parameter, not the path parameter, so they are ineffective for restricting access to specific directories.
Other tools work correctly:
read with D:\ → correctly blocked ✅
bash with ls D:\ → correctly blocked ✅
glob with path="D:" → returns results ❌
Environment:
OS: Windows 11
OpenCode version: (latest)
The external_directory rule also does not block glob access to paths outside the working directory.
Suggested fix:
The glob permission rules should check both the pattern and the path parameter, similar to how read and edit check their filePath parameter. Additionally, external_directory should also be enforced when glob is called with a path outside the project working directory.
If your issue is distinct from these (specifically the path parameter of the glob tool not being checked against permission rules, as opposed to the pattern matching itself), please clarify the difference.
Activity
github-actions commentedon May 1, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from these (specifically the
pathparameter of the glob tool not being checked against permission rules, as opposed to the pattern matching itself), please clarify the difference.github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.