Still struggling with shell executions #6463

Closed
opened 2026-02-16 18:04:18 -05:00 by yindo · 2 comments
Owner

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

Originally assigned to: @rekram1-node on GitHub.

Question

These are my permissions:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "ls*": "allow",
    "cat*": "allow",
    "head*": "allow",
    "sed*": "allow",
    "find*": "allow",
    "wc*": "allow",
    "grep*": "allow",
    "rg*": "allow",
    "mkdir*": "allow",
    "python*": "deny",
    "python3*": "deny",
    "pip*": "deny",
    "pip3*": "deny",
    "uv*": "deny",
    "dbt*": "deny",
    "npm*": "deny",
    "npx*": "deny",
    "pnpm*": "deny",
    "pnpx*": "deny",
    "yarn*": "deny",
    "bash": "ask",
    "rm": "ask",
    "xargs": "ask",
    "git push": "ask",
    "git rebase": "ask",
    "git reset": "ask",
    "git commit": "ask",
    "git clean": "ask",
    "bun": "ask",
    "node": "ask",
    "doom_loop": "ask",
    "external_directory": "allow"
  }
}

From the documentation I just can't understand what could be wrong and why the build agent still executes commands, i.e.:

Image

In my AGENTS.md for both project and system I've set this line:

# app Development Guidelines

IMPORTANT: You are in WSL2 shell, while the project is on Windows filesystem. You are allowed to only perform file read/write operations without running bash commands!!!

This example wasn't erosive, but it executes commands which can ruin virtualenv or node environment, which is why I'm writing, but also general concern.

Each model will try to find it's way on the path!

So how to use build mode, and not to worry about possible shell executions?

Originally created by @klonuo on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question These are my permissions: ```json { "$schema": "https://opencode.ai/config.json", "permission": { "ls*": "allow", "cat*": "allow", "head*": "allow", "sed*": "allow", "find*": "allow", "wc*": "allow", "grep*": "allow", "rg*": "allow", "mkdir*": "allow", "python*": "deny", "python3*": "deny", "pip*": "deny", "pip3*": "deny", "uv*": "deny", "dbt*": "deny", "npm*": "deny", "npx*": "deny", "pnpm*": "deny", "pnpx*": "deny", "yarn*": "deny", "bash": "ask", "rm": "ask", "xargs": "ask", "git push": "ask", "git rebase": "ask", "git reset": "ask", "git commit": "ask", "git clean": "ask", "bun": "ask", "node": "ask", "doom_loop": "ask", "external_directory": "allow" } } ``` From the documentation I just can't understand what could be wrong and why the build agent still executes commands, i.e.: <img width="1346" height="370" alt="Image" src="https://github.com/user-attachments/assets/0f2730df-6f17-44a5-9ef0-b1f97c701b53" /> In my AGENTS.md for both project and system I've set this line: ``` # app Development Guidelines IMPORTANT: You are in WSL2 shell, while the project is on Windows filesystem. You are allowed to only perform file read/write operations without running bash commands!!! ``` This example wasn't erosive, but it executes commands which can ruin virtualenv or node environment, which is why I'm writing, but also general concern. **Each model will try to find it's way on the path!** So how to use build mode, and not to worry about possible shell executions?
yindo added the windows label 2026-02-16 18:04:18 -05:00
yindo closed this issue 2026-02-16 18:04:18 -05:00
Author
Owner

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

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

  • #7063: Permission denied, yet command is executed regardless - Similar issue with denied permissions being ignored by build agent
  • #8832: opencode not respecting permissions - Git commands running despite deny configuration
  • #7474: [Security Bug] Subagent permissions not enforced - Configured restrictions ignored - Subagents spawned via task tool bypass permission restrictions
  • #6527: [Security Issue/Bug] Plan mode restrictions bypassed when spawning sub-agents - Demonstrates how subagents can ignore parent agent restrictions

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

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of existing issues. Please check: - #7063: Permission denied, yet command is executed regardless - Similar issue with denied permissions being ignored by build agent - #8832: opencode not respecting permissions - Git commands running despite deny configuration - #7474: [Security Bug] Subagent permissions not enforced - Configured restrictions ignored - Subagents spawned via task tool bypass permission restrictions - #6527: [Security Issue/Bug] Plan mode restrictions bypassed when spawning sub-agents - Demonstrates how subagents can ignore parent agent restrictions Feel free to ignore if none of these address your specific case.
Author
Owner

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

shell commands need to be nested in the bash permission, see example in https://opencode.ai/docs/permissions/#agents

@pschiel commented on GitHub (Jan 28, 2026): shell commands need to be nested in the `bash` permission, see example in https://opencode.ai/docs/permissions/#agents
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6463