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
{{ message }}
Repository navigation
New permission system issues with wildcards and glob patterns #7029
Below is the frontmatter in one of my agents. You can see the intent here is to deny the ability to write to any file or edit any file outside of the specific folders and filetypes I've globbed. I already checked and found one issue in the code is likely that you are using minimatch for the pattern matching, but that main issue is if you set "*": deny the whole tool no longer works. Specific patterns should take precedence over wildcard denys.
The core issue appears to be with how wildcard and glob patterns are processed in the new permission system, where specific patterns should take precedence over wildcard denies.
Feel free to ignore if none of these address your specific case.
So switching the ordering at least allowed the write tool to be recognized, but glob patterns like my changes folder do not work still. So switching was an improvement, but when it tried to write a markdown file to changes folder it was denied.
Just wanted to share my experience with this. The documentation does not make it clear that these read/edit/write permissions are relative to the workspace root, which is NOT always the directory you launch Opencode from. Opencode uses git rev-parse --git-common-dir to set the root, so patterns have to match from that directory.
repo-root/ [Git Root]
├── test_dir/ ❌ Pattern: */test_dir/*
│ └── file.md Does NOT match (no prefix before test_dir)
│
└── sub_dir/ [Working Directory - where Opencode launches]
└── test_dir/ ✅ Pattern: */test_dir/*
└── file.md DOES match (sub_dir/ matches the */)
External Repository (SECURITY ISSUE)
=====================================
/some/other/repo/ [Different Git Root]
└── any_dir/
└── test_dir/ ⚠️ Pattern: */test_dir/*
└── file.md ALSO MATCHES! (any_dir/ matches the */)
I think it's easy enough to manage the permissions now that I know, but it took a while to figure out and diving into the code to understand. My suggestions would be to 1. standardize external_directory permission (uses Instance.directory) and read/edit/write permissions (uses Instance.worktree), and 2. Update the permissions documentation to include a note about this. @rekram1-node
@shanepadgett Not sure if this applies to your situation, but also wanted to point out that the wildcard matching is a simple one, not like glob patterns. So yours should let you edit changes/some_dir/test.md but wouldn't let you edit changes/test.md.
Activity
github-actions commentedon Jan 6, 2026
This issue might be a duplicate of existing issues. Please check:
The core issue appears to be with how wildcard and glob patterns are processed in the new permission system, where specific patterns should take precedence over wildcard denies.
Feel free to ignore if none of these address your specific case.
malhashemi commentedon Jan 6, 2026
@shanepadgett I think it is about ordering see 6856
rekram1-node commentedon Jan 6, 2026
@shanepadgett try:
shanepadgett commentedon Jan 6, 2026
So switching the ordering at least allowed the write tool to be recognized, but glob patterns like my changes folder do not work still. So switching was an improvement, but when it tried to write a markdown file to changes folder it was denied.
kylerm42 commentedon Jan 7, 2026
Just wanted to share my experience with this. The documentation does not make it clear that these read/edit/write permissions are relative to the workspace root, which is NOT always the directory you launch Opencode from. Opencode uses
git rev-parse --git-common-dirto set the root, so patterns have to match from that directory.I had my agent set up like this:
This is my setup that's problematic with those permissions:
So after figuring out what the issue is, I changed my permissions to this:
Which leads to some other potential problems.
I think it's easy enough to manage the permissions now that I know, but it took a while to figure out and diving into the code to understand. My suggestions would be to 1. standardize
external_directorypermission (usesInstance.directory) and read/edit/write permissions (usesInstance.worktree), and 2. Update thepermissionsdocumentation to include a note about this. @rekram1-node@shanepadgett Not sure if this applies to your situation, but also wanted to point out that the wildcard matching is a simple one, not like glob patterns. So yours should let you edit
changes/some_dir/test.mdbut wouldn't let you editchanges/test.md.