anomalyco / anomalyco/opencode

Subagent escalating permissions

Open
#39,576 1 comment 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Jul 29, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When a agent calls a subagent to do a task it requires a tool that the subagent is explicity denied from using, the subagent is able to utilize the denied tool

Plugins

No response

OpenCode version

1.18.7

Steps to reproduce

Following the steps from Opencode docs, add a subagent such as

# ~/.config/opencode/agents/tester.md 
--- 
description: Reviews changes without modifying files
mode: subagent
model: "code"
color: "#ff6b6b"
steps: 8
permissions:
  - action: edit
    resource: "*"
    effect: deny
  - action: shell
    resource: "*"
    effect: deny
  - action: write
    resource: "*"
    effect: deny
---

Review for correctness, security, regressions, and missing tests.
List findings in severity order with file and line references.

Tell the main agent to modify a file using the subagent.
When subagent is called it will have the ability to use the edit tool which is denied.

Screenshot and/or share link
1. Main Agent calls subagent to edit file
Image
2. Subagent is able to edit file when permissions for edit are set to deny
Image
Operating System

MacOs

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.