Skip to content

Paths in edit permissions don't work well for teams with varying paths #13888

Closed

Description

@jcowles

Description

If you're a team of people with your code at different paths and want to allow a specific path to be edited, you can do it like this:

    "edit": {
      "*": "ask",
      "some\\path\\to\\file\\**": "allow",
    },
```

But this doesn't work, because edit has workspace path (without drive letter) prefixed, like this `src\\some\\path\\to\\file\\file.txt`, so the only solution is to prefix the path with `**` but that's not the same permission I stated above, because it matches ANY prefix to the path.


### Plugins

_No response_

### OpenCode version

1.50.0

### Steps to reproduce

add this to your config
//
    "edit": {
      "*": "ask",
      "test\\**": "allow",
    },
```

run `opencode run "write the word FOO to test/permissions.txt"`

This command will fail, reporting that the permission required "ask" access and was auto-rejected, despite explicitly setting it to "Allow" above.

### Screenshot and/or share link

_No response_

### Operating System

Windows 11

### Terminal

WezTerm

Activity

  1. github-actions commented on Feb 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or closely related to existing issues. Please check:

    These issues describe related problems with path matching in the permissions system. Consolidating discussion may help identify if this is a single underlying bug affecting path pattern matching.

  2. jcowles commented on Feb 16, 2026

    @jcowles
    Author

    It would be nice if ".\path" implied the worktree root.

  3. jcowles commented on Feb 16, 2026

    @jcowles
    Author

    looking closer, this seems like a bug -- the edit tool has this:
    [path.relative(Instance.worktree, filepath)]

    Which makes me think this is a windows-specific bug wher path.relative just chops off the drive letter, rather than actually makeing the path relative.

  4. rekram1-node commented on Feb 16, 2026

    @rekram1-node
    Contributor

    I think there is a bug for permissions on windows specifically yeah. We will fix.

  5. github-actions commented on Apr 22, 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

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions