Skip to content

external_directory permission bypassed by bash wildcard rules #17497

Closed as not planned

Description

@Silvia0226

Description

Bug Description

The external_directory permission setting is bypassed when bash commands have wildcard rules like "ls*": "allow".

Expected Behavior

When external_directory: "ask" is set, accessing directories outside the working directory should prompt for approval, even for commands like ls or cat.

Actual Behavior

Bash wildcard rules like "ls*": "allow" match first and allow the command without checking if it accesses external directories.

Configuration

{
  "permission": {
    "bash": {
      "*": "ask",
      "ls*": "allow",    // This bypasses external_directory check
      "cat*": "allow"    // Same issue
    },
    "external_directory": "ask"
  }
}


### Plugins

no plugins

### OpenCode version

1.2.26

### Steps to reproduce

1. Set external_directory: "ask" in config
2. Set "ls*": "allow" under bash permissions
3. Run ls /tmp or ls ~ - command executes without prompt
4. Expected: Should prompt because accessing external directory

### Screenshot and/or share link

_No response_

### Operating System

macOS 15.7.3

### Terminal

Apple_Terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 14, 2026
  2. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. github-actions commented on Jul 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions