# Browser logins an agent keeps: sign in once on a cloud desktop

*Kubi, cloud desktops for AI agents. https://trykubi.com/guides/browser-logins-an-agent-keeps, last changed 2026-11-23. The page as Markdown; the same facts as the page itself.*

Most of the web an agent needs is behind a sign-in, and most agent infrastructure throws the machine away after the run, which means signing in again every time, two-factor codes included. A desktop that stays on turns that into a one-off: a person signs in once, the profile is on the screen's own disk, and every run after that starts already signed in.

A persistent screen keeps its disk. Chromium and Firefox on the image. No inbound connections. Updated 2026-11-23.

## Why it works on a screen

- A persistent screen runs until you stop it, at one address, and stopping keeps the disk. The browser profile, its cookies and its sessions are files on that disk.
- The price does not change when a screen is stopped, so keeping the machine that holds the logins costs nothing extra.
- A person can take the screen at any time to type a password or clear a CAPTCHA, which is the step no agent should be doing on your behalf anyway.
- A screen takes no inbound connections, so the signed-in browser is not sitting on a public address.

## Sign in once, by hand

*The part worth doing yourself, so no credential passes through the agent.*

Open the screen in the dashboard, press Take control and confirm, and your keyboard and mouse go to the desktop. Sign in to the sites the agent will need, finish any two-factor step, and tick the box that keeps you signed in. While you hold control, the agent's calls get 409 CONTROL_HELD, so nothing of yours lands under its clicks. Press Release when you are done, or let the five-minute idle timer end it.

Nothing you do in the live view is written to the screen's history: the record shows that control was taken and when it ended, not your keystrokes. That is deliberate, because this is the step where passwords get typed.

## Then let the agent drive the browser it is given

*Two ways, and they work together.*

The first is plain computer use: screenshot, act, read the page, click. The browser is already signed in, so the flow starts at the point that matters rather than at a login form.

The second is Chromium's own page model. Chromium on a screen starts with its debugging port open on 127.0.0.1:9222, inside the screen only, so Playwright or Puppeteer running on the screen attach to the browser that is already open, with its tabs and its logins:

```
import { chromium } from "playwright-core";

const browser = await chromium.connectOverCDP("http://127.0.0.1:9222");
const page = browser.contexts()[0].pages()[0];
await page.goto("https://app.example.com/reports");
console.log(await page.title());
await browser.close(); // closes the connection; Chromium stays open
```

playwright-core brings no browser of its own, so it uses the screen's Chromium rather than a fresh profile with no cookies. That is the whole trick: the point is not to automate a browser, it is to automate the browser that is already signed in.

## What to know before you do this

- Anything running on the screen can reach that debugging port and the profile, as anything running as the desktop user already can. Give the screen's keys only to agents you trust, and keep one screen per job.
- Secrets you store for a screen are in every command's environment and on the disk, so use keys you are able to revoke.
- A site that signs you out on a new address will do it when the screen's address changes. Bring your own proxy if you need a stable one.
- Do not point an agent at an account whose terms forbid automation. That is a decision for you, and our terms expect you to have the right to use the account.
- The port answers only inside the screen: no other screen and nothing on the internet can reach it.

## Questions people ask

### Do browser logins survive a restart?

Yes. The profile is on the screen's disk, and stopping or restarting a screen keeps the disk. What ends a session is the site's own expiry, not the machine.

### Can the agent see my password?

Not if you type it while holding control: its screenshots and actions are refused with 409 while you have the screen, and the live view is not written to history. After you release, it sees the signed-in page, not the credential.

### Can I use Playwright instead of clicking?

Yes, and the two mix. Attach to the open Chromium on 127.0.0.1:9222 for page-level work, and keep screenshots for checking the result or for anything outside the browser.

### What about CAPTCHAs and two-factor codes?

Those are the cases Take control exists for. The agent can also send a person a view-only link to the live screen, which opens within 60 seconds and lasts up to an hour.

## Read next

- [Drive the browser with Playwright](https://docs.trykubi.com/guides/browser)
- [People and agents](https://docs.trykubi.com/concepts/people-and-agents)
- [Screens](https://docs.trykubi.com/concepts/screens)
- [Pricing](https://trykubi.com/pricing)
- [Connect your agent](https://trykubi.com/integrations)
- [Watching an agent, and taking the screen back](https://trykubi.com/guides/watch-an-agent-and-take-over)
- [An agent that keeps running when you close your laptop](https://trykubi.com/guides/run-an-agent-that-never-stops)
