Hand a login or CAPTCHA to a human mid-run, then continue

A browser task can reach a step an agent should not complete: a password prompt, two-factor approval, or a CAPTCHA. Grip (gripui) can hand control to the authorized person and then return it to the agent. The goal is to continue from the authenticated browser session the person completed, without putting passwords or one-time codes into an agent conversation.

The handoff has an important edge. When running headless, gripui human-drives restarts the browser visibly so a person can interact with it. Grip restores open tabs from the profile, yet unsaved form state on a page may not survive that restart. Sign in before filling out a long form, and after control returns, inspect the current page before assuming authentication succeeded.

If an already signed-in site prompts for a quick in-place device approval such as Touch ID mid-form, approve that prompt directly and refresh the HUD rather than cycling through human-drives. This guide separates a runnable headless control-transfer check from a real human login. The test below did not solve a CAPTCHA, open a visible window, or sign into an account; it verifies the control-transfer commands and state retention on a public page.

Prepare the job and its boundaries

Use a dedicated persistent profile (gripui attach <name>, released later with gripui detach) for the accounts involved, rather than copying every everyday browser session onto the agent's workspace. Persistent profiles retain cookies across runs, though sites can expire sessions and the profile data is sensitive. A profile separates browser contexts; it does not sandbox an agent that can also read files or run shell commands.

Tell the agent what it may do after authentication and what requires your review. A signed-in session carries the account's privileges even though the agent never saw the password. For a purchase or other consequential commitment, inspect the details and complete the commitment yourself. If a site prohibits automated activity, stop rather than proceeding just because a browser is open.

Grip requires an active paid licence for browser actions and an AI agent you supply; there is no free tier, and browser commands stop if a licence ends or becomes invalid. Solo Dev ($79/year) covers one developer for local personal and commercial use on up to 2 machines (excluding CI runners). Pro Runner ($499/year) covers headless, CI and production workflows on up to 3 activations, while Platform (from $10k/year) covers redistribution, bundling or external user access. Solo Dev and Pro Runner renew annually with a 2-day refund window, and Grip renews its signed licence lease with gripui.com every 5 hours (gripui license activate <your-key>); see the pricing page and download instructions.

The public-page exercise below was run on a macOS test host with Grip 6.5.1 in a temporary headless profile (@grip-review01-20261204). Use another unused profile name if that one exists.

gripui @grip-review01-20261204 set temporary
gripui @grip-review01-20261204 set headless
gripui @grip-review01-20261204 go https://example.com
gripui @grip-review01-20261204 hud

On this run, go completed synchronously in 2.05 seconds wall time (ok: navigated tab=1 url=https://example.com), and the first hud call took 0.41 seconds wall time. Any one-shot command still running after 2 seconds returns a background handle checked via gripui handle (or pass GRIPUI_SYNC=1 to block). The first HUD showed one action: [1] click link:"Learn more". These single timings are local observations, not general benchmarks.

Observe before handing off

In this run, the action number came from the live HUD. It is an observed example, not a fixed selector for your page:

gripui @grip-review01-20261204 do 1
gripui @grip-review01-20261204 hud

The click returned ok: clicked tab=1 Learn more, and the next HUD showed the IANA Example Domains page (https://www.iana.org/help/example-domains). Because the available actions changed (s1 to s2), that HUD printed the new sheet and exited nonzero (1). Read the output and new refs; a changed-sheet exit is a guard against stale command chains, not a failed click.

In a real workflow, the agent stops when a login, CAPTCHA or two-factor prompt appears. It should explain what needs attention without asking for a password or verification code. A human must be available to use the visible browser window. Treat a verification prompt as a boundary for authorized human action, never as something for an agent to evade.

Transfer control and return

In the headless test below, --no-restart was passed so no visible window opened:

gripui @grip-review01-20261204 human-drives --no-restart
gripui @grip-review01-20261204 agent-drives
gripui @grip-review01-20261204 hud

Grip reported that human-drives retained browser and page state while remaining headless, and agent-drives returned control with state retained. The follow-up hud exited 0 (s2) and still showed the IANA page. Because --no-restart suppresses the visible window, a person cannot use it for an interactive sign-in; it tests only the mode-transition commands.

For a real handoff from headless mode, omit --no-restart so Grip restarts the browser visibly, keeping the profile and restoring open tabs. The authorized person completes the login or challenge directly in the browser window and tells the agent when finished. The agent then runs gripui agent-drives and takes a fresh gripui hud; see the Grip handoff tutorial.

Treat the returned session as a checkpoint, not proof of login. A site may bounce back to a sign-in screen, leave verification pending, or be signed into the wrong account. Verify a clear signed-in indicator and confirm the intended account before taking the next step.

Continue from what is actually there

Once control is back, the agent reads the current page and acts only on refs from that fresh observation. Do not assume earlier ref numbers or half-filled form values survived a restart. If a modal is open (gripui hud --layer active) or controls live inside a frame (gripui frame list), inspect that context first. If the wrong account is active, stop and fix the account before acting.

For any write operation, distinguish three events: clicking a control, receiving a click receipt, and observing the committed record. The first two do not prove the server accepted the change. Inspect the resulting confirmation or record, and do not blindly repeat a submission when the outcome is uncertain.

The temporary profile used here holds no durable login. When you need a session to persist across runs, use a dedicated named profile (gripui attach <name>), keep only the accounts needed for that job, and remember that a profile does not isolate an agent from the rest of your machine.

End the disposable exercise

gripui quit --profile grip-review01-20261204

The quit receipt reported that the browser stopped and the temporary profile was deleted. That cleanup is ideal for a public exercise, not for a login you want to reuse. For persistent profiles, decide when to detach (gripui detach) or quit (gripui quit) and protect the stored profile directory.

When no authorized person is available to clear a check, pause the task and preserve only what is safe to keep. When a site's rules prohibit automated access, stop. A clean handoff draws a clear line: the person handles authentication, the agent resumes from a fresh observation, and both verify the result.

Next: for a remote browser you own, use gripui connect browserbox '<login-link>' --engine with your BrowserBox login link; that remote connection was not exercised here. Evaluate BrowserBox or see Grip pricing.

Your agent. Your browser.

Put it to work.

Get started

macOS · Linux · Windows
Paid licence required. Bring your own AI agent.

Demo recording

Player unavailable? Watch on YouTube ↗