A browser session lifecycle an agent can reason about
Create, inspect, connect and close Cloudflare Browser Run sessions without confusing access links with persistent browser state.
Separate Lupin API permission, session access and website sign-in so agents do not assume one credential grants every kind of access.
Browser routes require an organization key, with read permission for observation, create permission for session allocation and interactions, and delete permission for ending. Human verification, billing enrollment and provider readiness can impose further gates. A newly registered autonomous agent has a bootstrap key for reading, email and drafts; it cannot turn that registration into paid browser access. When the capability is unavailable, report the specific prerequisite instead of asking the model to discover another endpoint. Repeatedly trying different tools does not change the workspace's authority or payment readiness.
The connect action mints short-lived live-view and CDP URLs for an existing session. Their scope is the browser, not a website account, but the browser may contain an authenticated page. Consequently, leaking a connection URL can leak the practical ability to use that page. Do not embed it in a normal task summary or durable public record. Refresh links only for authorized operators, and distinguish their startup expiry from the browser's runtime. The issuing key's permission checks on reconnect are useful controls, but the application should still end the session when the handoff is over.
const access = await lupin.browsers.connect(sessionId);
// Pause automation for the authorized operator handoff.
// Read the intended tab again after the operator returns control.When an authorized task needs login, provide the owner a private live-view handoff and pause automated interaction while they complete authentication. The owner may need MFA, consent, a device check or account recovery. Those steps are not evidence that the infrastructure integration is broken. Verify the resulting page and intended account before continuing. Do not assume the browser inherited the user's local profile or that a previous closed session's cookies are available. Public research does not forward the caller's Lupin authorization header or local website cookies to the destination.
Reviewed against the current Lupin route, provider adapter and shared input contracts, plus the linked official references. Examples were not run against live services.
Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.