Skip to main content
Agent browser decision

Headful versus headless browsers for AI agents.

Headless means Chrome runs without visible platform windows. Headful means operators can see the browser window. Modern Chrome shares one implementation across both modes. Mode alone does not prove compatibility.

Choose headless for unattended, observable production runs. Choose headful for live inspection and intervention. Capture artifacts in either mode. Test the exact agent workflow before standardizing.

Written byLegbaReviewed byAakash HarishSecurity Research Contributor, LegbaReviewed 2026-08-28 · Updated 2026-09-01

The short version

Visibility is an operating choice, not magic compatibility.

Start with the modern definition.

Headless Chrome runs without visible platform windows. Headful Chrome displays those windows. That visible difference remains operationally important. The underlying browser story has changed.

Chrome unified its headless and headful implementations. Since Chrome 112, headless creates undisplayed platform windows. Chrome states other browser functions remain available. Old compatibility assumptions deserve retesting.

Puppeteer still launches headless by default. Playwright does the same for normal execution. Both frameworks can switch into headed operation. Their debugging tools make that switch useful.

For agents, mode is only one dimension. Perception arrives through DOM, accessibility, screenshots, or video. Actions arrive through automation interfaces. Human oversight uses separate controls.

SourcesChrome Headless modeWhat is PuppeteerDebugging Playwright tests

Compare operating models, not folklore.

The best mode follows the operating model. Production agents need evidence and control. Developers need fast diagnosis. Reviewers need understandable intervention paths.

No row declares a universal winner. Both modes can capture screenshots. Both can expose page structure. Both can fail differently across environments. Controlled tests settle specific questions.

This matrix uses current official browser-framework behavior. It does not predict every website.
FactorHeadfulHeadless
Displayed windowBrowser windows remain visible to a nearby operatorPlatform windows exist but are not displayed
Live debuggingNatural fit for inspectors, stepping, and direct observationUsually reviewed through logs, traces, screenshots, and recorded artifacts
Agent perceptionCan use DOM, accessibility, screenshots, or visual streamsCan use DOM, accessibility, screenshots, or visual streams
Human takeoverLocal visible browser can support direct operator interactionRequires a separate remote viewing or intervention surface
Unattended infrastructureMay require display infrastructure on server operating systemsDesigned for unattended execution without visible user interfaces
Compatibility conclusionMust be tested against the exact workflow and browser buildMust be tested against the exact workflow and browser build

This matrix uses current official browser-framework behavior. It does not predict every website.

SourcesChrome Headless modeDebugging Playwright testsPlaywright Trace ViewerPlaywright screenshotsPuppeteer screenshotsPlaywright continuous integration guide

Agent perception is a separate decision.

A visible browser does not automatically provide vision. The agent still needs observations. Those observations may be structural or visual. Each representation loses different information.

DOM and accessibility data expose semantic structure. Screenshots expose layout and rendered pixels. Network events expose requests. Console logs expose application messages.

Headless browsers can capture screenshots. Playwright and Puppeteer both document screenshot APIs. Therefore visual agents do not inherently require headful mode. They require reliable visual observations.

Headful mode helps nearby humans observe live behavior. That can speed development. It can also support manual intervention. Production still needs recorded evidence afterward.

Select observation channels independently from browser display mode.
FactorBest evidenceBlind spot to manage
DOM or accessibility snapshotNames, roles, text, hierarchy, and programmatic element referencesCanvas content, visual overlap, styling, and spatial emphasis
ScreenshotRendered layout, charts, canvas content, and visual confirmationHidden state, network behavior, semantics, and transient timing
TraceActions, snapshots, logs, network requests, and historical sequenceMissing instrumentation, retained secrets, and external side effects
Live headful viewImmediate operator observation and direct visual troubleshootingPoor reproducibility without separate recordings and structured logs

Select observation channels independently from browser display mode.

SourcesPlaywright Page APIPlaywright screenshotsPuppeteer screenshotsPlaywright Trace ViewerDebugging Playwright tests

Development favors visible intervention.

Agents fail for many ordinary reasons. Selectors can become ambiguous. Navigation can race page state. Authentication can expire. Dialogs can block progress.

Playwright's debug mode launches headed browsers. Its inspector can step through actions. Developers can inspect locators and logs. This shortens the feedback loop.

Headful development does not require headful production. Reproduce the failure visibly first. Then retain a trace or screenshot. Finally retest the production mode.

Some failures disappear during slow observation. Timing changes can hide races. Keep normal-speed replay in the loop. Compare artifacts across both executions.

  1. 01

    Capture the failure.

    Save logs, screenshots, traces, inputs, and browser versions. Remove sensitive values.

  2. 02

    Replay it visibly.

    Use headed debugging and action stepping. Observe the earliest divergence.

  3. 03

    Fix the cause.

    Prefer stable state checks and resilient locators. Avoid timing guesses.

  4. 04

    Retest production mode.

    Run normal speed and normal infrastructure. Compare retained evidence.

  5. 05

    Test the fallback.

    Trigger escalation deliberately. Verify operator context and authority.

SourcesDebugging Playwright testsPlaywright Trace Viewer

Production favors evidence and control.

Unattended agents need bounded authority. Browser mode does not supply that boundary. Tools, credentials, destinations, and approvals determine reachable actions. Logs show what happened later.

Headless mode fits unattended infrastructure naturally. Chrome requires no visible interface there. Playwright's normal mode follows this pattern. Puppeteer also defaults to headless.

Headful production can still make sense. Remote operators may need live viewing. Some workflows require direct intervention. The surrounding platform must expose that control safely.

Either mode needs lifecycle management. Create scoped sessions. Limit accessible credentials. Close resources after work. Preserve only required evidence.

  • Record browser and framework versions.
  • Capture failures with bounded artifacts.
  • Redact secrets before artifact retention.
  • Separate observation from action authority.
  • Require approval for consequential actions.
  • Destroy sessions after completed tasks.

SourcesChrome Headless modeWhat is PuppeteerPlaywright Trace ViewerLegba agent skill

Retire four weak assumptions.

First, headless does not mean text-only. Modern Chrome still renders pages. Frameworks can capture visual output. Agents can receive those pixels.

Second, headful does not mean human-like. Automation interfaces still control the browser. Websites may observe many environmental signals. A visible window proves nothing alone.

Third, headless does not guarantee efficiency. Resource use depends upon workload and configuration. Measure representative sessions. Include rendering, media, traces, and concurrency.

Fourth, headful does not guarantee compatibility. Browser version and launch settings still matter. Extensions and policies can alter behavior. Exact workflows require controlled tests.

SourcesChrome Headless modePlaywright screenshotsWhat is Puppeteer

Treat a headful browser API as a contract.

A mode label answers one question. Production integration needs several contracts.

Require a named connection protocol. Require explicit lifecycle and timeout behavior. Ask how operators observe the running browser.

Screenshots do not require a visible window. Playwright and Puppeteer expose them directly. Live intervention remains a separate capability.

Do not infer a headful API from screenshots. Do not infer observability from a mode flag. Verify each interface independently.

Five contracts define a useful headful browser API.
FactorContractRequired evidenceFailure question
Mode selectionA documented headed or headless setting.Published request fields and defaults.What happens when the mode is unavailable?
Browser controlA named automation protocol and version.Documented connection and authentication steps.Can the client reconnect after transport loss?
Operator viewA documented live view or debugging path.Access controls and interaction boundaries.Can observation accidentally change the run?
EvidenceScreenshots, traces, logs, or recordings.Retention, redaction, and download behavior.Can a failed run be reconstructed safely?
LifecycleCreation, timeout, termination, and cleanup rules.Remote resource ownership after disconnects.Can abandoned sessions remain active or billable?

Run a representative selection test.

Do not benchmark a toy page. Select a representative workflow. Include authentication and navigation. Include the hardest interactive step. Include the required evidence path.

Run both modes with matching versions. Keep network conditions comparable. Record success and intervention rates. Record resource use and completion time.

Review failures by root cause. Separate page changes from mode differences. Separate agent planning failures from browser failures. Separate infrastructure failures from workflow policy.

Then choose the simplest operating model. Keep a documented debugging path. Keep a separate fallback path. Recheck after major browser upgrades.

Record these fields for every evaluated workflow. Avoid one-number winner claims.
FactorMeasureWhy it matters
Task completionSuccessful runs under the defined acceptance criteriaCaptures practical outcome without hiding partial or unsafe completion
Human interventionsCount, timing, trigger, context provided, and operator actionShows whether live visibility creates measurable operational value
Diagnostic evidenceLogs, screenshots, traces, network records, and reproducibilityDetermines whether failures can be understood and corrected
Resource costMemory, processor time, storage, bandwidth, and display infrastructureSupports capacity planning without assuming mode-specific savings
Boundary complianceAllowed destinations, credentials, exports, approvals, and teardown behaviorPrevents a successful task from becoming an unsafe task

Record these fields for every evaluated workflow. Avoid one-number winner claims.

SourcesPlaywright Trace ViewerPlaywright screenshots

SourcesChrome Headless mode

Where the Legba skill fits.

Legba describes a ready skill for agents. It provides routing and isolated browser sessions. Sessions run on Legba's infrastructure. Each task receives separate session scope.

The public description does not promise mode selection. It does not specify Playwright compatibility. It does not specify Puppeteer compatibility. This page adds none of those claims.

Evaluate the skill by required agent jobs. List observations, actions, and intervention needs. Confirm every required interface directly. Test consequential workflows before production use.

The focused value remains browser separation. Agent machines need not host the session. Routing is available on demand. Infrastructure ownership stays with Legba.

SourcesLegba agent skill

FAQs.

What is a headful browser?
A headful browser displays its platform windows. Operators can watch those windows directly. Automation can still control the browser. Visibility alone does not change action authority.
What is a headless browser?
A headless browser runs without displayed platform windows. Modern Chrome still creates undisplayed windows internally. Browser functions remain available. Framework settings still affect exact behavior.
Do visual agents require headful mode?
No, screenshots remain available. Headless browsers can capture screenshots. Agents can receive those images. Visual perception requires an observation channel. It does not inherently require displayed windows.
Is headful mode always more compatible?
No, modern Chrome shares its implementation. Configuration and version still matter. Test the exact workflow in both modes. Do not rely upon category folklore.
Which mode supports human takeover?
Headful local browsers support direct local interaction naturally. Remote headless sessions need separate viewing controls. Some platforms provide those controls. Verify authority, logging, and handoff behavior.
What should production agents record?
Record versions, inputs, actions, outcomes, and failures. Capture bounded diagnostic artifacts. Redact credentials and sensitive records. Retain evidence according to policy.

References

  1. 01
    Chrome Headless modeChrome for Developers
  2. 02
  3. 03
  4. 04
  5. 05
  6. 06
  7. 07
  8. 08
  9. 09

Keep exploring