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
[FEATURE]: Treat permission path patterns as proper glob patterns, with support for both relative and absolute patterns. #22465
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
At the moment, permission path matching does not behave like standard glob matching.
This has several downsides, among which the inability to specify a pattern that only matches everything inside the worktree, but not outside the worktree.
The problem
A * is currently replaced with a .* in regex, matching everything including multiple directories and ../.
It is not possible to specify a pattern that matches an absolute path for the "edit" section, which is only matched against the path relative to the current worktree.
Some permission keyword's patterns are matched against absolute paths, others are matched against relative paths.
Current situation
permission keyword:
"read" : matched against the absolute target path.
"edit" : matched against a path relative to Instance.worktree.
"external_directory" — matched against an absolute directory glob.
"list" — matched against the absolute directory being listed.
Proposal
Unify all filepath matching as true globbing, including support for a globstar (**).
This can achieved with the already existing path.matchesGlob in typescript.
I closed #22336 in favor of this one although it has an orthogonal component that I think we should keep, namely that (glob) patterns that return true when passed to path.isAbsolute should be matched to the absolute filepath, otherwise to the relative filepath. And treat everything the same (read, edit, external_directory, list). Doing that then also addresses #20045 completely.
Activity
github-actions commentedon Apr 14, 2026
This issue might be a duplicate of existing issues. Please check:
editpermission patterns, including absolute path support and worktree-boundary enforcementedit(relative paths) andexternal_directory(absolute paths) permission matching — the same root problem described hereCarloWood commentedon Apr 14, 2026
I closed #22336 in favor of this one although it has an orthogonal component that I think we should keep, namely that (glob) patterns that return true when passed to
path.isAbsoluteshould be matched to the absolute filepath, otherwise to the relative filepath. And treat everything the same (read, edit, external_directory, list). Doing that then also addresses #20045 completely.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.