Skip to main content

Overview

Browser Use is a Python library for AI-powered browser automation. This guide walks you through deploying and running a Browser Use based project on Intuned. You’ll build a sample automation that purchases a product from an e-commerce site—without writing step-by-step Playwright code. The same patterns apply to any automation you build with the framework.
This guide assumes you have a basic understanding of Intuned projects. If you’re new to Intuned, start with the getting started guide.
Browser Use is Python-only and doesn’t support TypeScript.

When to use AI automation

Intuned supports AI-powered browser automation frameworks like Browser Use, Stagehand, and others. Use AI automation when:
  • Pages are dynamic — Elements change position, structure, or content unpredictably
  • You don’t know the exact page structure — Automating sites you haven’t mapped in detail
  • You want natural language control — Describe what to do instead of writing precise selectors
  • Traditional Playwright code is too brittle for your case — AI agents adapt to minor UI changes automatically
Browser Use is one option for AI automation on Intuned. The setup patterns in this guide apply to other AI frameworks as well. For a deeper dive into choosing between deterministic, AI-driven, and hybrid approaches, check out Flexible Automations.

Guide

Let’s build a purchase-item API with AI agents. The template handles all the Browser Use setup for you. You can develop with Browser Use in two ways:
  • Online IDE — Zero setup. Write, test, and deploy directly from your browser.
  • CLI — Use your favorite IDE with full version control.
1

Create a project

  1. Go to Intuned dashboard
  2. Select + New Project > Templates > Browser Use Template
  3. Name it and select Create Project
Create Browser Use project from template
2

Explore the project

The template includes a purchase-item API that uses AI agents to purchase products from an e-commerce site.Project structure:
my-browser-use-agent/
├── api/
│   └── purchase-item.py           # Main automation API
├── hooks/
│   └── setup_context.py           # Browser Use initialization
├── pyproject.toml                 # Dependencies
└── intuned.json                   # Project configuration
The automation code:
from playwright.async_api import Page
from typing import TypedDict
from browser_use import Agent, ChatOpenAI, Browser, Tools
from intuned_runtime import attempt_store


class Params(TypedDict):
    username: str
    password: str
    product_name: str
    first_name: str
    last_name: str
    zip_code: str


async def automation(page: Page, params: Params | None = None, **_kwargs):
    if params is None:
        raise Exception("params cannot be null")
    browser: Browser = attempt_store.get("browser")

    username = params.get("username")
    password = params.get("password")
    product_name = params.get("product_name")
    first_name = params.get("first_name")
    last_name = params.get("last_name")
    zip_code = params.get("zip_code")

    tools = Tools()

    agent = Agent(
        browser=browser,
        task=f"""1. Go to https://www.saucedemo.com/
2. Login with username '{username}' and password '{password}'
3. Find the product '{product_name}' and add it to cart
4. Go to cart
5. Proceed to checkout
6. Fill in the checkout information: First Name: '{first_name}', Last Name: '{last_name}', Zip Code: '{zip_code}'
7. Complete the purchase""",
        llm=ChatOpenAI(model="gpt-5-nano", temperature=0),
        flash_mode=True,
        tools=tools,
    )

    # Agent will run the task on current browser page
    # Since Browser-use uses CDP directly, the actions done by the agent won't be visible in the Playwright trace
    result = await agent.run()
    print(result)

    # Use the correct AgentHistoryList methods
    return {
        "success": result.is_successful(),
        "is_done": result.is_done(),
        "final_message": result.final_result() or "No result",
        "total_actions": result.number_of_steps(),
        "action_history": result.extracted_content(),
    }
What this does: Uses an AI agent to autonomously purchase a product from an e-commerce site. Takes login credentials, product name, and checkout details, then navigates through the entire purchase flow using flash_mode for optimized performance. Returns detailed execution results. Agent actions won’t appear in Playwright traces.
3

Run your automation

Run the AI agent to test your setup.
  1. In the IDE, select purchase-item from the API dropdown
  2. Enter the purchase parameters in the params panel
  3. Select Run
Running Browser Use in IDE
4

Deploy and test

Deploy your automation to Intuned’s infrastructure.
  1. In the Online IDE, select Deploy in the top-right corner
  2. After deployment completes, go to the project’s Runs page
  3. Select Start Run, then choose purchase-item API
  4. Enter purchase parameters and select Start Run
Running Browser Use agent in Dashboard
  1. After the run completes, view the purchase results
View Browser Use run results

How it works

  • The setup_context hook runs before your API executes. It creates a Browser instance using Intuned’s CDP URL and stores it in attemptStore
  • Your API retrieves the Browser instance from attemptStore and uses it to create AI agents
  • Parameters passed to your API control the agent’s behavior. Change these to adjust your automation flow.
Want to combine Playwright with Browser Use? Use Playwright for deterministic steps and Browser Use for AI decision-making. Set flash_mode=True to optimize costs. Learn more in Flexible Automations and Structuring Projects with AI Agents.