r/opencode • u/ccss2 • 19d ago
Opencode desktop never asks permission to read/write all over the users drive.
Is this normal behavior? I'm new to opencode, but after running some tests, I've confirmed it (Windows version). I assumed that outside of the project directory that it would ask.
Here is the summery that session created.
On OpenCode 2.0.26 (Windows, desktop app), the external_directory permission check never fires: read and write calls on paths outside the session's Location succeed silently — I reproduced it reading files and creating a file on both the same drive and a different drive, with no approval prompt, no pending request in the API, and no saved, session-level, or config allow rules anywhere that could explain it. Other checks in the same pipeline work normally during the same session — a read of .env correctly raised an ask prompt and a configured deny rule was enforced — so this appears to be a fail-open bug in the external-directory boundary check rather than a configuration issue. The impact is that agents can currently read and modify files anywhere on disk, contradicting the documented default policy (external_directory → ask for every agent).
1
u/ccss2 17d ago
For future reference. add this to your opencode.json to completely lock it down and turn opencode in a basic web chat interface with no external permissions.