Repository navigation
Description
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
- Define a subagent whose allowlist is read-only plus the Code Mode channel, e.g.:
Confirm
permission: "*": deny read: allow glob: allow grep: allow execute: allow qmd_query: allow
opencode debug agentsreportsdeny browserfor it. - Spawn that subagent and ask it to call
browser.tabs.list. - Observe: the
browsernamespace is listed among the agent's tools, and the call is dispatched rather than refused. - 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.registerregisters every browser tool withoptions: { namespace: "browser"…, permission: "browser", codemode: true }.BrowserConnection.makeruns
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
github-actions commentedon Oct 5, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
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.
github-actions commentedon Oct 8, 2026
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.