GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — code mode: execute dispatcher bypasses ask permission for nested plugin tools · Issue #47177 · anomalyco/opencode

code mode: execute dispatcher bypasses ask permission for nested plugin tools #47177

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
code mode: execute dispatcher bypasses ask permission for nested plugin tools#47177
Copy link
Assignees
rekram1-node
Labels
2.0

Description

@CyberNekokoya
CyberNekokoya
opened on Sep 4, 2026
Issue body actions

Summary

In a Code Mode session, plugin tools invoked through the execute dispatcher do not surface the configured ask permission. A mutation tool declared with options.permission mapped to an ask rule executes silently, with no permission prompt in the client.

Environment

  • opencode version: 0.0.0-beta-18999 (opencode2, beta channel)
  • OS: Linux Cyber-Nekokoya 7.2.2-zen1-1-zen x86_64 (Arch)
  • Terminal: TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /usr/bin/zsh
  • Install/channel: beta (local @opencode-ai/cli)
  • Active plugins:
    • server (auto-discovered local): session-tools.ts, systemd-user-tools.ts
    • cli.json TUI plugins: ./plugins/sandbox-toggle, ./plugins/git-write-toggle

Reproduction

  1. Global opencode.jsonc has rules such as { "action": "systemd_user_start", "resource": "*", "effect": "ask" }.
  2. A server plugin exposes a tool with options: { permission: "systemd_user_start" } via context.tool.transform((e) => e.add(...)).
  3. In a Code Mode session, invoke that tool through the dispatcher, e.g. an execute block calling tools["systemd_user_start"]({ unit: "wivrn.service" }).
  4. Observe: the unit starts/stops successfully, and the client never shows an ask prompt (no permission.asked event; compare with early-session direct tool calls, which did produce asking id=per_... log lines).

Expected Behavior

The docs for the execute action state each nested tool still enforces its own permission. An ask rule should prompt the user (or be rejected when no interactive channel is available).

Actual Behavior

The ask rule is bypassed: mutation tools execute silently through the execute dispatcher. In our session systemd_user_start/stop for wivrn.service ran with no confirmation. Risk: any ask-class plugin tool is unenforced in Code Mode.

Additional Context

  • Reproducible consistently via execute.
  • Direct (non-dispatcher) tool calls in the same environment do prompt, so the bypass appears specific to the Code Mode dispatcher path.
  • No saved "allow always" approval exists for these actions; config rules are intact ask.
Reacted by Damian Stasik

Activity

  1. opencode-agent
    added
    2.0
    on Sep 4, 2026
  2. github-actions
    assigned
    rekram1-node
    on Sep 4, 2026
  3. github-actions commented on Sep 4, 2026

    @github-actions
    github-actionsBot
    on Sep 4, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of or closely related to existing issues. Please check:

    • permission.ask plugin hook is defined but not triggered #7006: permission.ask plugin hook is defined but never triggered — shares the same root area (plugin tool permissions not being enforced), though permission.ask plugin hook is defined but not triggered #7006 covers the hook not firing at all while this issue focuses specifically on the execute dispatcher path in Code Mode silently bypassing ask rules.
  4. CyberNekokoya commented on Sep 4, 2026

    @CyberNekokoya
    CyberNekokoya
    on Sep 4, 2026
    Author
    More actions

    Update: this is broader than the Code Mode dispatcher path. Local server plugin tools bypass the permissions engine entirely — not just the ask prompt, but deny rules too.

    Additional evidence (native tool path, not execute)

    With a local server plugin exposing tools that declare options.permission/codemode: false, and global permissions in opencode.jsonc:

    1. systemd_user_start with rule { action: "systemd_user_start", resource: "*", effect: "ask" } → executes silently, no permission.asked event (client polling GET /api/session/<id>/permission returns 404 the whole time).
    2. Same tool with the rule changed to effect: "deny" → still executes successfully.
    3. A read-only plugin tool with its rule changed to effect: "deny" → also still executes (confirms the engine is not being consulted at all for plugin tools).
    4. Control: a built-in tool (writing a file outside the workspace, edit + external_directory = ask) → prompts correctly in the same client/session.

    Conclusion

    Plugin-registered tools are invoked without permission evaluation regardless of execute vs native listing, and regardless of codemode. ask, deny, and allow rules have no effect on them. Built-in tools are unaffected. This makes permission enforcement for plugin tools unreliable end-to-end.

  5. neriousy commented on Oct 20, 2026

    @neriousy
    neriousy
    on Oct 20, 2026
    Member
    More actions

    Thanks for the report and for checking that both ask and deny rules are bypassed on direct plugin calls too. This is the same problem as #50652, where we're tracking plugin-tool permission enforcement; please subscribe there or add your deny-rule findings, which are useful extra details.

  6. neriousy
    closed this as a duplicateof External plugin tools bypass configured permissions #50652 on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

2.0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.