Skip to content

[Bug] Cmdlet permissions not working on Windows #36696

Closed as not planned
Closed as not planned

Description

@m21-cerutti

Description

Hello,

I tried to configure my opencode with windows cmdlet permissions but none seems to work.

Here my configuration :

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "*": "ask",
    //"read": "allow", // Not working
    "Read": "allow",
    //"glob": "deny", // Not working
    "Glob": "deny",
    "bash": {
      "*": "ask",

      // PowerShell read-only cmdlets
      //"Test-Path *": "allow",
      //"Test-Path*": "allow",
      //"Test*": "allow",

      // Explicit PowerShell invocations
      //"pwsh -Command Test-Path *": "allow", // Not working due to lack of " or '
      "pwsh -Command 'Test-Path*'": "allow", // Not working too
    },
  },
}

Also documentation is linux centered and don't handle this cases.
https://opencode.ai/docs/permissions/#granular-rules-object-syntax

Issue discovered at the same time #36690

Linked to:
#27575
#6676

Plugins

None

OpenCode version

1.17.18

Steps to reproduce

  1. Set a new project with opencode.jsonc (or unzip the one I gave)
  2. Ask to search files and test paths on windows, prompt :
    Test if TOTO.md exist with Test-Path cmdlet windows and read content.
  3. Permission "Test-Path" cmdlet is asked. <- Would be allowed with permissions

Modify prompt for pwsh

bug-permissions.zip

Screenshot and/or share link

Image Image Image Image

Operating System

Windows 11 25H2 26200.8655

Terminal

OpenCode vscode extension

Activity

  1. m21-cerutti commented on Jul 13, 2026

    @m21-cerutti
    Author

    Need to verify it also for agents (json + fontmatter)

  2. m21-cerutti commented on Jul 13, 2026

    @m21-cerutti
    Author

    Could be same problem as #36681 where permissions are not cumulative (since bash nested in permission)

  3. m21-cerutti commented on Aug 17, 2026

    @m21-cerutti
    Author

    Still relevant today, linked to closed #8832

  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

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