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
{{ message }}
Repository navigation
external_directory: "deny" not enforced when running OpenCode from Git Bash on Windows #16126
I second this. Oh and a warning, opencode deleted my /home/bm/Downloads folder with rm -rf without asking. Advice: restrict rm. This folder issue is also an important security flaw. It should perhaps be considered severe.
i also have this problem! Very critital security issue!! it appears also on 1.2.20 on my system with that config (played around a lot with them already, also with the help from opencode itself, but could not fix the behaviour).
when i start opencode from d:\git i can access (read/write) on c:\windows - even when i set external_directory to "deny". when i set it to "ask" i never get asked!
windows 10 iot enterprise ltsc 21h2 + windows 11 25h2
User reports: external_directory: "deny" works when inside a project, but completely bypassed when started from another drive (e.g., starting from D:\ allows reading C:\ files)
"In a Windows environment with mixed paths (Windows, MSYS/GitBash) the Wildcard/Permission system breaks in several cases (relative paths, absolute paths / cross-drive) due to path mismatching"
Users report external_directory: "ask" worked for weeks then suddenly stopped enforcing
Status: OPEN
Reddit post (11 hours ago!) - "Opencode security/permission broken (1.2.27)?"
"Started from d:\git and asked for E: drive - and it could! why is this setting ignored?"
THE FAILED FIX:
PR #6763 "fix(windows): path handling fixes for Windows" attempted to fix this with path normalization. However:
The contributor closed it in Feb 2026 stating: "they apparently prefer their own thing, closing this one - getting no replies since december. despite all the things clearly broken"
On Mar 6, 2026, @Hona commented: "Yes it's nots far off"
CURRENT STATUS:
The permission system on Windows has fundamental path handling bugs that cause external_directory checks to fail when:
Mixed path formats are used (backslashes vs forward slashes)
Try to set up something like that - restrict Opencode to only have access to the working dir and another directory. Everything else should be blocked. It simply does not work! Sometimes it works, but then after a restart of Opencode it does not work anymore!
ALL of these issues i have with permissions are tested NOT WORKING on Windows with Terminal, not with GIT Bash. no matter what i configure - I can't achieve to have Opencode only access to working dir + 1 other directory. All other access to any folder should not be allowed. Opencode itself confirmed several times, that my permission config is correct, but that there are bugs in permissions of Opencode. Please fix it, I don't want to use Opencode with massive security issues like that.
Activity
621625 commentedon Mar 17, 2026
I second this. Oh and a warning, opencode deleted my /home/bm/Downloads folder with rm -rf without asking. Advice: restrict rm. This folder issue is also an important security flaw. It should perhaps be considered severe.
621625 commentedon Mar 17, 2026
I'm on Linux.
Helios12345 commentedon Mar 21, 2026
i also have this problem! Very critital security issue!! it appears also on 1.2.20 on my system with that config (played around a lot with them already, also with the help from opencode itself, but could not fix the behaviour).
when i start opencode from d:\git i can access (read/write) on c:\windows - even when i set external_directory to "deny". when i set it to "ask" i never get asked!
windows 10 iot enterprise ltsc 21h2 + windows 11 25h2
"permission": { "read": { "D:\\git\\**": "allow", "*.env": "deny", "*.env.*": "deny" }, "edit": "allow", "bash": "allow", "external_directory": "deny", "webfetch": "allow", "websearch": "allow" }what opencode suggested:
`Based on my research, this is a confirmed and widespread bug in OpenCode on Windows. Here's what I found:
CONFIRMED ISSUES:
CURRENT STATUS:
The permission system on Windows has fundamental path handling bugs that cause external_directory checks to fail when:
Workaround: None available. This is a core platform bug that requires an official fix from the OpenCode team.
Recommendation: Report this at https://github.com/anomalyco/opencode/issues referencing issue external_directory: "deny" not enforced when running OpenCode from Git Bash on Windows #16126`
Helios12345 commentedon Mar 21, 2026
Try to set up something like that - restrict Opencode to only have access to the working dir and another directory. Everything else should be blocked. It simply does not work! Sometimes it works, but then after a restart of Opencode it does not work anymore!
The whole permission section is really buggy.
Helios12345 commentedon Mar 22, 2026
ALL of these issues i have with permissions are tested NOT WORKING on Windows with Terminal, not with GIT Bash. no matter what i configure - I can't achieve to have Opencode only access to working dir + 1 other directory. All other access to any folder should not be allowed. Opencode itself confirmed several times, that my permission config is correct, but that there are bugs in permissions of Opencode. Please fix it, I don't want to use Opencode with massive security issues like that.
kennethac commentedon Mar 27, 2026
I'm also having this issue in Windows Terminal running OpenCode from PowerShell 7, no git bash involved.
pschiel commentedon Mar 28, 2026
the dude keeps telling "next week" since several months. it's a lie, it's not going to happen. their "fixes" so far even introduced more bugs.
PhilWheat commentedon Apr 25, 2026
Still no progress?
github-actions commentedon Jul 5, 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.