Is there a "Ban" command to not allow opencode to run specific command ? #8977

Closed
opened 2026-02-16 18:11:18 -05:00 by yindo · 4 comments
Owner

Originally created by @HEKPYTO on GitHub (Feb 10, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

I use opencode with gemini-pro-3-preview, is there a way to check that a command is not allow to be execute on opencode level ? since it always bypass my explicit instruction or prompt and always run specific command. So is there any implementation of this or documentation on this. Thanks in advance.

Originally created by @HEKPYTO on GitHub (Feb 10, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question I use opencode with gemini-pro-3-preview, is there a way to check that a command is not allow to be execute on opencode level ? since it always bypass my explicit instruction or prompt and always run specific command. So is there any implementation of this or documentation on this. Thanks in advance.
yindo added the docs label 2026-02-16 18:11:18 -05:00
yindo closed this issue 2026-02-16 18:11:18 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 10, 2026):

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

  • #9386: [FEATURE]: specify --tools on command-line for enabling/disabling tools
  • #12673: Feature: Granular Security Policies for Tool Execution
  • #8832: opencode not respecting permissions
  • #11397: [FEATURE]: Support regex in permissions configuration
  • #7407: [FEATURE]: Allow skills and commands to define scoped permission overrides

These issues discuss various approaches to restricting or controlling which commands/tools OpenCode is allowed to execute. Your use case about preventing the AI from bypassing instructions to run specific commands falls under this scope.

@github-actions[bot] commented on GitHub (Feb 10, 2026): This issue might be a duplicate of existing issues. Please check: - #9386: [FEATURE]: specify --tools on command-line for enabling/disabling tools - #12673: Feature: Granular Security Policies for Tool Execution - #8832: opencode not respecting permissions - #11397: [FEATURE]: Support regex in permissions configuration - #7407: [FEATURE]: Allow skills and commands to define scoped permission overrides These issues discuss various approaches to restricting or controlling which commands/tools OpenCode is allowed to execute. Your use case about preventing the AI from bypassing instructions to run specific commands falls under this scope.
Author
Owner

@HEKPYTO commented on GitHub (Feb 10, 2026):

is this #8832, but it seems like an recurring issues ?

@HEKPYTO commented on GitHub (Feb 10, 2026): is this #8832, but it seems like an recurring issues ?
Author
Owner

@ariane-emory commented on GitHub (Feb 10, 2026):

This is what the permissions system is for: https://opencode.ai/docs/permissions/

Ultimately, models cannot be controlled, though, and if they're feeling creative they can puzzle out ways to escape any restrictive permissions you set. That's just the nature of the game.

@ariane-emory commented on GitHub (Feb 10, 2026): This is what the permissions system is for: https://opencode.ai/docs/permissions/ Ultimately, models **cannot** be controlled, though, and if they're feeling creative they can puzzle out ways to escape any restrictive permissions you set. That's just the nature of the game.
Author
Owner

@HEKPYTO commented on GitHub (Feb 10, 2026):

Thanks @ariane-emory for fast response, I'm closing now.

@HEKPYTO commented on GitHub (Feb 10, 2026): Thanks @ariane-emory for fast response, I'm closing now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8977