Skip to content

Conversation

@Mishkun
Copy link

@Mishkun Mishkun commented Nov 2, 2025

I've vibed a solution to fix #3218 to let user to read/writes files external to cwd instead of simply denying it

Examples:

  1. Ask for permission (default behavior)
{
  $schema: https://opencode.ai/config.json,
  permission: {
    edit: {
      enabled: allow,
      external_files: ask
    }
  }
}
  1. Allow all external file access
{
  $schema: https://opencode.ai/config.json,
  permission: {
    edit: {
      enabled: allow,
      external_files: allow
    }
  }
}

I also asks for permission with option to allow a read for session:

Screenshot 2025-11-02 at 20 18 46

Fixes #3218

…3218)

Implement a binary permission model (ask/allow/deny) that separates edit permissions from external file access control. This allows users to configure whether tools can read/write files outside the working directory.

Key changes:
- Add edit.external_files permission alongside edit.enabled
- Update config schema to support nested edit permission structure
- Add permission checks in read, write, edit, and patch tools
- Maintain backward compatibility with legacy edit: string format
- Add comprehensive tests for all external file scenarios
- Update TUI to display external file permission prompts

Defaults to external_files: ask for security while maintaining edit: allow for existing functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: ability to disable "File X is not in the current working directory" error

1 participant