Description
File permission rules defined in .opencode/opencode.json are not enforced when file operations (Write, Edit) are performed by Task tool subagents. This allows any "general" subagents to bypass explicit deny rules, which kind of a is a security concern.
Expected Behavior
Permission rules should propagate to Task subagents. Write/Edit calls matching "*": "deny" should be rejected.
Actual Behavior
The subagent successfully writes to denied paths. Only direct (non-subagent) file operations respect the permission configuration.
Impact
This completely undermines the user's attempt to enforce edit rules for opencode workflows that use the task tool. Users relying on permissions to protect sensitive files may not have any actual protection when subagents are involved.
Plugins
I am using a custom MCP, which allows read only view on my specific app's state.
OpenCode version
Opencode 1.4.7
Steps to reproduce
- Create an "opencode.json" settings file in the repository root without permission rules, but with something generic like a default model.
- Create another "opencode.json" under the path
.opencode/opencode.json with restrictive permissions:
{
"permission": {
"edit": {
"*": "deny",
"skills/*": "allow"
}
}
}
- Ask the assistant to perform a task that requires editing files both inside and outside the allowed path.
- When the assistant uses the Task tool to delegate work to a subagent, the subagent's Write/Edit calls succeed on files that should be denied (e.g., manifest.json at the repo root).
Screenshot and/or share link
No response
Operating System
Windows 11, WSL (Ubuntu 24.04.4 LTS)
Terminal
Windows Terminal (WSL)
Description
File permission rules defined in .opencode/opencode.json are not enforced when file operations (Write, Edit) are performed by Task tool subagents. This allows any "general" subagents to bypass explicit deny rules, which kind of a is a security concern.
Expected Behavior
Permission rules should propagate to Task subagents. Write/Edit calls matching "*": "deny" should be rejected.
Actual Behavior
The subagent successfully writes to denied paths. Only direct (non-subagent) file operations respect the permission configuration.
Impact
This completely undermines the user's attempt to enforce edit rules for opencode workflows that use the task tool. Users relying on permissions to protect sensitive files may not have any actual protection when subagents are involved.
Plugins
I am using a custom MCP, which allows read only view on my specific app's state.
OpenCode version
Opencode 1.4.7
Steps to reproduce
.opencode/opencode.jsonwith restrictive permissions:{ "permission": { "edit": { "*": "deny", "skills/*": "allow" } } }Screenshot and/or share link
No response
Operating System
Windows 11, WSL (Ubuntu 24.04.4 LTS)
Terminal
Windows Terminal (WSL)