Skip to content

plan agent runs amock and starts writing #10057

Closed

Description

@marcotroisi

Description

I was using the plan agent to, well, plan something. Suddenly, it spins up a subagent with write permissions and begins to make changes.

Plugins

opencode-gemini-auth (ecosystem)

OpenCode version

1.1.31

Steps to reproduce

Unsure if there's a way to reproduce it reliably. Normally, the plan agent does for me what it says on the tin. In this case, though, it decided to give itself greater permissions.

It may be just something that happens with Gemini 3 Pro (which I don't usually use for planning).

Screenshot and/or share link

Image

Files were changed:

Image

Operating System

Omarchy (Arch Linux)

Terminal

Alacritty

Activity

  1. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

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

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

  2. justfortheloveof commented on Jan 22, 2026

    @justfortheloveof
    Contributor

    You can control this with scoped permissions, for example:

      "agent": {
        "plan": {
          "permission": {
            "task": {
              "*": "ask",
              "general": "deny",
              "researcher": "allow"
            }
          }
        }
      },
    

    Where the above config would allow the "plan" agent to spawn "researcher" (custom subagent), deny spawning "general" subagents and ask for others.

  3. zQueal commented on Jan 27, 2026

    @zQueal

    Just experienced this issue as well, came here looking for solutions. I've written a @notify sub agent that uses curl to push text to the telegram bot API to send me messages via Telegram. It works great. But when I use it in tandem with my implementation sub agent (@implement) I come back and the @noify agent was reading and writing files, which is obviously extremely unwanted behavior.

    Since the sub agent uses curl to send information to the API bash needs to be enabled;

    tools:
      bash: true

    However, this seems to give the sub agent complete license to do whatever it wants regardless of what prompt its given.

    Scoped permissions that @justfortheloveof don't seem to work at all;

    "agent": {
        "notify": {
          "tools": {
            "read": true,
            "write": false,
            "edit": false
          }
        }
      },

    However, the sub agent simply uses other means to write to files:

    $ echo "This is a test file written by the notify agent." > "test_notify_write.txt"

    I have tried every way possible to deny this sub agents ability to write to files and no matter what I do, every time I try and use it, it will inevitably attempt to write to a file even though its only purpose is to send me notifications. I'm completely at a loss for words....

    For reference, in addition to setting "write": false, this is part of the prompt:

    You are a stateless bridge to the user's mobile device. You ensure critical reports reach the user by navigating Telegram's strict parsing rules. You are **ABSOLUTELY FORBIDDEN** from writing to files in any way. You may read files for context but **YOU MAY NOT WRITE TO THEM**, for any purpose, ever.
  4. github-actions commented on Mar 29, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions