What is a headless browser?

A headless browser is a web browser that runs with no visible window. Code controls it through an interface such as the Chrome DevTools Protocol or Playwright. Agents use one to load pages and read what they show.

Updated

How it works

Chrome runs without a visible window when you start it with the --headless flag. Chrome describes this mode as one for unattended use, with no visible interface. Playwright runs its browsers headless by default. It drives Chromium, Firefox and WebKit.

Tools that control it

  • The Chrome DevTools Protocol is the interface DevTools uses to inspect and debug Chrome. Other tools can build on it.
  • Playwright gives one API to launch and interact with Chromium, Firefox and WebKit.
  • Puppeteer sets headless mode on by default.

Why agents run it in a sandbox

A headless browser loads pages that the agent did not choose. Those pages can hold instructions that override the user's instructions. Anthropic warns about this risk for computer use. Put the browser in a sandbox, not on your own computer. A container alone shares the host kernel.

Downloads

By default, Playwright saves downloaded files to a temporary folder. It deletes them when the browser context closes. Check whether the provider keeps downloaded files after a session ends.

What to check on a provider

  • Which browsers the image includes.
  • Whether you can limit internet access with an egress allowlist.
  • Whether downloaded files stay after the session ends.

Related terms

All glossary terms

Related