You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Improve remote browser page flow and structure
Lead with why (no sandbox compute wasted, zero install, CAPTCHA handling,
parallel browsing), show two approaches upfront, then streamlined walkthroughs.
Copy file name to clipboardExpand all lines: docs/use-cases/remote-browser.mdx
+41-62Lines changed: 41 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,27 @@ description: "Use Kernel cloud browsers with E2B sandboxes for web scraping, app
4
4
icon: "globe"
5
5
---
6
6
7
-
[Kernel](https://www.kernel.computer/) provides cloud browsers — remote Chromium instances you can control programmatically via [CDP](https://chromedevtools.github.io/devtools-protocol/). Combined with E2B sandboxes, your agents can browse the web without running a browser locally.
7
+
[Kernel](https://www.kernel.computer/) provides cloud browsers — remote Chromium instances your agents can control via [CDP](https://chromedevtools.github.io/devtools-protocol/) (Chrome DevTools Protocol).
8
8
9
-
E2B provides pre-built sandbox templates with the Kernel SDK and Playwright already installed:
9
+
## Why use a remote browser?
10
10
11
-
| Template | Includes | Use case |
11
+
Running a browser inside the sandbox works, but offloading it to Kernel has real advantages:
12
+
13
+
-**No sandbox compute wasted on Chrome** — Chromium is resource-hungry. Kernel runs it on dedicated infrastructure so your sandbox CPU and memory stay available for your agent's actual work.
14
+
-**Zero installation** — no need to install Chrome, Chromium, or Playwright binaries in your sandbox template. Kernel provides the browser remotely.
15
+
-**Built-in CAPTCHA and bot detection handling** — Kernel browsers support stealth mode, residential proxies, and browser profiles that persist cookies and sessions across runs.
16
+
-**Parallel browsing** — spin up multiple Kernel browsers simultaneously without multiplying sandbox costs.
17
+
18
+
## Two approaches
19
+
20
+
E2B provides pre-built sandbox templates with the Kernel SDK already installed:
|`kernel-agent-browser`| Kernel SDK, Playwright, Browser Use | Autonomous AI agents that browse on their own |
26
+
27
+
Both templates connect to Kernel browsers over CDP. The difference is whether *you* write the browsing logic or an *LLM agent* decides what to do.
15
28
16
29
## Prerequisites
17
30
@@ -30,29 +43,26 @@ E2B_API_KEY=e2b_***
30
43
KERNEL_API_KEY=kernel_***
31
44
```
32
45
33
-
## App preview with Kernel
46
+
## Programmatic browsing
47
+
48
+
Use this approach when you know exactly what pages to visit and what to do on them — taking screenshots, scraping data, or generating previews.
34
49
35
-
Deploy a web app inside a sandbox, get a public URL, then use a Kernel browser to visit every route, capture screenshots, and produce a preview report.
50
+
This example deploys a web app inside a sandbox, gets a public URL, then uses a Kernel browser to screenshot every route.
36
51
37
52
<Steps>
38
-
<Steptitle="Create the sandbox">
39
-
Start an E2B sandbox using the `kernel-browser` template. No local browser binary is needed — Kernel provides the browser remotely.
53
+
<Steptitle="Create the sandbox and deploy your app">
54
+
Start a sandbox with the `kernel-browser` template, write your web app into it, and start the server.
E2B exposes any sandbox port as a public HTTPS endpoint.
79
+
<Steptitle="Get the public URL and browse with Kernel">
80
+
E2B exposes any sandbox port as a public HTTPS endpoint. A script inside the sandbox creates a Kernel browser, connects via Playwright CDP, and screenshots each route.
71
81
72
82
```python
73
83
host = sandbox.get_host(8000)
74
84
app_url =f"https://{host}"
75
-
```
76
-
</Step>
77
85
78
-
<Steptitle="Browse with Kernel">
79
-
A script running inside the sandbox creates a Kernel cloud browser, connects via Playwright CDP, and visits each route to take screenshots.
80
-
81
-
```python
86
+
# This runs inside the sandbox
82
87
from kernel import Kernel
83
88
from playwright.sync_api import sync_playwright
84
89
@@ -95,8 +100,8 @@ with sync_playwright() as pw:
95
100
```
96
101
</Step>
97
102
98
-
<Steptitle="Generate the preview report">
99
-
After visiting every route, the script writes a JSON report with page titles and screenshot paths. The orchestrator reads it back from the sandbox.
103
+
<Steptitle="Read the results">
104
+
After visiting every route, read the report back from the sandbox.
100
105
101
106
```python
102
107
import json
@@ -251,9 +256,9 @@ if __name__ == "__main__":
251
256
main()
252
257
```
253
258
254
-
## Agent browser with Browser Use
259
+
## Autonomous agent browsing
255
260
256
-
Add the [Browser Use](https://docs.browser-use.com/) framework to give an LLM autonomous control over a Kernel browser. The agent sees the page via screenshots and decides what to click, type, and navigate — you just give it a task.
261
+
Use this approach when you want an LLM to decide what to click, type, and navigate. The [Browser Use](https://docs.browser-use.com/) framework connects an LLM to the Kernel browser — the agent sees the page via screenshots and autonomously completes tasks.
257
262
258
263
This requires an additional LLM API key (Anthropic, OpenAI, or other [supported model](https://docs.browser-use.com/customize/supported-models)):
259
264
@@ -263,7 +268,7 @@ ANTHROPIC_API_KEY=sk-ant-***
263
268
264
269
<Steps>
265
270
<Steptitle="Create the sandbox">
266
-
Start an E2B sandbox using the `kernel-agent-browser` template, which includes Browser Use on top of the Kernel SDK and Playwright.
271
+
Use the `kernel-agent-browser` template, which includes Browser Use on top of the Kernel SDK and Playwright.
267
272
268
273
```python
269
274
from e2b import Sandbox
@@ -279,8 +284,8 @@ sandbox = Sandbox.create(
279
284
```
280
285
</Step>
281
286
282
-
<Steptitle="Write the agent script">
283
-
The agent script creates a Kernel browser, connects Browser Use to it, and runs a task autonomously.
287
+
<Steptitle="Write and run the agent">
288
+
The agent script creates a Kernel browser, connects Browser Use, and runs a task autonomously. You just describe what you want done.
284
289
285
290
```python
286
291
AGENT_SCRIPT='''
@@ -291,7 +296,6 @@ from browser_use import Agent, Browser, ChatAnthropic
Execute the agent inside the sandbox. The agent will autonomously browse, click, type, and navigate to complete the task.
314
-
315
-
```python
316
-
result = sandbox.commands.run(
317
-
"python3 /home/user/agent_task.py",
318
-
timeout=180,
319
-
)
313
+
result = sandbox.commands.run("python3 /home/user/agent_task.py", timeout=180)
320
314
print(result.stdout)
321
315
```
322
316
</Step>
@@ -427,9 +421,7 @@ if __name__ == "__main__":
427
421
428
422
## Kernel MCP tools
429
423
430
-
The [Kernel MCP Server](https://mcp.onkernel.com/mcp) exposes 10 tools over the Model Context Protocol. Connect any MCP-compatible client — no installation needed.
431
-
432
-
Install for CLI tools:
424
+
The [Kernel MCP Server](https://mcp.onkernel.com/mcp) exposes 10 tools over the Model Context Protocol, letting MCP-compatible clients manage browsers without any SDK installation.
433
425
434
426
```bash
435
427
kernel mcp install --target <target># Supports Cursor, Claude Desktop, VS Code, etc.
@@ -458,30 +450,17 @@ Authentication uses OAuth 2.0 via Clerk.
458
450
459
451
## Deploying Kernel skills
460
452
461
-
An agent running inside the sandbox can use the Kernel CLI to create, deploy, and invoke browser automation skills — turning any one-off workflow into a persistent, reusable automation.
453
+
An agent running inside the sandbox can use the Kernel CLI to package any browser workflow as a persistent, reusable automation.
462
454
463
455
```python
464
-
#Agent deploys a reusable browser automation skill
0 commit comments