## TL;DR
Do not let the agent fight the login form. Give the browser session a pre authenticated state, through a stored session from a real sign in or the product SSO flow, or move the step to the Looker API 4.0 entirely if the task allows it. Login pages defeat automation with redirects, MFA prompts and bot checks, and an agent retrying credentials there can lock the account.

```text
browser automation failed on Looker admin explore page: agent stuck on the login page with error
```

## Use this when
- The agent run fails and its screenshots or page dumps show a sign in page instead of the target page.
- The same automation worked until a session expired, a password changed, or SSO settings changed.
- The account shows lockout warnings or repeated failed sign in attempts from the automation.

## Not for this skill when
- The browser reaches the target page but the task step fails there. Debug the step itself, not the session.
- A supported Looker API 4.0 path exists and is already in use. Stay on the API and retire the browser step.

## Steps
1. Open the failed run artifacts and confirm the browser state at failure, specifically that the page shown is a sign in page for Looker. Verify: the screenshot or page text shows the login form rather than the target page
2. Check whether the task the browser was performing can be done through the API instead, and prefer that path where it can. Verify: the step is either reassigned to an API call or confirmed as browser only
3. For a browser only step, create the session through a real sign in once, by a human or an approved SSO flow, and store the resulting session state securely for the agent to load. Verify: the agent browser opens the target page already signed in using the stored state
4. Remove any credential typing from the automation so the agent never submits passwords to a login form. Verify: the automation code contains no password entry step
5. Add a session check at the start of the browser step that detects a login page and stops with a clear session expired error instead of looping. Verify: an expired session test produces the clear error on the first check
6. Rerun the original task end to end and confirm the browser step reaches the target page and completes. Verify: the run finishes with the step done and no login page in its artifacts

## Why it happens
Login flows are designed to resist automation, with MFA, bot detection and lockouts, so an agent that treats them as a normal form fights a control that is working correctly. The robust patterns are session reuse from a legitimate sign in, or avoiding the browser for API covered work. Both respect the security design instead of training the agent to defeat it, and both remove the lockout risk that credential retrying creates.

The step that failed drives a browser to the Looker admin explore page, which sits behind the product sign in. Sessions expire, SSO redirects drop the automation return path, and MFA or bot challenges stop form filling outright. The agent then loops on a page that will never lead to the task, reporting a generic automation failure. Anything the browser was doing on that page, checking an explore, publishing, or editing, almost always has an API equivalent that avoids the session problem completely.

Operational notes for browser steps in agent pipelines. Treat every browser step as suspect until proven necessary, and record in the runbook why the API could not do the job, because those reasons expire as APIs improve and the browser step remains as permanent fragility. Where a browser step is justified, its artifacts matter, a screenshot and the page URL at failure should be captured automatically, since a browser failure without a screenshot is nearly undebuggable after the fact.
## Variants and edge cases
### browser automation stuck login page Looker session reuse
The session reuse phrasing for browser only steps.
### agent cannot sign in Looker admin page use API instead
The substitution variant that retires the browser step.
### automation session expired detect login page stop error
The detection variant for failing fast on expired sessions.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_Pjl7cWmJpSlP1vgACvEU0g
