Skip to content

feat(agent): add bounded local browser use#3564

Open
richardsolomou wants to merge 3 commits into
mainfrom
posthog-code/feat/codex-computer-use
Open

feat(agent): add bounded local browser use#3564
richardsolomou wants to merge 3 commits into
mainfrom
posthog-code/feat/codex-computer-use

Conversation

@richardsolomou

@richardsolomou richardsolomou commented Jul 19, 2026

Copy link
Copy Markdown
Member

Problem

Local agents need browser automation without tying the capability to one model adapter. Image-heavy browser responses can also make long conversations exceed the gateway request limit.

Changes

I added opt-in isolated Playwright MCP support for local adapters, packaged its runtime, and kept responses on accessibility snapshots instead of embedding screenshots in conversation history.

How did you test this?

  • Ran the focused browser MCP test.
  • Ran pnpm build.
  • Connected to the real Playwright MCP and verified navigation, snapshots, and packaged startup.
  • Opened the app and checked the Advanced setting.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Add an opt-in isolated Playwright MCP server for every local agent adapter.

Generated-By: PostHog Code
Task-Id: 18a0ed17-2c63-4288-98b3-65563803ac72
@trunk-io

trunk-io Bot commented Jul 19, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ea99a7d.

Generated-By: PostHog Code
Task-Id: 18a0ed17-2c63-4288-98b3-65563803ac72
Keep browser automation on accessibility snapshots so repeated screenshots cannot inflate model requests past the gateway limit.

Generated-By: PostHog Code
Task-Id: 64d16b4c-2c25-4e05-ba9d-824311186124
@richardsolomou richardsolomou changed the title feat(agent): add local browser use feat(agent): add bounded local browser use Jul 19, 2026
@richardsolomou
richardsolomou marked this pull request as ready for review July 19, 2026 12:11
@richardsolomou
richardsolomou requested a review from a team July 19, 2026 12:17
name: BROWSER_USE_MCP_NAME,
command: process.execPath,
args: [
resolvePlaywrightMcpCli(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High: Codex can execute the MCP server's host-code tool without approval

@playwright/mcp@0.0.78 includes every core* tool, including browser_run_code_unsafe, which the package describes as RCE-equivalent. Codex has no MCP-specific approval gate and runs with danger-full-access on Windows and Linux, so a malicious repository or web page can prompt-inject the agent into invoking this tool and execute Node.js on the host without a permission dialog. --codegen none does not remove the tool; expose a filtered MCP surface that omits and rejects it, or do not attach this server to Codex until per-tool approval is enforced.

@veria-ai

veria-ai Bot commented Jul 19, 2026

Copy link
Copy Markdown

PR overview

This PR adds bounded local browser-use support for the agent by wiring in a Playwright MCP-based browser service. The changed code introduces the MCP server integration that lets the agent drive a local browser during tasks.

There is one open security issue, and it is significant: the exposed Playwright MCP tool surface includes a host-code execution tool that the agent can invoke without a separate approval gate. A malicious repository or web page could prompt the agent into running Node.js code on the host, giving this a clear remote-code-execution-style impact in the local agent environment. No issues have been addressed yet, so the PR still needs a tool-filtering or isolation change before this integration is safe to ship.

Open issues (1)

Fixed/addressed: 0 · PR risk: 8/10

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant