diff --git a/docs.json b/docs.json
index 41ff2fea..ae3c8c76 100644
--- a/docs.json
+++ b/docs.json
@@ -47,7 +47,15 @@
"pages": [
"docs/use-cases/coding-agents",
"docs/use-cases/computer-use",
- "docs/use-cases/ci-cd"
+ "docs/use-cases/ci-cd",
+ {
+ "group": "Browser use",
+ "icon": "globe",
+ "pages": [
+ "docs/use-cases/browser-use",
+ "docs/use-cases/agent-browser"
+ ]
+ }
]
},
{
diff --git a/docs/use-cases/agent-browser.mdx b/docs/use-cases/agent-browser.mdx
new file mode 100644
index 00000000..cc889810
--- /dev/null
+++ b/docs/use-cases/agent-browser.mdx
@@ -0,0 +1,235 @@
+---
+title: "Agent remote browser"
+description: "Run an autonomous AI agent inside an E2B sandbox that browses the web using a Kernel cloud browser and the Browser Use framework."
+icon: "robot"
+---
+
+Run an AI agent inside an E2B sandbox that autonomously controls a [Kernel](https://www.kernel.computer/) cloud browser. The agent decides what to click, type, and navigate — you just give it a task.
+
+This builds on the [remote browser](/docs/use-cases/browser-use) pattern by adding the [Browser Use](https://docs.browser-use.com/) framework, which turns an LLM into a browser-controlling agent.
+
+## Architecture
+
+1. **E2B Sandbox** — isolated environment where the agent code runs. Pre-installed with Kernel SDK, Playwright, and Browser Use.
+2. **Kernel Cloud Browser** — remote Chromium instance the agent controls via CDP.
+3. **Browser Use** — agent framework that connects an LLM to Playwright. The LLM sees screenshots and decides actions (click, type, scroll, navigate).
+
+The orchestrator creates the sandbox and kicks off the agent. The agent runs autonomously inside the sandbox — it creates a Kernel browser, connects Browser Use, and executes the task.
+
+## Prerequisites
+
+- An [E2B API key](https://e2b.dev/dashboard?tab=keys)
+- A [Kernel API key](https://www.kernel.computer/)
+- An LLM API key (Anthropic, OpenAI, or other [supported model](https://docs.browser-use.com/customize/supported-models))
+- Python 3.10+
+
+```bash
+pip install e2b-code-interpreter
+```
+
+Set your keys in the environment:
+
+```bash .env
+E2B_API_KEY=e2b_***
+KERNEL_API_KEY=kernel_***
+ANTHROPIC_API_KEY=sk-ant-***
+```
+
+## How it works
+
+
+
+Start an E2B sandbox using the `kernel-agent-browser` template, which comes with Kernel SDK, Playwright, and Browser Use pre-installed. Pass the API keys the agent will need.
+
+```python
+from e2b_code_interpreter import Sandbox
+
+sandbox = Sandbox.create(
+ "kernel-agent-browser",
+ envs={
+ "KERNEL_API_KEY": os.environ["KERNEL_API_KEY"],
+ "ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
+ },
+ timeout=300,
+)
+```
+
+
+
+The agent script creates a Kernel browser, connects Browser Use to it, and runs a task autonomously.
+
+```python
+AGENT_SCRIPT = '''
+import asyncio
+from kernel import Kernel
+from browser_use import Agent, Browser, ChatAnthropic
+
+async def main():
+ kernel = Kernel()
+ kb = kernel.browsers.create()
+
+ browser = Browser(cdp_url=kb.cdp_ws_url)
+
+ agent = Agent(
+ task="Go to Hacker News, find the top 3 AI stories, and summarize them",
+ llm=ChatAnthropic(model="claude-sonnet-4-20250514"),
+ browser=browser,
+ )
+ result = await agent.run()
+ print(result)
+
+asyncio.run(main())
+'''
+
+sandbox.files.write("/home/user/agent_task.py", AGENT_SCRIPT)
+```
+
+
+
+Execute the agent inside the sandbox. The agent will autonomously browse, click, type, and navigate to complete the task.
+
+```python
+result = sandbox.commands.run(
+ "python3 /home/user/agent_task.py",
+ timeout=180,
+)
+print(result.stdout)
+```
+
+
+
+## Full example
+
+```python agent_browser.py expandable
+"""
+Agent Remote Browser — E2B + Kernel + Browser Use
+
+Spins up an E2B sandbox with Browser Use framework and Kernel cloud browser.
+An AI agent autonomously browses the web to complete a research task.
+"""
+
+import os
+
+from e2b_code_interpreter import Sandbox
+
+AGENT_SCRIPT = '''
+import asyncio
+from kernel import Kernel
+from browser_use import Agent, Browser, ChatAnthropic
+
+async def main():
+ # Create a Kernel cloud browser
+ kernel = Kernel()
+ kb = kernel.browsers.create()
+ print(f"Kernel browser created: {kb.id}")
+
+ # Connect Browser Use to the Kernel browser via CDP
+ browser = Browser(cdp_url=kb.cdp_ws_url)
+
+ # Create an AI agent that autonomously browses
+ agent = Agent(
+ task="""
+ Go to https://news.ycombinator.com and find the top 3 stories
+ that are about AI or machine learning. For each story:
+ 1. Note the title and point count
+ 2. Click through to the comments page
+ 3. Read the top comment
+
+ Return a summary of your findings.
+ """,
+ llm=ChatAnthropic(model="claude-sonnet-4-20250514"),
+ browser=browser,
+ max_actions_per_step=4,
+ )
+
+ result = await agent.run()
+ print("\\n" + "=" * 60)
+ print("AGENT RESULT:")
+ print("=" * 60)
+ print(result)
+
+asyncio.run(main())
+'''
+
+
+def main():
+ sandbox = Sandbox.create(
+ "kernel-agent-browser",
+ envs={
+ "KERNEL_API_KEY": os.environ["KERNEL_API_KEY"],
+ "ANTHROPIC_API_KEY": os.environ["ANTHROPIC_API_KEY"],
+ },
+ timeout=300,
+ )
+
+ try:
+ sandbox.files.write("/home/user/agent_task.py", AGENT_SCRIPT)
+
+ result = sandbox.commands.run(
+ "python3 /home/user/agent_task.py",
+ timeout=180,
+ )
+
+ if result.exit_code != 0:
+ print(f"Agent failed: {result.stderr}")
+ else:
+ print(result.stdout)
+
+ finally:
+ sandbox.kill()
+
+
+if __name__ == "__main__":
+ main()
+```
+
+## Key concepts
+
+| Concept | Detail |
+|---|---|
+| **E2B template** | `kernel-agent-browser` — pre-built with Kernel SDK, Playwright, and Browser Use |
+| **Kernel browser** | `kernel.browsers.create()` spins up a remote Chromium; connect via `kb.cdp_ws_url` |
+| **Browser Use** | `Browser(cdp_url=...)` connects the agent framework to Kernel's CDP endpoint |
+| **LLM choice** | Browser Use supports `ChatAnthropic`, `ChatOpenAI`, `ChatGoogle`, and more |
+| **Autonomous agent** | The LLM sees the page (via screenshots) and decides what actions to take |
+
+## Choosing an LLM
+
+Browser Use supports multiple LLM providers. Import the one you need:
+
+```python
+# Anthropic (recommended)
+from browser_use import ChatAnthropic
+llm = ChatAnthropic(model="claude-sonnet-4-20250514")
+
+# OpenAI
+from browser_use import ChatOpenAI
+llm = ChatOpenAI(model="gpt-4o")
+
+# Google
+from browser_use import ChatGoogle
+llm = ChatGoogle(model="gemini-2.5-flash")
+```
+
+Pass the corresponding API key in the sandbox `envs`.
+
+## Adapting this example
+
+- **Different tasks** — change the `task` string to any web research, form filling, or data extraction task.
+- **Custom actions** — Browser Use supports [custom actions](https://docs.browser-use.com/customize/custom-actions) to extend agent capabilities.
+- **Vision control** — set `use_vision="auto"` on the Agent to let it decide when to use screenshots vs DOM.
+- **Multiple agents** — run several agents in parallel, each with their own Kernel browser, for concurrent research.
+
+## Related guides
+
+
+
+ Programmatic browser automation with Playwright + Kernel
+
+
+ Build AI agents that control virtual desktops
+
+
+ Create, manage, and control sandbox lifecycle
+
+
diff --git a/docs/use-cases/browser-use.mdx b/docs/use-cases/browser-use.mdx
new file mode 100644
index 00000000..015cd9fc
--- /dev/null
+++ b/docs/use-cases/browser-use.mdx
@@ -0,0 +1,283 @@
+---
+title: "Remote browser"
+description: "Deploy a web app in an E2B sandbox and use a Kernel cloud browser to screenshot every route and generate a preview report."
+icon: "globe"
+---
+
+Deploy a web application inside an E2B sandbox, get a public URL, then use a [Kernel](https://www.kernel.computer/) cloud browser to visit every route, capture screenshots, and produce a structured preview report — all without running a browser locally.
+
+## Architecture
+
+This example combines two services:
+
+1. **E2B Sandbox** — a secure cloud environment where the web app runs. E2B exposes the app at a public HTTPS URL via `sandbox.get_host(port)`.
+2. **Kernel Cloud Browser** — a remote Chromium instance controlled through Playwright's CDP protocol. It navigates the public URL, takes screenshots, and collects page metadata.
+
+The orchestrator script on your machine creates the sandbox, deploys the app, and then runs a browsing script _inside_ the sandbox that connects to a Kernel browser and screenshots each route.
+
+## Prerequisites
+
+- An [E2B API key](https://e2b.dev/dashboard?tab=keys)
+- A [Kernel API key](https://www.kernel.computer/)
+- Python 3.10+
+
+```bash
+pip install e2b
+```
+
+Set both keys in your environment:
+
+```bash .env
+E2B_API_KEY=e2b_***
+KERNEL_API_KEY=kernel_***
+```
+
+## How it works
+
+
+
+Start an E2B sandbox using the `kernel-browser` template, which comes with the Kernel SDK and Playwright client pre-installed. No local browser binary is needed — Kernel provides the browser remotely.
+
+```python
+from e2b import Sandbox
+
+sandbox = Sandbox.create(
+ "kernel-browser",
+ envs={"KERNEL_API_KEY": os.environ["KERNEL_API_KEY"]},
+ timeout=300,
+)
+```
+
+
+
+Write a FastAPI application into the sandbox and start it as a background process on port 8000.
+
+```python
+sandbox.files.write("/home/user/app.py", FASTAPI_APP)
+sandbox.commands.run(
+ "pip install --break-system-packages fastapi uvicorn",
+ timeout=60,
+)
+sandbox.commands.run(
+ "uvicorn app:app --host 0.0.0.0 --port 8000",
+ background=True,
+ cwd="/home/user",
+)
+```
+
+
+
+E2B exposes any sandbox port as a public HTTPS endpoint.
+
+```python
+host = sandbox.get_host(8000)
+app_url = f"https://{host}"
+```
+
+
+
+A script running inside the sandbox creates a Kernel cloud browser, connects via Playwright CDP, and visits each route to take screenshots.
+
+```python
+from kernel import Kernel
+from playwright.sync_api import sync_playwright
+
+kernel = Kernel()
+kb = kernel.browsers.create()
+
+with sync_playwright() as pw:
+ browser = pw.chromium.connect_over_cdp(kb.cdp_ws_url)
+ page = browser.new_page()
+ page.set_viewport_size({"width": 1280, "height": 720})
+
+ page.goto(app_url, wait_until="networkidle")
+ page.screenshot(path="/home/user/screenshots/home.png")
+```
+
+
+
+After visiting every route, the script writes a JSON report with page titles and screenshot paths. The orchestrator reads it back from the sandbox.
+
+```python
+import json
+
+report = json.loads(
+ sandbox.files.read("/home/user/preview_report.json")
+)
+for entry in report:
+ print(f"Route: {entry['route']} — Title: {entry['title']}")
+```
+
+
+
+## Full example
+
+```python app_preview.py expandable
+"""
+App Preview — E2B + Kernel
+
+Spins up a web app inside an E2B sandbox, exposes it at a public URL,
+then uses a Kernel cloud browser to navigate the app, take screenshots
+of each route, and generate a visual preview report.
+"""
+
+import os
+import time
+import json
+
+from e2b import Sandbox
+
+# A sample FastAPI app to deploy inside the sandbox
+FASTAPI_APP = '''
+from fastapi import FastAPI
+from fastapi.responses import HTMLResponse
+
+app = FastAPI()
+
+@app.get("/", response_class=HTMLResponse)
+def home():
+ return """
+
+
+
My App
+ Welcome to My App
+
+ """
+
+@app.get("/about", response_class=HTMLResponse)
+def about():
+ return """
+
+
+ About
+ About
E2B + Kernel integration demo.
+
+ """
+
+@app.get("/api/status")
+def status():
+ return {"status": "ok", "sandbox": "e2b", "browser": "kernel"}
+'''
+
+# Script that runs inside the sandbox to browse the app with Kernel
+BROWSE_SCRIPT = '''
+import sys
+import json
+from kernel import Kernel
+from playwright.sync_api import sync_playwright
+
+app_url = sys.argv[1]
+routes = ["/", "/about"]
+
+kernel = Kernel()
+kb = kernel.browsers.create()
+
+results = []
+
+with sync_playwright() as pw:
+ browser = pw.chromium.connect_over_cdp(kb.cdp_ws_url)
+ page = browser.new_page()
+ page.set_viewport_size({"width": 1280, "height": 720})
+
+ for route in routes:
+ url = f"{app_url}{route}"
+ page.goto(url, wait_until="networkidle", timeout=15000)
+
+ # Take screenshot
+ safe_name = route.strip("/").replace("/", "_") or "home"
+ screenshot_path = f"/home/user/screenshots/{safe_name}.png"
+ page.screenshot(path=screenshot_path)
+
+ # Collect page info
+ results.append({
+ "route": route,
+ "title": page.title(),
+ "screenshot": screenshot_path,
+ })
+
+ browser.close()
+
+with open("/home/user/preview_report.json", "w") as f:
+ json.dump(results, f)
+'''
+
+
+def main():
+ sandbox = Sandbox.create(
+ "kernel-browser",
+ envs={"KERNEL_API_KEY": os.environ["KERNEL_API_KEY"]},
+ timeout=300,
+ )
+
+ try:
+ # Deploy and start the FastAPI app
+ sandbox.files.write("/home/user/app.py", FASTAPI_APP)
+ sandbox.commands.run("mkdir -p /home/user/screenshots", timeout=5)
+ sandbox.commands.run(
+ "pip install --break-system-packages fastapi uvicorn",
+ timeout=60,
+ )
+ sandbox.commands.run(
+ "uvicorn app:app --host 0.0.0.0 --port 8000",
+ background=True,
+ cwd="/home/user",
+ )
+ time.sleep(3)
+
+ # Get the public URL
+ host = sandbox.get_host(8000)
+ app_url = f"https://{host}"
+ print(f"App is live at: {app_url}")
+
+ # Use Kernel browser to preview the app
+ sandbox.files.write("/home/user/browse.py", BROWSE_SCRIPT)
+ result = sandbox.commands.run(
+ f'python3 /home/user/browse.py "{app_url}"',
+ timeout=120,
+ )
+
+ # Read the preview report
+ report = json.loads(
+ sandbox.files.read("/home/user/preview_report.json")
+ )
+ for entry in report:
+ print(f"Route: {entry['route']} — Title: {entry['title']}")
+
+ finally:
+ sandbox.kill()
+
+
+if __name__ == "__main__":
+ main()
+```
+
+## Key concepts
+
+| Concept | Detail |
+|---|---|
+| **E2B template** | `kernel-browser` — pre-built with the Kernel SDK and Playwright client |
+| **Public URL** | `sandbox.get_host(port)` returns an HTTPS hostname |
+| **Background process** | `sandbox.commands.run(..., background=True)` starts the web server without blocking |
+| **Kernel browser** | `kernel.browsers.create()` spins up a remote Chromium; connect via `kb.cdp_ws_url` |
+| **CDP connection** | Playwright's `connect_over_cdp()` drives the remote browser with full API access |
+
+## Adapting this example
+
+- **Your own app** — replace `FASTAPI_APP` with any web framework (Next.js, Flask, Express). Adjust the install commands and start script accordingly.
+- **More routes** — add paths to the `routes` list in `BROWSE_SCRIPT` to screenshot additional pages.
+- **Visual regression** — compare screenshots across deploys to catch UI regressions automatically.
+- **CI integration** — run this as a post-deploy step to generate preview links and thumbnails for pull requests.
+
+## Related guides
+
+
+
+ Create, manage, and control sandbox lifecycle
+
+
+ Run terminal commands inside the sandbox
+
+
+ Build AI agents that control virtual desktops
+
+