OpenCode Browse Safe Setup: Isolating Coding Agents From Your Signed-In Browser
OpenCode Browse lets coding agents drive your real, signed-in browser. That makes it convenient, and it also makes it risky. This guide sets out an OpenCode Browse safe setup built on the Five-Layer Containment Model: Profile, Scope, Mode, Handoff and Cleanup. It explains what allowedOrigins and readOnly do not protect against and ends with a pre-flight checklist.
OpenCode Browse lets a coding agent work inside the browser you already use, signed in to your GitHub, your cloud console and whatever else lives in that profile. Any page the agent reads can try to steer what it does with those sessions.
Containing that risk without losing the convenience is the job of what we call the Five-Layer Containment Model: Profile, Scope, Mode, Handoff and Cleanup. Each layer shrinks what a bad session can reach.
Besides the README and release notes, we draw on two independent write-ups: a hands-on review that tested Browse in several MCP clients, and a comparison with Playwright MCP and Chrome DevTools MCP. Their figures are snapshots, so check star counts, release numbers and anything else you rely on against the Browse repository.
What OpenCode Browse Actually Hands to Your Agent
Browse connects AI agents to your real browser, including your tabs, logins and extensions, through a small native MCP server and a Chromium extension. It works with OpenCode, Claude Code, Codex, Cursor and any other MCP client. Anomaly, the company behind OpenCode, announced it on November 7, 2026, and the code is on GitHub under the MIT license.
The build is lean. Since version 0.1.0, the CLI, the relay and the MCP server have shipped as one Rust binary of a few megabytes, with no Node.js and no Playwright underneath. The project's release notes confirm that Browse has not used Playwright since 0.1.0.
The design choice that matters most is whose browser gets driven. Browse drives your real, signed-in browser and hands the tab to you for logins and payments, while Playwright MCP launches its own browser with its own profile, built for repeatable automation. In practice, every account signed in to the agent's profile is within reach. If that profile holds an admin session for your cloud console, a page that steers the agent is steering an admin.
Capabilities also vary by client. In the hands-on review, OpenCode was offered 26 tools with 41,415 bytes of tool definitions, while Claude Code, Codex and Cursor were offered 3 tools with 7,495 bytes.
Why a Signed-In Browser Changes the Threat Model
OWASP describes indirect prompt injection as what happens when an LLM accepts input from external sources such as websites or files. A browsing agent does this all day.
Brave's research on agentic browsers found that when an AI assistant follows malicious instructions from untrusted webpage content, traditional protections such as same-origin policy and CORS are effectively useless. Those protections assume a request from your session reflects your intent. Nor do the instructions need to be visible. In one attack, Brave hid prompt injection instructions in images using faint light blue text on a yellow background.
Then there is data flow, which applies to any browser MCP: whatever page text your agent reads goes to its model provider. If agents must work near inboxes, HR tools or other systems holding personal data, screen their prompts and tool calls for PII.
The MCP specification sets a cautious baseline of its own. It states that tools represent arbitrary code execution and that descriptions of tool behavior, such as annotations, should be considered untrusted unless they come from a trusted server.
Neither OWASP nor Brave promises prevention. OWASP says it is unclear whether foolproof methods of preventing prompt injection exist. Brave is blunter: until safety improves across browsers, agentic browsing will be inherently dangerous and should be treated that way. So design on the assumption that some injection will land. Our guide to testing instruction and data separation against prompt injection shows how to check the model side, but model-level resistance doesn't replace the layers below.
The Five-Layer Containment Model: A Step-by-Step Hardened Setup
The model groups seven practical steps into five layers:
- Profile (Steps 1 to 3): which browser identity, accounts and pairing the agent gets.
- Scope (Step 4): where the agent's tabs can go.
- Mode (Step 5): whether the agent can type and click.
- Handoff (Step 6): which actions always come back to a human.
- Cleanup (Step 7): how long access lingers after a task.
One check sits beside the layers rather than inside them: client setup, meaning the MCP client itself and every other server or add-on it runs next to Browse.
No single layer holds on its own. If a page on an allowed origin misbehaves, the profile and mode limits still apply to it. Syntax can change between releases, so confirm option names and defaults in the Browse README for the version you install.
Step 1 (Profile): Create a dedicated agent profile
Chrome profiles keep bookmarks, history, passwords and other settings separate. Install the Browse extension only in a profile made for agent work. The hands-on reviewer said they would not add it to their main browser profile yet, because everything they are signed in to lives there and what an agent reads on a page can try to steer it. We agree with that call.
Step 2 (Profile): Sign in only where the task needs it
A profile with no logins exposes little. It also does little, so the real work in this step is choosing which accounts go in.
Add accounts one task at a time, and for each one ask what the agent could do with it if a page steered it badly. Usually that leads to the same choices:
- Prefer test, sandbox or staging accounts over production ones.
- Where a production account is unavoidable, use the lowest role that still completes the task, and keep admin, billing and owner roles out of the profile.
- Be careful with single sign-on. One signed-in identity provider session may open many connected apps, so it widens reach far more than a single tool login.
- Sign out when the task is done instead of letting accounts pile up.
Brave recommends isolating powerful agentic capabilities from regular browsing, and making that separation obvious to the user.
Step 3 (Profile): Pair deliberately
A pairing code works once, within 10 minutes, and five wrong codes in a row void every pending code. Start pairing yourself, finish promptly and never paste codes into chat or tickets. A pairing prompt you didn't start is a reason to stop and investigate.
Step 4 (Scope): Limit every session with allowedOrigins
Set allowedOrigins to a short list of origins you trust and the task needs. For a docs-research task, that means the one or two documentation sites the agent will actually read, written as exact origins rather than a whole company domain or a broad wildcard. This snippet is illustrative, not copied from the Browse documentation, and the domain is a placeholder:
{
"allowedOrigins": ["https://docs.example.com"],
"readOnly": true
}Step 5 (Mode): Default risky sessions to readOnly
Research and summarizing rarely need the agent to type or click, so make readOnly the default for them. Writes belong in short, supervised sessions, such as updating a record on a staging site while you watch, with the origin list kept just as tight:
{
"allowedOrigins": ["https://staging.example.com"],
"readOnly": false
}One gap stays open either way: readOnly does not stop eval.
Step 6 (Handoff): Route logins, 2FA and payments to a human
When it is your turn, for a login, a 2FA prompt or a payment, Browse hands the tab back to you and continues once you click Continue. Use that instead of storing credentials anywhere the agent can read them. Where a workflow genuinely needs API access, a credential proxy that keeps API keys out of the agent is a far better pattern than pasting secrets into its context.
Step 7 (Cleanup): Treat idle cleanup as a backstop
Tabs nobody touches for 10 minutes close by themselves, but never while something is running on them. Treat that as a safety net for forgotten tabs. Closing agent tabs yourself when a task ends is still your job, since tab-closing behavior can differ by client.
Verify the local transport yourself
Browse ships a relay alongside its MCP server. Check the README for how the two connect to your MCP client in your version. As a yardstick, MCP security guidance says locally run servers should guard against unauthorized use by malicious processes, for example by using the stdio transport to limit access to the MCP client. No local endpoint should be reachable more widely than the client needs.
What allowedOrigins and readOnly Leave Open
The maintainers describe these two controls as guardrails, not a data boundary. allowedOrigins limits navigations, top-level documents and the tabs and popups an agent opens. Requests a page makes itself, including fetch, XHR, images, scripts and iframes, are not filtered.
The hands-on review saw the same thing in testing. The tab stayed where allowedOrigins kept it, while JavaScript in the page could still make requests anywhere. With readOnly on, input was blocked and eval still ran code in the page.
| Control | Layer | What it limits | What it does not stop |
|---|---|---|---|
| Dedicated profile | Profile | Which accounts and saved data the agent can reach | Injection from pages loaded inside that profile |
| allowedOrigins | Scope | Where the agent's tabs can go | Requests the page itself makes |
| readOnly | Mode | Input from the agent | Code run through eval |
So a malicious or compromised page on an allowed origin can still send out whatever it can see. Keep origin lists narrow and task specific, keep readOnly for reading, and grant write access only when someone is watching.
Human Handoff for Logins, 2FA, Payments and Bot Checks
Bot challenges go through the same handoff as logins, 2FA prompts and payments. After a navigation, Browse reports Cloudflare checks, captcha walls and access denied pages and tells the agent to hand interactive ones to you. It never solves them. This design matches Brave's guidance that, no matter the agent's prior plan, the model should require explicit user interaction for security and privacy sensitive tasks.
For day-to-day work, we think the handoff is the most useful safety feature Browse has, and two habits make it stronger. First, check the URL and the page yourself before clicking Continue, so you know exactly where you are signing in or paying. Second, keep a written team list of human-only actions: payments, credential changes, sharing settings and anything that deletes data should never run unattended.
Common Mistakes When Rolling Out Browse
- Installing in the daily profile (Profile). Every signed-in account there becomes reachable.
- Treating allowedOrigins as a data firewall (Scope). It governs tab navigation, and pages on allowed origins can still send requests anywhere.
- Assuming readOnly means nothing changes (Mode). eval still runs.
- Approving pairing casually (Profile). Approve only pairing you started.
- Trusting unvetted tool metadata (client setup). The MCP specification treats tool annotations as untrusted unless they come from a trusted server, and that applies to every server you add next to Browse.
- Using Browse for CI. Repeatable pipelines fit better with a tool that launches its own browser and profile, such as Playwright MCP.
Caveats and Limits You Should Plan Around
In the independent comparison, Browse had about 770 GitHub stars, compared with about 39,800 for Playwright MCP and about 57,900 for Chrome DevTools MCP. Stars are only a rough adoption signal, so look elsewhere for evidence of security review.
The comparison also described Browse as about three weeks old while the alternatives had long track records, which matters if you need stable behavior in CI. Since the public announcement came on November 7, 2026, that age figure suggests the repository was public earlier, so the announcement date may not mark the first release. We haven't confirmed the first release date; check the release history if it matters to you.
Versions move quickly too. That comparison listed v0.1.0 as the latest Browse release. Releases can move on quickly at this stage, so we suggest rechecking the README and release notes before relying on any behavior described here.
Test your hardening per client, since clients see different tool sets. A configuration you validated in Claude Code, with its 3 tools, is not automatically validated for OpenCode with 26. Cleanup belongs in that testing. In the hands-on review, Claude Code closed the tab when its task was done. Don't assume every other client does the same.
No configuration removes prompt injection risk. The steps in this guide reduce exposure without guaranteeing safety. Say so plainly in your internal policy.
Pre-Flight Checklist Before Every Agent Browsing Session
Run through this before each session.
- [ ] Profile: I am in the dedicated agent profile, signed in only to what this task needs.
- [ ] Profile: Any tab I would not want sent to the model provider is closed.
- [ ] Profile: I started any pairing myself and completed it within the 10 minute window.
- [ ] Client setup: Every other MCP server and add-on in this client comes from a source I trust. Our editor extension triage guide covers vetting and locking down third-party agent add-ons.
- [ ] Scope: allowedOrigins is set to a short list of trusted domains for this task.
- [ ] Mode: This session is readOnly unless writing is required, and I remember that eval still runs.
- [ ] Handoff: I know which steps (login, 2FA, payment, captcha) will come back to me, and I will check the URL and page before clicking Continue.
- [ ] Cleanup: I will close agent tabs when the task ends and sign out of accounts I no longer need.
Key Takeaways
- OpenCode Browse gives agents your real tabs, logins and extensions through a native MCP server and a Chromium extension, so every account signed in to that profile is within the agent's reach.
- The Five-Layer Containment Model (Profile, Scope, Mode, Handoff, Cleanup) organizes seven setup steps so a gap in one layer is limited by the others.
- Profile: install Browse only in a dedicated browser profile, and sign in there only to low-privilege accounts a task actually needs.
- Scope and Mode: the maintainers say allowedOrigins does not filter requests the page makes itself, and an independent review found readOnly does not stop eval, so treat both as guardrails, not a data boundary.
- Handoff: use the built-in handoff for logins, 2FA, payments and bot checks, and check the page yourself before clicking Continue.
- Page text the agent reads goes to its model provider, so keep sensitive tabs out of agent sessions.
- No setup fully prevents prompt injection, so test each MCP client separately and run the pre-flight checklist every session.
Conclusion
Agents that can't reach your signed-in tools stall at the first login screen. Browse removes that obstacle by working inside your authenticated browser, which lets an agent do things a clean, separate automation browser can't. The cost is that untrusted web content now sits one step away from your sessions, and the five layers are there to stop that step from becoming account access.
Give the agent its own profile and sign in only where needed. Scope each session with allowedOrigins, default to readOnly, keep humans in charge of logins, 2FA, payments and bot checks, and close tabs and sign out when the work is done. Stay honest about the gaps. The maintainers state that requests a page makes itself are not filtered. The hands-on review found that eval still runs code in the page even with readOnly on.
For teams, the real question is which tasks Browse should handle. Interactive, supervised work in a scoped profile is a reasonable fit. Unattended runs against high-value accounts, or CI pipelines that need repeatable behavior, are better served elsewhere for now. Three developments would justify a broader role: an independent security audit, a stable 1.0 release with settled configuration, and filtering of requests that pages make themselves, which would move allowedOrigins closer to a real data boundary.
If your team is drafting a policy for agent browsing tools, or reviewing which MCP servers and add-ons your developers run, Optijara can work through it with you against the five layers above.
Frequently Asked Questions
Is it safe to install OpenCode Browse in my main Chrome profile?
We don't recommend it. The independent hands-on reviewer said they would not add it to their main profile, because everything they are signed in to lives there and page content can try to steer the agent. Chrome profiles keep bookmarks, history, passwords and settings separate, so create a dedicated agent profile instead. That is the Profile layer of the Five-Layer Containment Model.
Does allowedOrigins stop data from leaving the page?
No. The maintainers call it a guardrail, not a data boundary. It limits navigations, top-level documents and the tabs and popups the agent opens, but requests the page makes itself, including fetch, XHR, images, scripts and iframes, are not filtered. The hands-on review confirmed that page JavaScript can still make requests anywhere.
What does readOnly mode actually prevent?
readOnly blocks input from the agent. It does not stop eval, which still runs code in the page. Treat readOnly as a sensible default for research and reading tasks, and do not rely on it as a guarantee that the page cannot be modified.
Will Browse solve captchas or complete 2FA for my agent?
No. For logins, 2FA prompts and payments, Browse hands the tab back to you and continues once you click Continue. For bot challenges such as Cloudflare checks and captcha walls, it reports them and tells the agent to hand interactive ones to you. It never solves them.
Should I use Browse or Playwright MCP for automated tests in CI?
For CI, a tool that launches its own browser with its own profile, such as Playwright MCP, is the more natural fit because it is built for repeatable automation. Browse drives your signed-in browser, and an independent comparison written when v0.1.0 was the latest release described it as about three weeks old, which matters when you need stable CI behavior.
Does the page content my agent reads stay on my machine?
No. Whatever page text a browser MCP agent reads goes to its model provider. Close inbox, HR, banking and other sensitive tabs before an agent session, and keep them out of the dedicated agent profile entirely.
Sources
- https://github.com/anomalyco/browse
- https://github.com/anomalyco/browse/releases/tag/v0.1.5
- https://flaviocopes.com/opencode-browse/
- https://dev.to/hassann/opencode-browse-vs-playwright-mcp-vs-chrome-devtools-mcp-which-browser-mcp-should-you-use-2360
- https://support.google.com/chrome/answer/2364824?hl=en&co=GENIE.Platform%3DDesktop
- https://www.chromium.org/developers/creating-and-using-profiles/
- https://brave.com/blog/comet-prompt-injection/
- https://brave.com/blog/unseeable-prompt-injections/
- https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices
- https://modelcontextprotocol.io/specification/2025-06-18
- https://genai.owasp.org/llmrisk/llm01-prompt-injection/



