GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Granular permissions not working (or documentation bad?) · Issue #20307 · anomalyco/opencode

Granular permissions not working (or documentation bad?) #20307

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Granular permissions not working (or documentation bad?)#20307
Copy link
Assignees
rekram1-node

Description

@mindplay-dk
mindplay-dk
opened on Mar 31, 2026
Issue body actions

Description

Here's what I'm doing:

Image

As you can see, the read permission for * is set to ask, and for src/* it's set to allow.

Yet for some reason, it's prompting me to read src/App.tsx.

The patterns are simple enough, and I'm pretty sure I'm doing what the docs suggest:

Image

I don't have a global config - this is a project config in opencode.json in the root of the project.

opencode debug config confirms this is the only config file being read.

opencode debug agent plan confirms the permissions have been applied.

I'm unsure about the meaning of the order of the rules? I noticed it's an array in the output from opencode debug agent - does the order matter? I asked people on the Discord, and they seemed to think it does - but this being a .json file, I can't see how the order would even be available to OpenCode? The order of object properties in JS is undefined.

According to the docs:

Rules are evaluated by pattern match, with the last matching rule winning.

This seems to imply the order matters?

Yet, in the same sentence:

A common pattern is to put the catch-all "*" rule first, and more specific rules after it.

Which seems to imply it doesn't matter, and specificity is what matters.

But what makes a rule more or less specific? The length of the matched pattern? It's not explained.

I've looked at all of the following issues:

#4642
#7029
#7554
#6856

Apparently there's been a lot of issues and changes and confusion?

Yet, I still can't find an explanation, and still can't seem to come up with a working configuration.

Plugins

none

OpenCode version

1.3.10

Steps to reproduce

You can try my config file if you like:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "stepfun/step-3.5-flash:free",
  "autoupdate": true,
  "permission": {
    "*": "ask",
    "list": "allow",
    "grep": "allow",
    "glob": "allow",
    "read": {
      "*": "ask",
      "src/*": "allow"
    },
    "edit": {
      "*": "ask",
      "src/*": "allow"
    },
    "lsp": "allow",
    "question": "allow",
    "skill": "allow",
    "bash": {
      "*": "ask",
      "git *": "deny"
    }
  }
}

Screenshot and/or share link

No response

Operating System

Zorin OS 18 (Ubuntu based)

Terminal

VS Code terminal

Reacted by Manuel Olguín Muñoz, Ph.D., Zachary Cutlip, Erik Kubica, Nicolas, Franco Ruggeri and Rostyslav Lesovyi

Activity

  1. mindplay-dk
    added
    bugSomething isn't working
    on Mar 31, 2026
  2. github-actions
    assigned
    rekram1-node
    on Mar 31, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 31, 2026
  4. github-actions commented on Mar 31, 2026

    @github-actions
    github-actionsBot
    on Mar 31, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Path-based read permissions not enforced; catch-all rules always take precedence #13646: Path-based read permissions not enforced; catch-all rules always take precedence — same problem with granular read/edit path rules not working as expected
    • How are permissions applied in order? #16157: How are permissions applied in order? — covers the same confusion about rule ordering semantics and JSON key ordering in the permission config
  5. jumski commented on Apr 4, 2026

    @jumski
    jumski
    on Apr 4, 2026
    More actions

    I observe the same issue! It was not happening on 1.2.27, seems related to the permission system rework

  6. molguin92 commented on Apr 10, 2026

    @molguin92
    molguin92
    on Apr 10, 2026
    More actions

    I am struggling with the same issue. I want to limit certain agents to only be able to modify files in certain directories, but the permission system does not seem to work at all for this.

  7. thdxr
    removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. draxxris commented on May 14, 2026

    @draxxris
    draxxris
    on May 14, 2026
    More actions

    I am experiencing the same thing, it wasn't happening a month ago. This used to work for my agent config. Now the LLM gets denied no matter what.

    ---
    name: Architect
    description: Agent for creating an implementation plan document
    mode: primary
    permission:
      bash:
        "mkdir -p plans": allow
      edit:
        "*": deny
        "plans/*.md": allow
    
    ---
    
  9. github-actions commented on Jul 13, 2026

    @github-actions
    github-actionsBot
    on Jul 13, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  10. github-actions
    closed this as not plannedon Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.