anomalyco / anomalyco/opencode
write/edit/read submit relative paths so absolute and ~ permission rules never match out-of-worktree files
Open
@nexxeln is already working on this.
Since Aug 7, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
write, edit, and read pass file paths to the permission layer as path.relative(worktree, filePath). Files outside the worktree are therefore submitted as ../... patterns (e.g. ../.ssh/id_ed25519). Absolute and ~/$HOME-expanded permission rules such as "~/.ssh/**": "deny" never match those relative forms, so a deny rule can be bypassed when a tool edits an out-of-worktree file at a relative path.
Steps to reproduce
- Configure a permission rule denying an absolute or
~-expanded path, e.g."~/.ssh/**": "deny". - In a session whose worktree is not the home directory, attempt an
edit/write/readon a file under that path via a relative/toolspath. - Observe that the rule does not match the relative submission.
Expected
Rules match regardless of whether the tool passed the path as a relative ../ form, an absolute form, or a ~-expanded form.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.