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.
Keep search results, opened pages, retrieval times and agent conclusions distinct so research can be reviewed.
A useful research result lets another person trace a claim to the page actually observed. Save the source URL, page title, retrieval timestamp and relevant text with the claim. Then record the agent's interpretation separately. Lupin page observations include URL and retrieved_at, which are useful building blocks, but the application still decides how to associate them with a conclusion. A polished answer without that association is hard to audit when a page changes or an extraction was partial. Design the evidence record before the browser begins gathering material.
The research search response contains search.results and sources as separate fields. Search results come from the configured Composio service; source pages are read through Cloudflare Browser Run. The current reader considers a bounded set of candidates and stops after a usable source is found. An empty sources array does not erase the search results, but it does mean no suitable opened page was returned. Do not attach a source-read label to a snippet or claim to have reviewed every result. Use explicit reading when a particular primary document is necessary to support the answer.
Store the final page URL returned by the read alongside the originally requested URL when they differ. Redirects can change the document, region, account context or version of a source. A link that led to an access-denied or login page did not provide the expected article evidence. Check title and visible text before attaching the page to a claim. Public URL validation helps enforce network boundaries, but a valid public destination is not automatically an authoritative source. Prefer the organization, specification or original record that owns the fact being asserted.
const result = await lupin.browsers.read(
"https://example.com", "source-document-read-001"
);
// Retain result.url, result.retrieved_at and the relevant observed text.The page snapshot is bounded, with a text truncation flag and capped lists of links and controls. If the relevant section may fall outside that observation, do not treat its absence as proof the source omits it. A screenshot can establish a visible layout or warning, while a text read can support a statement from the rendered document. Neither automatically constitutes a complete archive. Retain the narrow excerpt or summarized fact needed for review and note extraction limits that matter. Avoid storing unnecessary personal information simply because it appeared beside the relevant material.
Use language that distinguishes the source's claim, the agent's inference and an independently verified outcome. A documentation page can describe an API without proving that your workspace's provider is live. A successful local fixture can validate parsing without establishing external website availability. When sources conflict, preserve their versions and retrieval context rather than flattening them into one unsupported answer. End the temporary session after saving the evidence and track cleanup separately. The durable output is the reviewed evidence record, not the expectation that an old browser session or expiring access link will remain available later.
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.