2FA in browser automation: the person enters the code, the agent does the rest

Two-factor sign-in is built to stop scripts, and the usual workarounds are a stored TOTP secret, a saved storage state that expires, or a test account with 2FA switched off. When an AI agent works for you in your own browser, there is a simpler answer: the code is your step. Qiksy Bridge stops at the sign-in, tells you, and waits for the page to come back, then the agent continues in the same tab with the session your browser now holds.

Add Qiksy Bridge to Chrome

Free. Then run npx qiksy-mcp init in your project.

What you get

  1. No secrets in the agent: no stored password, no TOTP seed, no exported cookies.
  2. A code from your phone, a passkey or a hardware key all work, because you are the one using them.
  3. The wait lasts up to five minutes and survives the redirects of the sign-in provider.
  4. After that the session lives in your Chrome, so the next run usually needs no sign-in at all.
  5. Works the same in Claude Code, Cursor, VS Code, Windsurf, Claude Desktop and Codex.

Questions and answers

Can it fully automate 2FA for a test pipeline?

No, and it is not meant to. For an unattended pipeline a test account and a stored session in Playwright is the usual answer. The bridge is for an agent working beside a person.

Codex cuts tool calls after a minute. Does the wait still work there?

Yes. In Codex the wait answers within 50 seconds and the agent calls it again, or you raise tool_timeout_sec as the README shows.

Does it solve captchas?

No, by design. A captcha, a password and a code from a phone are the person's step. The agent tells them, waits, and carries on once the page moves.

Related