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
The permission system for external_directory in opencode.json only blocks file writes via the write/edit tools for non-permitted directories, but allows bash commands to create files outside permitted directories as a side effect.
Steps to Reproduce
Set up opencode.json with limited external_directory permissions:
Run a bash command that creates files outside permitted directories:
python3 -m venv /home/user/venv
The venv is created successfully in /home/user/, bypassing the permission system.
Expected Behavior
The write/edit tools correctly block writes to non-permitted directories
However, bash commands that create files as a side effect should also be blocked or require confirmation
A configuration like write_confirmation_required: true at the permission level (or equivalent) should apply to all write operations including those via bash
Additional Context
The permission model is incomplete - it separates "direct file writes" (via tools) from "indirect file writes" (via bash commands). This creates a gap where users can inadvertently create files outside permitted directories.
Activity
github-actions commentedon Mar 20, 2026
This issue might be a duplicate of existing issues. Please check:
external_directorypermission being bypassed by bash commands (different trigger, same permission gap)github-actions commentedon Jul 4, 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.