Skip to content

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

Closed

Description

@dcapwell

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

Activity

  1. github-actions commented on Jan 28, 2026

    @github-actions
    Contributor

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

    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.

  2. dcapwell commented on Jan 29, 2026

    @dcapwell
    Author

    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

  3. dcapwell commented on Jan 29, 2026

    @dcapwell
    Author

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

    Using that and the permissions are fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions