Best sandbox · Browser agents
The best sandbox for browser agents
Updated
A browser agent reads pages written by strangers and acts on them, which makes prompt injection its everyday input. The best sandbox for it keeps the browser on a machine of its own, away from your files, cookies and internal network, and lets you see exactly where it went. kosa8 runs Microsoft's Playwright MCP server in its own microVM with one command, and can capture every network frame the browser sends on the host side, where the guest cannot interfere.
01What a browser agent needs from a sandbox
A browser running on your laptop has your sessions, your downloads folder and a route to every service on your network. An agent driving it can be told by a page to open an internal URL, upload a file or paste a token.
So the browser belongs in a machine that has none of that: no host files, no saved logins, a network you can watch and, where the task allows, restrict. Downloads and uploads should stay inside that machine.
02Checklist for choosing one
- The browser off your machine. Its own kernel and filesystem, not a profile on your desktop.
- No access to internal addresses. Unless you allow them.
- Visible traffic. Which hosts it reached, and a packet capture when you need detail.
- A standard control protocol. MCP or CDP, so any agent can drive it.
- Disposable. Delete the machine and the browser's state goes with it.
- Pinned tool definitions. So the server cannot change what its tools do after you approved it.
03How kosa8 meets it
Add the Playwright server from kosa8's MCP catalog. It runs mcr.microsoft.com/playwright/mcp in a sandbox of its own, mcp-playwright, and its tools appear behind kosa8's gateway, namespaced and pinned the first time kosa8 mcp serve starts it.
kosa8 mcp add playwright kosa8 mcp install claude-code kosa8 sandbox egress mcp-playwright kosa8 sandbox pcap mcp-playwright ./browser.pcapng tshark -r browser.pcapng -Y dns
kosa8 mcp install registers kosa8 with your agent (Claude Code here; Cursor, Codex, Claude Desktop and others are supported). kosa8 sandbox egress shows the policy and what the host refused; kosa8 sandbox pcap writes every frame to a pcapng file that opens in Wireshark. The catalog lets this server reach any host, because its job is to visit sites; refused and allowed connections are both in the audit log.
For a scripted browser that should reach only some sites, create the sandbox yourself with an allow-list, for example kosa8 sandbox create shop --egress-allow example.com --egress-allow '*.example.com' --memory 2048, and run your Playwright image in it with kosa8 sandbox run.
04When another option fits better
- Hosted browser infrastructure. Services built for browser automation at scale offer pools of browsers, session recording, proxies and CAPTCHA handling. kosa8 offers none of those; it offers a sealed machine.
- Read-only fetching. If the agent only needs page text, a fetch tool is simpler than a browser. kosa8's catalog has the reference
fetchserver too. - Testing your own app. For Playwright tests of your own site in CI, the runner's normal setup is enough.
05FAQ
Can a browser agent in kosa8 reach my internal network?
A sandbox with an allow-list reaches only the listed hosts, enforced on the host where root in the guest cannot lift it. The catalog Playwright server is allowed any host, because its job is to visit arbitrary sites, so use your own allow-listed sandbox when that is too open.
How do I see what the browser did?
kosa8 sandbox egress mcp-playwright shows the policy and refused attempts, the audit log records each tool call with a digest of its arguments, and kosa8 sandbox pcap captures every frame on the host.
Which agents can drive it?
Any MCP client. kosa8 mcp install registers kosa8 with Claude Code, Claude Desktop, Cursor, Codex, VS Code, Gemini CLI, OpenCode, Amp and others.
Does it work in the cloud?
The catalog server runs on the machine running kosa8. kosa8 Cloud's MCP server offers shell sandboxes, not a browser.
06Get started
Install kosa8 on a Mac, Linux or Windows (WSL2) machine, or make an account and run the same sandboxes on kosa8 Cloud.
07Sources
- kosa8 docs: Tool servers (MCP)
- kosa8 docs: MCP catalog
- kosa8 docs: Network
- Playwright MCP server
- Playwright documentation
- kosa8 command reference
Related
- How do I run MCP servers in a sandbox?
- How do I restrict an AI agent's network access to an allow-list?
- How do I sandbox an MCP server I use from Claude Desktop?
- How do I run untrusted LLM-generated code safely?
- All best-sandbox pages
Updated 2026-11-14