Skip to content

Opencode ignoring deny permissions? #25515

Closed as not planned
Closed as not planned

Description

@mejobloggs-cw

Description

I was using my "Plan-Expensive" mode, and during planning I asked it to write a todo.md file expecting it to update the plan with a plan to write the todo.md file, but actually it created the file

        "plan-expensive": {
            "description": "A higher-capability planning mode for difficult design, refactoring, and codebase analysis tasks.",
            "mode": "primary",
            "model": "github-copilot/gpt-5.5",
            "variant": "high",
            "reasoningEffort": "high",
            "textVerbosity": "low",
            "permission": {
                "edit": "deny",
                "bash": "deny"
            }
        }

The docs (https://opencode.ai/docs/permissions/) say:

edit — all file modifications (covers edit, write, patch)

Why / How did it create the file when it was denied edit permission, which the docs say includes "write"?

Plugins

None

OpenCode version

1.14.33

Steps to reproduce

Create an agent with

"permission": {
                "edit": "deny",
                "bash": "deny"
            }

Then ask it to create a todo.md file saying "say hi"

It creates the file. I believe it should not have permission to create the file

Screenshot and/or share link

No response

Operating System

Debian

Terminal

No response

Activity

  1. github-actions commented on May 3, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from the above (e.g. it reproduces without subagents, or on a specific version), please note that in the issue.

  2. thdxr commented on May 3, 2026

    @thdxr
    Member

    can you share opencode debug config

  3. mejobloggs-cw commented on May 3, 2026

    @mejobloggs-cw
    Author

    opencode debug config

    {
      "$schema": "https://opencode.ai/config.json",
      "snapshot": false,
      "disabled_providers": [
        "opencode"
      ],
      "provider": {
        "copilot": {}
      },
      "model": "github-copilot/gpt-5.4",
      "agent": {
        "build": {
          "mode": "primary",
          "model": "github-copilot/gpt-5.4",
          "variant": "medium",
          "reasoningEffort": "medium",
          "textVerbosity": "low",
          "options": {
            "reasoningEffort": "medium",
            "textVerbosity": "low"
          },
          "permission": {}
        },
        "plan": {
          "mode": "primary",
          "model": "github-copilot/gpt-5.4",
          "variant": "high",
          "reasoningEffort": "high",
          "textVerbosity": "low",
          "permission": {
            "edit": "deny",
            "bash": "deny"
          },
          "options": {
            "reasoningEffort": "high",
            "textVerbosity": "low"
          }
        },
        "plan-expensive": {
          "description": "A higher-capability planning mode for difficult design, refactoring, and codebase analysis tasks.",
          "mode": "primary",
          "model": "github-copilot/gpt-5.5",
          "variant": "high",
          "reasoningEffort": "high",
          "textVerbosity": "low",
          "permission": {
            "edit": "deny",
            "bash": "deny"
          },
          "options": {
            "reasoningEffort": "high",
            "textVerbosity": "low"
          }
        }
      },
      "watcher": {
        "ignore": [
          ".git/**",
          ".vs/**",
          "bin/**",
          "obj/**",
          "node_modules/**",
          "dist/**",
          "build/**",
          "coverage/**",
          "**/*.map",
          "**/*.min.*",
          "*.log"
        ]
      },
      "mode": {},
      "plugin": [],
      "command": {},
      "username": "xxxx"
    }
    
  4. thdxr commented on May 3, 2026

    @thdxr
    Member

    i tested that config and it works fine. you might want to have it deny the task: { general: "deny"} so it can't spawn a subagent that can edit

  5. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    and removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. mejobloggs-cw commented on May 3, 2026

    @mejobloggs-cw
    Author

    With my config, using "Plan-Expensive", it will create a new file 100% of the time with the prompt:

    ```create a todo.md file that says hello world"``

    I confirm that by adding permission:

    "task": { "general": "deny"}

    Plan-Expensive can no longer create the file.

    But why does it ignore "edit": "deny" and "bash": "deny" ?

    It seems like a permissions vulnerability if an agent is explicitly denied write access, but can just spawn a subagent that's allowed write access

  7. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions