Bug: permission pathing crossplatform #4403

Open
opened 2026-02-16 17:43:41 -05:00 by yindo · 2 comments
Owner

Originally created by @KoalaHao on GitHub (Jan 7, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

      "permission": {
        "edit": {
          "*": "deny",
          "myPath/*": "allow",

this fails to match on windows, because the path would be myPath\*

Plugins

No response

OpenCode version

1.1.6

Steps to reproduce

  1. windows
  2. set edit permission to deny, set a specific path with forward slash / to allow, eg myPath/*
  3. tell agent to edit a file in that path
    opencode denies edit
  4. set path to back slash, eg myPath\*
    opencode allows edit to that directory

Screenshot and/or share link

No response

Operating System

windows

Terminal

No response

Originally created by @KoalaHao on GitHub (Jan 7, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ``` "permission": { "edit": { "*": "deny", "myPath/*": "allow", ``` this fails to match on windows, because the path would be myPath\\* ### Plugins _No response_ ### OpenCode version 1.1.6 ### Steps to reproduce 1. windows 2. set edit permission to deny, set a specific path with forward slash / to allow, eg myPath/* 3. tell agent to edit a file in that path opencode denies edit 4. set path to back slash, eg myPath\\* opencode allows edit to that directory ### Screenshot and/or share link _No response_ ### Operating System windows ### Terminal _No response_
yindo added the windowsbug labels 2026-02-16 17:43:41 -05:00
Author
Owner

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

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

  • #6318: Limit tool (e.g. write, edit) permissions to specific folders - addresses the same permission path matching functionality
  • #5529: Add per-agent filesystem boundaries (allow/deny paths) - includes similar path-based permission requirements
  • #631: Windows Support - umbrella issue tracking all Windows compatibility problems

This bug highlights a critical flaw in path-based permission matching when using forward slashes on Windows systems. The path normalization issue affects the core functionality requested in those feature issues.

@github-actions[bot] commented on GitHub (Jan 7, 2026): This issue might be a duplicate of existing issues. Please check: - #6318: Limit tool (e.g. write, edit) permissions to specific folders - addresses the same permission path matching functionality - #5529: Add per-agent filesystem boundaries (allow/deny paths) - includes similar path-based permission requirements - #631: Windows Support - umbrella issue tracking all Windows compatibility problems This bug highlights a critical flaw in path-based permission matching when using forward slashes on Windows systems. The path normalization issue affects the core functionality requested in those feature issues.
Author
Owner

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

#6763 fixes this via path normalization

@pschiel commented on GitHub (Jan 28, 2026): #6763 fixes this via path normalization
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4403