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.
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.
from playwright.async_api import Pagefrom typing import TypedDictfrom browser_use import Agent, ChatOpenAI, Browser, Toolsfrom intuned_runtime import attempt_storeclass Params(TypedDict): username: str password: str product_name: str first_name: str last_name: str zip_code: strasync 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 cart4. Go to cart5. Proceed to checkout6. 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.
In the IDE, select purchase-item from the API dropdown
Enter the purchase parameters in the params panel
Select Run
4
Deploy and test
Deploy your automation to Intuned’s infrastructure.
In the Online IDE, select Deploy in the top-right corner
After deployment completes, go to the project’s Runs page
Select Start Run, then choose purchase-item API
Enter purchase parameters and select Start Run
After the run completes, view the purchase results
from playwright.async_api import Pagefrom typing import TypedDictfrom browser_use import Agent, ChatOpenAI, Browser, Toolsfrom intuned_runtime import attempt_storeclass Params(TypedDict): username: str password: str product_name: str first_name: str last_name: str zip_code: strasync 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 cart4. Go to cart5. Proceed to checkout6. 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 locally
Test your automation locally:
Copy
Ask AI
yarn intuned run api purchase-item '{"username": "standard_user", "password": "secret_sauce", "product_name": "Sauce Labs Backpack", "first_name": "John", "last_name": "Doe", "zip_code": "0000"}'
The agent logs in, finds the product, and completes the purchase.
4
Deploy and test
Deploy your automation using the CLI:
Copy
Ask AI
yarn intuned deploy
After deployment, test in the Dashboard:
Go to the project’s Runs page
Select Start Run, then choose purchase-item API
Enter purchase parameters and select Start Run
After the run completes, view the purchase results
The setup_contexthook 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.