[BUG] opencode's folder permission control is not working #8024

Open
opened 2026-02-16 18:08:56 -05:00 by yindo · 1 comment
Owner

Originally created by @mask-maker on GitHub (Jan 30, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

The permission control for folders in opencode is not working. I set up opencode.json in the project root directory like this:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "edit": "ask",
    "bash": {
      "*": "ask",
      "env *": "deny",
      "env": "deny",
      "printenv *": "deny",
      "printenv": "deny",
      "export *": "deny",
      "echo *": "deny",
      "set *": "deny"
    },
    "read": {
      "*": "allow",
      "*.log": "deny",
      "APP-META/**": "deny",
      "logs/**": "deny",
      "app/config/**": "deny",
      "*.env": "deny",
      "*.env.*": "deny",
      ".env": "deny",
      ".env.*": "deny",
      "*.env.local": "deny",
      "*.env.example": "allow"
    }
  }
}

However, opencode can still directly read the contents of the APP-META folder.

Plugins

No response

OpenCode version

1.1.44

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

macOS 26.2

Terminal

No response

Originally created by @mask-maker on GitHub (Jan 30, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description The permission control for folders in opencode is not working. I set up opencode.json in the project root directory like this: ```json { "$schema": "https://opencode.ai/config.json", "permission": { "edit": "ask", "bash": { "*": "ask", "env *": "deny", "env": "deny", "printenv *": "deny", "printenv": "deny", "export *": "deny", "echo *": "deny", "set *": "deny" }, "read": { "*": "allow", "*.log": "deny", "APP-META/**": "deny", "logs/**": "deny", "app/config/**": "deny", "*.env": "deny", "*.env.*": "deny", ".env": "deny", ".env.*": "deny", "*.env.local": "deny", "*.env.example": "allow" } } } ``` However, opencode can still directly read the contents of the APP-META folder. ### Plugins _No response_ ### OpenCode version 1.1.44 ### Steps to reproduce _No response_ ### Screenshot and/or share link <img width="2914" height="664" alt="Image" src="https://github.com/user-attachments/assets/47ded5ac-0fb1-4823-8383-a8d93f4c1377" /> ### Operating System macOS 26.2 ### Terminal _No response_
yindo added the bug label 2026-02-16 18:08:56 -05:00
Author
Owner

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

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

  • #8832: opencode not respecting permissions - general issue with permissions not being enforced
  • #11218: Bash permission deny rules in agent config not being enforced - similar issue with deny rules not working
  • #7279: Bug: permission pathing crossplatform - cross-platform path matching issues in permission rules

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 30, 2026): This issue might be a duplicate of existing issues. Please check: - #8832: opencode not respecting permissions - general issue with permissions not being enforced - #11218: Bash permission deny rules in agent config not being enforced - similar issue with deny rules not working - #7279: Bug: permission pathing crossplatform - cross-platform path matching issues in permission rules Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8024