Read permission doesn't look to match when the agent uses ../.. paths #7889

Closed
opened 2026-02-16 18:08:34 -05:00 by yindo · 3 comments
Owner

Originally created by @dcapwell on GitHub (Jan 28, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I have the following in my global config

  "permission": {
    "read": {
      "/Users/dcapwell/.config/opencode/skills/**/*": "allow",
      "/Users/dcapwell/.config/opencode/skills/*": "allow",

The reason for this change is I created a skill that comes with docs/resources, and needs to search and read the files in the skill. The issue I am seeing is that the agent asks to read

Read ../../../../../../.config/opencode/skills/my-skill/references/AGENTS.md

This then pops up a permission prompt.

I then tried a simple prompt, show absolute path and asked it to read the file, and made sure to put the exact path in the read permissions; same issue.

"/path/to/file": "allow"

and prompt: read "/path/to/file" and tell me what it says

In this cases its also doing the ../.. read pattern and correctly detecting that its reading outside of the current directory and asked for permission.

Plugins

No response

OpenCode version

1.1.21

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @dcapwell on GitHub (Jan 28, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I have the following in my global config ``` "permission": { "read": { "/Users/dcapwell/.config/opencode/skills/**/*": "allow", "/Users/dcapwell/.config/opencode/skills/*": "allow", ``` The reason for this change is I created a skill that comes with docs/resources, and needs to search and read the files in the skill. The issue I am seeing is that the agent asks to read `Read ../../../../../../.config/opencode/skills/my-skill/references/AGENTS.md ` This then pops up a permission prompt. I then tried a simple prompt, show absolute path and asked it to read the file, and made sure to put the exact path in the read permissions; same issue. ``` "/path/to/file": "allow" ``` and prompt: `read "/path/to/file" and tell me what it says` In this cases its also doing the `../..` read pattern and correctly detecting that its reading outside of the current directory and asked for permission. ### Plugins _No response_ ### OpenCode version 1.1.21 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 18:08:34 -05:00
yindo closed this issue 2026-02-16 18:08:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7279: Bug: permission pathing crossplatform - Path matching fails with relative path resolution
  • #7876: Permission check for tool-output directory never matches - Similar pattern matching issue with wildcards
  • #9927: Agent Permission not work as expected - Permissions configuration not being respected
  • #5395: Split external_directory permission into read vs write - Related feature request about read permissions
  • #6900: skill can't find scripts path - Skills unable to locate files with relative paths
  • #7504: An agent is able to read all filesystem outside a project directory - Comprehensive permission bypass issue

The core issue appears to be that permission rules are not matching when paths are normalized to relative formats (with ../..) instead of being resolved to absolute paths. Feel free to ignore if your specific case differs from these.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #7279: Bug: permission pathing crossplatform - Path matching fails with relative path resolution - #7876: Permission check for tool-output directory never matches - Similar pattern matching issue with wildcards - #9927: Agent Permission not work as expected - Permissions configuration not being respected - #5395: Split external_directory permission into read vs write - Related feature request about read permissions - #6900: skill can't find scripts path - Skills unable to locate files with relative paths - #7504: An agent is able to read all filesystem outside a project directory - Comprehensive permission bypass issue The core issue appears to be that permission rules are not matching when paths are normalized to relative formats (with ../..) instead of being resolved to absolute paths. Feel free to ignore if your specific case differs from these.
Author
Owner

@dcapwell commented on GitHub (Jan 28, 2026):

I have tried the following, but don't see any difference (tried with and without *)

    "allowed_paths": {
      "/Users/dcapwell/.config/opencode/skills/**/*": "allow",
      "~/.config/opencode/skills/**/*": "allow"
    },

Still asking for read permission

Access external directory ~/.config/opencode/skills/my-skill/references

@dcapwell commented on GitHub (Jan 28, 2026): I have tried the following, but don't see any difference (tried with and without `*`) ``` "allowed_paths": { "/Users/dcapwell/.config/opencode/skills/**/*": "allow", "~/.config/opencode/skills/**/*": "allow" }, ``` Still asking for read permission > Access external directory ~/.config/opencode/skills/my-skill/references
Author
Owner

@dcapwell commented on GitHub (Jan 28, 2026):

ok found the doc on this: https://opencode.ai/docs/permissions#external-directories

Using that and the permissions are fixed!

@dcapwell commented on GitHub (Jan 28, 2026): ok found the doc on this: https://opencode.ai/docs/permissions#external-directories Using that and the permissions are fixed!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7889