Description
I am running OpenCode on Windows using Git Bash.
I configured the global config file:
C:\Users[user].config\opencode\opencode.json
with:
{
"permission": {
"external_directory": "deny"
}
}
The intention is to prevent the model from reading files outside the current project directory.
When OpenCode is started inside a project folder, the restriction works correctly. Attempts to read files outside the project are blocked.
However, when OpenCode is started from another directory (for example D:), the model can still read files from other drives, such as:
C:\oc-perm-test\outside\secret.txt
even though external_directory is set to "deny".
Debug logs show that the following configuration files are loaded:
C:\Users\[user]\.config\opencode\config.json
C:\Users\[user]\.config\opencode\opencode.json
C:\Users\[user]\.config\opencode\opencode.jsonc
This suggests either:
the global config is not enforced correctly when OpenCode is started outside a project directory, or
Windows / Git Bash path handling affects the sandbox rule.
Plugins
None
OpenCode version
1.2.17
Steps to reproduce
1 Configure global config:
C:\Users\[user]\.config\opencode\opencode.json
{
"permission": {
"external_directory": "deny"
}
}
2 Start OpenCode from Git Bash inside a project folder:
C:\oc-perm-test\project
3 Ask OpenCode to read:
../outside/secret.txt
Result: correctly blocked.
4 Start OpenCode instead from:
D:\
5 Ask OpenCode to read:
C:\oc-perm-test\outside\secret.txt
Result: file is read successfully even though external directories should be denied.
Screenshot and/or share link
No response
Operating System
windows 11
Terminal
Git Bash though Windows Terminal
Description
I am running OpenCode on Windows using Git Bash.
I configured the global config file:
C:\Users[user].config\opencode\opencode.json
with:
The intention is to prevent the model from reading files outside the current project directory.
When OpenCode is started inside a project folder, the restriction works correctly. Attempts to read files outside the project are blocked.
However, when OpenCode is started from another directory (for example D:), the model can still read files from other drives, such as:
C:\oc-perm-test\outside\secret.txteven though external_directory is set to "deny".
Debug logs show that the following configuration files are loaded:
This suggests either:
the global config is not enforced correctly when OpenCode is started outside a project directory, or
Windows / Git Bash path handling affects the sandbox rule.
Plugins
None
OpenCode version
1.2.17
Steps to reproduce
1 Configure global config:
2 Start OpenCode from Git Bash inside a project folder:
C:\oc-perm-test\project3 Ask OpenCode to read:
../outside/secret.txtResult: correctly blocked.
4 Start OpenCode instead from:
D:\5 Ask OpenCode to read:
C:\oc-perm-test\outside\secret.txtResult: file is read successfully even though external directories should be denied.
Screenshot and/or share link
No response
Operating System
windows 11
Terminal
Git Bash though Windows Terminal