Why Your Browser Agent Fails at Login, and What Actually Works
TL;DR
A browser agent fails at login for one of four reasons: the credentials were never on the page it can see, the form is behind a redirect or iframe, the site detected automation, or the login needs something only a human has. Diagnose which one by reading the final URL and the DOM, not the model's transcript. Then stop retrying: hand the login to a person once, and record the fix as a procedure so the next run does not need them.
Your agent is not bad at logging in. It is being asked to do something it structurally cannot: supply a secret it was never given, on a page that was built to reject exactly what it is.
The four reasons, and how to tell them apart
Read the last URL the agent reached and the page it saw. Do not read the model's reasoning; it will confidently describe a form that is not there.
| What you see | What it means | What fixes it |
|---|---|---|
| The URL bounced to an SSO provider | The site delegates login to Okta, Entra or Google, and your agent is on a page it has no credentials for | A person signs in once; the session persists in the agent's browser profile |
| Fields are filled but Submit does nothing | The form lives in an iframe, or a bot check silently blocked the POST | Check the frame tree; if it is detection, a human completes it |
| A code or push notification is requested | 2FA. No amount of prompting produces a code from somebody else's phone | Hand it to the person whose phone it is |
| A CAPTCHA appears after typing | The site scored the session as automated | A human solves it in the live session; never a solver service |
Why retrying makes it worse
Every failed attempt raises the site's suspicion score. An agent that retries a login five times has taught the site that this session is a bot, and often locked the real account. The single most valuable rule for a login step is: try once, then stop and ask.
The pattern that works
Treat login as a wall the agent detects rather than a task it performs. When it lands on a login page it did not expect, it asks a person for help with the page attached, the person completes the sign-in in the agent's own browser, and the agent resumes with the session intact. The fix is then compiled into a procedure so the next agent that hits the same wall follows it without anybody being paged.
from doubleoh import DoubleOh
oo = DoubleOh() # reads DOUBLEOH_API_KEY
def run(page, task):
# Ask first: has a person already cleared this wall?
hint = oo.skills_for(task)
if hint:
return follow(hint, page)
result = attempt(page, task)
if looks_like_login(page):
# Once. Not five times.
fix = oo.request_fix(url=page.url, task=task)
wait_for(fix) # a person signs in on this same browser
return attempt(page, task)
return resultThe second time that login appears, the first call returns the procedure and the human is never involved. That is the difference between an alerting tool and one that makes the problem go away.
Questions people ask
Why does my AI agent keep failing at the login page?
Because a login needs something the agent does not have: a credential, a second factor, or a human-shaped session. Retrying does not create any of those. Detect the login page, hand it to a person once, and persist the session.
Can I just give the agent the username and password?
You can, and it works until the site asks for a code, sees automation, or redirects to single sign-on. It also puts a secret in a prompt, which ends up in logs. A person signing in once inside the agent's browser is safer and survives all three.
How do I detect that my agent is on a login page?
Read the URL and the DOM, not the model's transcript. A password input, a redirect to an identity provider's domain, or a form whose submit does not change the URL are reliable signals.
Does DoubleOh bypass logins?
No. It gets a person to complete the login in the agent's live browser, records the shape of what they did without the characters they typed, and makes that available to the next run. Nothing is bypassed and no secret is stored.
DoubleOh is the reliability layer for AI agents. When one gets stuck, a person fixes it once in a live browser, and the fix becomes a skill the whole fleet follows from then on.
Start free