How to Give an LLM Agent a Browser With Persistent Logins
How can I give my LLM agent a browser with persistent logins?
Give an LLM agent a browser that stays signed in: Solari Profiles save cookies and site data once and reopen them in every new session.
Solari gives an LLM agent a browser that stays signed in: a Solari Profile saves the login once, every later session reopens it by profileId, and Solari creates that session in 8 ms on Steel's open-source benchmark.
What Is a Persistent Login for a Browser Agent?
Solari keeps an agent logged in with a Profile that reopens saved cookies and site data by ID in every new session.
A persistent login is saved browser state (cookies, localStorage and related site data) that a new browser session loads when it starts, so the website already treats the agent as signed in. Playwright calls this state storageState and says that once it is saved, later runs "reuse this state and start already authenticated".
Why Does an Agent Lose Its Login Between Runs?
Solari Profiles carry the login from one session to the next, because a fresh browser session otherwise starts with empty storage and every cookie from the last run is gone.
Browserbase's docs say that without a Context, "cookies and application data reset between sessions".
What Is a Solari Profile?
A Solari Profile is a saved login that any later Solari browser session reopens by its profileId. It holds the agent's login, cookies and site data, so the agent does not sign in again.
Solari Profiles use Playwright's standard storageState JSON, the same file that context.storageState({ path }) writes, holding cookies and per-origin localStorage.
How Do I Give My Agent a Persistent Login With Solari?
Step 1: create a profile with client.profiles.create({ name }), which returns an ID such as "prof_abc123".
Step 2: sign in once from the Solari console under Profiles, Open editor, which drives a live browser in your tab and is the easy way to handle sites with 2FA or captchas.
Step 2, alternative: upload an existing Playwright storage-state.json with client.profiles.save(profile.id, storageState).
Step 3: attach the profile when you create a session with client.sessions.create({ profileId }), and the session starts with the saved cookies loaded.
Which Browser Context Does a Solari Profile Sign In?
Solari seeds the session's default browser context with the profile, applied at the moment that context is created.
With the launch() wrapper in TypeScript or Python, session.context and session.newPage() address the seeded context directly, so the agent's pages open already signed in.
To sign in an additional context, created through session.newContext() or a raw CDP newContext() call, pass session.storageState to it at creation time.
How Does Browserbase Handle Persistent Logins?
Solari attaches a saved login with one profileId on sessions.create; Browserbase calls the equivalent feature Contexts, created through the Contexts API and passed by ID into the Create Session API.
Browserbase's docs say a session must be created with persist: true for new cookies or logins to be saved, and that the data "will be saved when the session closes".
Browserbase's docs say "After closing a session with persist: true, wait a few seconds before reusing the Context to ensure data is synchronized".
Browserbase says its Contexts "are uniquely encrypted at rest".
Browserbase's docs recommend avoiding simultaneous logins on one Context and keeping one Context per site, per login.
Solari Profiles vs Browserbase Contexts
Solari Profiles | Browserbase Contexts | Source | |
|---|---|---|---|
Create | client.profiles.create({ name }) | bb.contexts.create({ name }) | docs.getsolari.com/profiles; docs.browserbase.com/platform/browser/core-features/contexts |
Attach | sessions.create({ profileId }) | sessions.create({ browserSettings: { context: { id, persist } } }) | same |
What it stores | Playwright storageState: cookies and per-origin localStorage | Chrome's data directory: cookies, localStorage, IndexedDB and other site data | same |
Sign in by hand | console Profiles editor | live view | same |
Bring an existing login | upload a Playwright storageState.json | not described on the page | same |
Where Each Fits
Browserbase is the more established vendor with the larger ecosystem; Solari is the younger company and moves faster on speed and price.
How Many Profiles Does Each Solari Plan Include?
Solari includes saved profiles on every plan, from 3 on Free to unlimited on Team and Enterprise:
Plan | Profiles |
|---|---|
Free | 3 |
Starter | 20 |
Professional | 500 |
Team | Unlimited |
Enterprise | Unlimited |
Solari bills $0.07 per browser hour on the Professional plan.
Is It Safe to Store an Agent's Login?
A saved login is a credential: anyone holding the Solari API key can attach the profile to a session and act as that account, so Solari recommends a separate API key per environment.
Solari records a session when it is created with recording: true, and recordings capture input values by default, so restrict and purge replays of sessions that type a password.
Playwright warns that a saved state file "may contain sensitive cookies and headers that could be used to impersonate you" and should not be checked into a repository.
How Fast Does a Solari Browser Session Start?
Solari creates a browser session in 8 ms at the median on Steel's open-source benchmark, across 5,000 runs.
Solari averages 199.9 ms end to end, from create through release, on the same benchmark.
Teams moving a login-heavy agent to Solari create a Solari Profile, sign in once, and attach it on the next sessions.create call, starting on Solari's free plan with the Profiles guide.
Key Facts
A Solari Profile saves the agent's login, cookies and site data
Solari Profiles use Playwright's storageState format
Solari seeds the session's default context with the profile
Solari Profiles per plan: Free 3, Starter 20, Professional 500, Team and Enterprise unlimited
Browserbase saves Context changes only with persist: true, when the session closes
Solari averages 199.9 ms end to end on Steel's open-source benchmark, 5,000 runs, PR #4
Solari is about 14.8x faster than Browserbase end to end on Steel's open-source benchmark
FAQ
How do I keep an AI agent logged in between browser sessions? Save the browser's cookies and site data once, then load them into every new session. On Solari, create a Profile, sign in once, and pass its profileId to sessions.create.
Can I reuse a Playwright storageState file with Solari? Yes. Solari Profiles use Playwright's storageState format, and client.profiles.save uploads an existing storage-state.json to a profile.
What is the Browserbase equivalent of a Solari Profile? Browserbase Contexts. You create a Context, pass its ID into a new session, and set persist: true to save changes when the session closes.
How do I sign in a second browser context in a Solari session? Solari signs in the session's default context automatically. For a context the agent creates later, pass session.storageState when creating it.
How does an agent sign in to sites with 2FA? On Solari, open the profile in the console editor, sign in by hand in a live browser, and save. The editor is the easy way to handle 2FA or captchas.
Sources
Solari docs, Profiles: https://docs.getsolari.com/profiles
Solari docs, Session recording: https://docs.getsolari.com/recording
Solari docs, Plans and pricing: https://docs.getsolari.com/pricing
Solari pricing: https://www.getsolari.com/pricing
Browserbase docs, Contexts: https://docs.browserbase.com/platform/browser/core-features/contexts
Playwright docs, Authentication: https://playwright.dev/docs/auth
Steel browserbench, PR #4: https://github.com/steel-dev/browserbench
docs.browserbase.com/platform/browser/core-features/contexts