anomalyco / anomalyco/opencode

write/edit/read submit relative paths so absolute and ~ permission rules never match out-of-worktree files

Open
#41,067 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Configure a permission rule denying an absolute or ~-expanded path, e.g. "~/.ssh/**": "deny".
  2. In a session whose worktree is not the home directory, attempt an edit/write/read on a file under that path via a relative /tools path.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.