Skip to content
Browserbase
    • Primitives
      • BrowsersCloud browsers for your agent to use the web
      • AgentsScale fully managed browser agents with simple prompts
      • SearchFind relevant websites from a single query
      • FetchRetrieve web data as agent-ready HTML, JSON, or markdown
      • RuntimeScalable, sandboxed environments for agent deployments
      • IdentityAuthenticate your agent to navigate the web like a human
      • ModelsUse any model with a single API key
      • ObservabilityUnified debugging your agent across replays, logs, and prompts
    • Open Source
      • Browse CLIGive your agent browsing skills with a single command
      • StagehandThe most popular AI browser automation framework
    • Use Cases
      • Browser Agents
      • Automated Testing
      • Workflow Automation
      • Web Data Extraction
      All use cases
    • Industries
      • AI & Agent Platforms
      • Healthcare
      • Fintech
      • GTM
      • Legal
    • Resources
      • Blog
      • Customers
      • Enterprise
      • Templates
  • Pricing
  • Docs
  • Log in
Log in
Sign up
Get a demo

Human-in-the-loop agent

Build a human-in-the-loop AI agent that pauses for user input mid-task, then resumes autonomously with Stagehand and Browserbase.

Human-in-the-loop agent demo

Works with

TypeScriptTypeScriptStagehandStagehand

Built by

Browserbase

Support

support@browserbase.com

Resources

Browserbase docsStagehand websiteStagehand docs
Copy prompt to run with your AI agent
npx create-browser-app --template agent-with-human-in-loop

Send this template to your email, or view it on your desktop for the source code.

Get started with human-in-the-loop automation

Give a Stagehand Agent a task and let it work autonomously. When it hits something it can't answer, it pauses and asks the human via a custom `askHuman` tool, then picks up where it left off.

Watch the whole thing happen in real time through Browserbase Live View with an SSE-powered activity log streaming every step. This template wires up the full loop: agent execution, human input collection, and resume logic, all in a single Next.js app. Perfect for assisted form filling, approval workflows, and supervised data entry where some decisions need a human in the loop.

Steps

  1. Start a Browserbase session and navigate to the target job application page.
  2. The Stagehand Agent begins filling out the application autonomously.
  3. When the agent encounters a field it cannot answer, it invokes the askHuman tool to pause and prompt the user.
  4. The user responds via the frontend UI, and the agent resumes with the provided information.
  5. The agent completes and submits the application, streaming progress via SSE throughout.

Most Popular Templates

Quickstart: Playwright

Connect to a cloud browser via Playwright and Browserbase, navigate a real website, interact with UI elements, and extract page content.

Quickstart: Playwright

AI browser agent: Microsoft Fara-7B

Execute autonomous web tasks using Microsoft's Fara-7B computer use model

AI browser agent: Microsoft Fara-7B

Scrape with geolocation proxies

Route browser automation traffic through specific geolocations to access region-specific content

Scrape with geolocation proxies
Browserbase

Primitives

  • Browsers
  • Web APIs
  • Runtime
  • Identity
  • Model Gateway
  • Observability
  • Stagehand
  • MCP

Industries

  • AI
  • Healthcare
  • GTM
  • Tax
  • Legal

Developers

  • Docs
  • Templates
  • APIs & SDKs
  • Changelog
  • Status
  • Github

Company

  • Careers
  • Customers
  • Partner with Us
  • Trust & Security

Community

TwitterLinkedinYoutube
  • Privacy Policy
  • Terms of Service

Community

TwitterLinkedinYoutube
  • Privacy Policy
  • Terms of Service