Skip to content

agents: browser tools exposed despite agent-level "deny browser" when the agent has execute #53294

Closed as not planned

Description

@qveys-claude-bot

Summary

A subagent that explicitly denies the browser (permission: {"browser": "deny"}) still receives the full browser namespace (45 tools) and its calls are dispatched — not denied — as soon as the agent is granted the execute (Code Mode) tool. execute is the only path to MCP tools, so any agent that needs MCP (e.g. a local search index) unavoidably gains desktop-browser control.

Environment

  • opencode version: 2.0.22
  • OS: Darwin 27.2.0 arm64 (macOS)
  • Terminal: TERM_PROGRAM=tmux, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: /bin/zsh
  • Install/channel: latest
  • Active plugins: none configured in opencode.json/opencode.jsonc; two local plugin files exist under ~/.config/opencode/plugins/ (graphify.js, session-date-prefix.js), neither touches the browser.

Reproduction

  1. Define a subagent whose allowlist is read-only plus the Code Mode channel, e.g.:
    permission:
      "*": deny
      read: allow
      glob: allow
      grep: allow
      execute: allow
      qmd_query: allow
    Confirm opencode debug agents reports deny browser for it.
  2. Spawn that subagent and ask it to call browser.tabs.list.
  3. Observe: the browser namespace is listed among the agent's tools, and the call is dispatched rather than refused.
  4. Inspect the child session's permissions in the local store (session_v2.permission) and see [{"action":"browser","resource":"*","effect":"allow"}].

Adding stronger agent-level denies (browser, browser*, browser.*) does not remove the namespace or block the call.

Expected Behavior

An explicit browser deny on the agent should block browser tools for that agent, or at minimum the session-level grant should not override an explicit agent-level deny.

Actual Behavior

The browser namespace stays available and the call is dispatched. In a CLI-only session it stops at the connection check:

[browser.disconnected] No desktop browser is connected to this session. Open this session in the desktop app and wait for it to connect. Then call browser.tabs.list({}). Repeating browser actions while disconnected will not help.

With a desktop browser attached to the session, the same call would succeed — meaning a read-only subagent can navigate, run browser.evaluate, upload/download files (≤5 MiB), etc.

Additional Context

The relevant logic appears in two places:

  • BrowserTools.register registers every browser tool with options: { namespace: "browser"…, permission: "browser", codemode: true }.
  • BrowserConnection.make runs
    agent.transform((a) => a.list().forEach((x) => x.permissions.push({action:"browser", resource:"*", effect:"deny"})))
    and, when a desktop browser attaches, appends a session-level
    session.update({ …, permissions: [..., {action:"browser", resource:"*", effect:"allow"}] }).

Because session permissions are evaluated after agent permissions (last match wins), the session-level allow neutralises the agent-level deny. Sessions that use execute were observed carrying this browser: allow grant in session_v2.permission.

Impact: restricted subagents (read-only vault/search agents) cannot be confined away from the desktop browser while also being allowed to reach MCP tools, since execute is required for MCP.

Workaround tried: none found — agent-level deny browser, browser*, and browser.* all failed to remove the capability.

Related: no upstream issue found for this specific interaction.

Activity

  1. added
    needs:compliance
    on Oct 5, 2026
  2. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Please use the Bug Report issue template, which requires a Description field with real content. The current report has a substantive Summary, but does not include the required Description field.

    Please edit this issue to address the above within 72 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. github-actions commented on Oct 8, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window.

    Feel free to open a new issue that follows our issue templates.

  4. removed
    needs:compliance
    on Oct 8, 2026
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