Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.62 KB

File metadata and controls

50 lines (36 loc) · 1.62 KB

Browser Use + AgentSIM: Automated Signup with Phone Verification

A Browser Use agent that navigates to a signup page, provisions a real carrier-grade phone number via AgentSIM, fills the form, waits for the OTP, and completes registration.

How it works

  1. The Browser Use agent navigates to a signup page
  2. When a phone number is needed, it calls provision_agentsim_number via the SDK
  3. The agent enters the real T-Mobile number in the form and submits
  4. It calls wait_for_agentsim_otp to receive the verification code
  5. The OTP is entered and the form is submitted
  6. The number is released back to the pool

Install

pip install browser-use agentsim-sdk
playwright install chromium

Environment

export AGENTSIM_API_KEY="asm_live_..."
export OPENAI_API_KEY="sk-..."  # Required for Browser Use LLM calls

Run

# Standalone SDK demo (no browser or LLM needed)
python browser_use_verify.py

# Full Browser Use agent (requires OPENAI_API_KEY + Playwright)
# Uncomment the run_browser_agent() call in browser_use_verify.py

Key patterns

  • Uses agentsim.provision() async context manager (not raw HTTP)
  • Tools() container with @tools.action(description=...) decorator
  • Returns ActionResult with include_in_memory=True so the agent remembers session IDs across steps
  • Async actions (async def) for non-blocking provisioning and OTP waits
  • OtpTimeoutError is caught and reported to the agent for retry logic

Links