On Runtime, each headless browser gets a Linux microVM of its own. Parallel runs never share cookies, a profile or a kernel. You pay only for the CPU the browser uses. Playwright's Chromium installs in two commands on the stock Ubuntu 24.04 image (the sandbox environment).
Headless and headed
The Chrome documentation describes the mode this way: "With Chrome Headless mode,
you can run the browser in an unattended environment, without any visible UI."
Since Chrome 112, headless and headed Chrome share one implementation. The older
separate build is still available as chrome-headless-shell. Playwright runs
tests headless by default. Pass --headed to show the window. For headless
Chromium, Playwright uses the lighter shell, unless you opt into the full browser
with the chromium channel.
| Mode | What it is | On Runtime |
|---|---|---|
| Headless shell | Lightweight Chromium build, no display | Playwright's default headless Chromium, via exec |
New headless (chromium channel) |
Full Chrome with no window | The same install, channel: "chromium" |
| Headed | A visible browser on a desktop | The sandbox desktop with Chromium, live view and recording |
Why AI agents use one
An agent that reads documentation, checks a deployed app or fills in a form needs a browser. Code must be able to drive that browser, and the browser must render JavaScript. Running it on your own server gives untrusted pages access to your network. Running it in a sandbox keeps those pages behind the sandbox's egress rules. Private and internal addresses are always refused.
Agents that plan from pixels use a headed desktop and computer use. Agents that act through the page's structure, by clicking selectors and reading text, are faster and cheaper with a headless browser.
Run one
Terminalsudo npx playwright install-deps chromiumnpx playwright install chromiumTypeScriptimport { Sandbox } from "withruntime";const script = `const { chromium } = require("playwright");(async () => { const browser = await chromium.launch({ headless: true }); const page = await browser.newPage(); await page.goto("https://example.com"); console.log(await page.title()); await browser.close();})();`;await using sbx = await Sandbox.create({ diskMiB: 8192 });const slow = { check: true, timeoutMs: 600_000 } as const;await sbx.exec("npm install --no-fund --no-audit playwright", slow);await sbx.exec("sudo npx playwright install-deps chromium", slow);await sbx.exec("npx playwright install chromium", slow);await sbx.files.write("/workspace/title.cjs", script);console.log((await sbx.exec(["node", "title.cjs"], { check: true })).stdout);Request 8 GiB of disk. Chromium and its libraries take a large share of the default 4 GiB. To start later sandboxes with the browser ready, put the install in a custom image.
Related
- How to run Playwright in a cloud sandbox
- How to run a browser automation agent
- What is computer use?
- What is egress control?
Sources
- Chrome for Developers, Chrome Headless mode, checked 25 October 2026
- Playwright, Browsers, checked 25 October 2026
- Playwright, Command line, checked 25 October 2026
Facts on this page were checked on 25 October 2026.