shiichan

No more agent login snags! Browser Run gets structured handoff

Hi everyone, I'm Shiichan! Today I found a nice update to Cloudflare's Browser Run, so let's take a look!

Cloudflare Changelog developers.cloudflare.com

What was announced?

The Cloudflare Changelog announced that Browser Run now supports structured handoff for Human in the Loop workflows. Using Cloudflare-specific CDP (Chrome DevTools Protocol) commands, an agent can signal that it needs help, a human takes over the task through Live View, and the agent automatically resumes once the work is done.

For agents running multi-step browser workflows, it's a common pain point that a single login screen or unexpected prompt can fail the entire run. This update gives that situation a proper pause-and-resume mechanism.

The story so far

Browser Run (formerly Browser Rendering) already shipped Live View, Human in the Loop, and Session Recordings back in April this year. Even so, whenever human intervention was needed, the script had to share the Live View URL with a person and then poll on its own to detect when the work was finished.

In other words, developers had to build both "asking for intervention" and "detecting completion" themselves.

What changes

With structured handoff, this whole flow is now handled through dedicated CDP commands.

  • The agent simply calls Cloudflare.handoff with instructions for the human and an optional timeout, to request intervention
  • The human just works through Live View, watching the screen
  • Once the work is done, the Cloudflare.handoffComplete event fires, letting the agent automatically resume

It's a great fit for situations you can't fully automate but want to hand off to a human — logins requiring MFA, SSO, or CAPTCHA, entering sensitive information, or approval steps like confirming an order.

Dive Deep

Here are the key commands.

  • Cloudflare.getLiveView — issues a Live View URL (devtoolsFrontendUrl). You can pick tab, full, or devtools for mode, and set an expiry with expiresInMs (default 5 minutes, up to 1 hour)
  • Cloudflare.handoff — requests intervention by passing instructions for the human, plus an optional timeout (up to 30 minutes; no timeout if unspecified)
  • Cloudflare.handoffComplete — an event that fires when the human's work is done (or times out), carrying success and reason

The official example looks like this.

const cdp = await page.createCDPSession();

const { devtoolsFrontendUrl } = await cdp.send("Cloudflare.getLiveView", {
  mode: "tab",
});
console.log(`Human input needed: ${devtoolsFrontendUrl}`);

const handoffComplete = new Promise((resolve) => {
  cdp.once("Cloudflare.handoffComplete", resolve);
});

await cdp.send("Cloudflare.handoff", {
  instructions: "Please log in with your credentials",
  timeout: 600000,
});

const result = await handoffComplete;
console.log(result.success ? "Handoff complete" : `Failed: ${result.reason}`);

As a rough guideline for timeouts, simple tasks like clicking a checkbox are suggested to take about 2-3 minutes, while more complex tasks like filling out a multi-page form might need 10-15 minutes.

One thing to keep in mind: browser requests made through Live View are always identified as "bot traffic", so some third-party services may block them.

Wrap-up

  • Browser Run's Human in the Loop now has CDP-based structured handoff
  • The Cloudflare.getLiveView → Cloudflare.handoff → Cloudflare.handoffComplete flow automates the pause-and-resume cycle
  • Previously, developers had to implement Live View URL sharing and polling themselves
  • Worth a look if you're building AI agents that need to hand off logins with MFA, sensitive input, or approval steps to a human.