Permission denied, yet command is executed regardless #4290

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

Originally created by @klonuo on GitHub (Jan 6, 2026).

Originally assigned to: @rekram1-node on GitHub.

My settings:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "bash": {
      "yarn": "deny",
      "npx": "deny",
      "pnpx": "deny",
      "npm": "deny",
      "pnpm": "deny"
    },
    "doom_loop": "ask"
  }

I've also set restriction to run these commands in project's instructions AGENTS.md, while this happens:

→ Read frontend/tests/admin-config.test.tsx 
The admin-config test is already fixed. Let me run the tests to verify:
# Run frontend tests to verify fixes
$ cd /mnt/c/Users/klo/projects/app/frontend && yarn test 2>&1 | head -100
yarn run v1.22.22
warning ../../../../package.json: No license field
$ vitest
⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯

So it runs yarn regardless all restrictions, and pollutes node_modules

Originally created by @klonuo on GitHub (Jan 6, 2026). Originally assigned to: @rekram1-node on GitHub. My settings: ```json { "$schema": "https://opencode.ai/config.json", "permission": { "bash": { "yarn": "deny", "npx": "deny", "pnpx": "deny", "npm": "deny", "pnpm": "deny" }, "doom_loop": "ask" } ``` I've also set restriction to run these commands in project's instructions AGENTS.md, while this happens: ``` → Read frontend/tests/admin-config.test.tsx The admin-config test is already fixed. Let me run the tests to verify: # Run frontend tests to verify fixes $ cd /mnt/c/Users/klo/projects/app/frontend && yarn test 2>&1 | head -100 yarn run v1.22.22 warning ../../../../package.json: No license field $ vitest ⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯ ``` So it runs `yarn` regardless all restrictions, and pollutes node_modules
Author
Owner

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

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

  • #7029: New permission system issues with wildcards and glob patterns - describes issues with the permission system not respecting deny patterns properly
  • #6873: auto upgrade to 1.1.1, surprise! commands no longer require approval - reports commands being executed despite permission restrictions being set
  • #6892: MCP tool permissions not working after migration from tools to permissions - describes the new permission system not properly applying restrictions

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

@github-actions[bot] commented on GitHub (Jan 6, 2026): This issue might be a duplicate of existing issues. Please check: - #7029: New permission system issues with wildcards and glob patterns - describes issues with the permission system not respecting deny patterns properly - #6873: auto upgrade to 1.1.1, surprise! commands no longer require approval - reports commands being executed despite permission restrictions being set - #6892: MCP tool permissions not working after migration from tools to permissions - describes the new permission system not properly applying restrictions Feel free to ignore if none of these address your specific case.
Author
Owner

@klonuo commented on GitHub (Jan 6, 2026):

Additionally, I've set:

  "permission": {
    "bash": {
      "rm": "ask"
    }
  }

Yet, it run rm to remove file without asking me

@klonuo commented on GitHub (Jan 6, 2026): Additionally, I've set: ```json "permission": { "bash": { "rm": "ask" } } ``` Yet, it run `rm` to remove file without asking me
Author
Owner

@aaronnewsome commented on GitHub (Jan 6, 2026):

check my issue above, posted by github-actions: https://github.com/anomalyco/opencode/issues/6873

@aaronnewsome commented on GitHub (Jan 6, 2026): check my issue above, posted by github-actions: [https://github.com/anomalyco/opencode/issues/6873](https://github.com/anomalyco/opencode/issues/6873)
Author
Owner

@morcth commented on GitHub (Jan 6, 2026):

I'm experiencing the same thing. New opencode user... I have:

"permission": {
    "bash": {
      "git push": "ask",
      "git commit": "ask"
    },
    "external_directory": "ask"
  },

in my config... been working fine for a few days and starting yesterday, commits go through without my approval. Oddly git push still asks for approval.

I have no bash: true in my config. Removing that is what helped @aaronnewsome in his ticket.

One thing I did do is add the Superpowers plugin but there isn't anything to overwrite my config. Will try uninstalling that and testing more.

@morcth commented on GitHub (Jan 6, 2026): I'm experiencing the same thing. New opencode user... I have: ``` "permission": { "bash": { "git push": "ask", "git commit": "ask" }, "external_directory": "ask" }, ``` in my config... been working fine for a few days and starting yesterday, commits go through without my approval. Oddly git push still asks for approval. I have no bash: true in my config. Removing that is what helped @aaronnewsome in his ticket. One thing I did do is add the Superpowers plugin but there isn't anything to overwrite my config. Will try uninstalling that and testing more.
Author
Owner

@rekram1-node commented on GitHub (Jan 6, 2026):

i think you need to add the wildcards:

"git commit *"

"git push" works because it does an exact match on the command

@rekram1-node commented on GitHub (Jan 6, 2026): i think you need to add the wildcards: "git commit *" "git push" works because it does an exact match on the command
Author
Owner

@jerome-benoit commented on GitHub (Jan 7, 2026):

It's a configuration syntax breaking changes not documented, nor expected.

@jerome-benoit commented on GitHub (Jan 7, 2026): It's a configuration syntax breaking changes not documented, nor expected.
Author
Owner

@DanOps-1 commented on GitHub (Jan 12, 2026):

看起来我们的权限系统存在一些问题,导致即使设置了明确的拒绝策略,某些命令仍然被执行了。根据其他用户的报告和我的观察,这可能是由于权限系统对通配符和glob模式处理不当,或者是配置语法发生了未记录的变更。

我注意到我的配置文件中明确拒绝了`yarn``npx``pnpx``npm``pnpm`命令,但在实际执行中,`yarn`命令仍然被执行,并污染了`node_modules`目录。此外,`rm`命令也执行了,但未按预期请求批准。

其他用户也遇到了类似的问题,例如`git commit`不再需要批准,尽管配置中设置了`ask`。有用户提到移除`bash: true`选项解决了问题,而另一位用户建议使用通配符来匹配命令。

为了解决这个问题,我建议:
1. 重新检查并更新权限配置,确保使用通配符正确匹配所有相关命令。
2. 确认配置语法是否符合最新要求,特别是对于`bash`相关的设置。
3. 如果问题仍然存在,考虑暂时禁用Superpowers插件,看看是否能恢复正常的权限控制。

我会尽快尝试这些解决方案,并更新结果。感谢大家的帮助!
@DanOps-1 commented on GitHub (Jan 12, 2026): ```markdown 看起来我们的权限系统存在一些问题,导致即使设置了明确的拒绝策略,某些命令仍然被执行了。根据其他用户的报告和我的观察,这可能是由于权限系统对通配符和glob模式处理不当,或者是配置语法发生了未记录的变更。 我注意到我的配置文件中明确拒绝了`yarn`、`npx`、`pnpx`、`npm`和`pnpm`命令,但在实际执行中,`yarn`命令仍然被执行,并污染了`node_modules`目录。此外,`rm`命令也执行了,但未按预期请求批准。 其他用户也遇到了类似的问题,例如`git commit`不再需要批准,尽管配置中设置了`ask`。有用户提到移除`bash: true`选项解决了问题,而另一位用户建议使用通配符来匹配命令。 为了解决这个问题,我建议: 1. 重新检查并更新权限配置,确保使用通配符正确匹配所有相关命令。 2. 确认配置语法是否符合最新要求,特别是对于`bash`相关的设置。 3. 如果问题仍然存在,考虑暂时禁用Superpowers插件,看看是否能恢复正常的权限控制。 我会尽快尝试这些解决方案,并更新结果。感谢大家的帮助! ```
Author
Owner

@DoiiarX commented on GitHub (Jan 31, 2026):

@DoiiarX commented on GitHub (Jan 31, 2026): 蹲
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4290