Augureaugure
Tools

Browser Tool

Automate web browsers with natural language via Stagehand

The browser tool gives the agent session-based browser automation powered by Stagehand. It uses a single tool with an action dispatch pattern -- one tool, 7 actions.

The agent can open browser sessions, navigate pages, interact with elements using natural language, extract structured data, and take screenshots. Sessions auto-expire after a configurable TTL (default: 120s) to prevent resource leaks.

Configuration

Add tools.browser to your augure.json5:

Local (Playwright)

{
  tools: {
    browser: {
      provider: "local",
      defaults: {
        headless: true,
        timeout: 30,
        viewport: { width: 1280, height: 720 },
      },
    },
  },
}

Cloud (Browserbase)

{
  tools: {
    browser: {
      provider: "browserbase",
      browserbase: {
        apiKey: "${BROWSERBASE_API_KEY}",
        projectId: "${BROWSERBASE_PROJECT_ID}",  // optional
      },
      defaults: {
        timeout: 30,
      },
    },
  },
}

When using local provider, Playwright must be installed (npx playwright install chromium).

Actions

ActionRequired ParamsDescription
open(none)Open a new browser session (optional: url to navigate immediately)
navigatesessionId, urlNavigate to a URL in an existing session
actsessionId, instructionPerform an action described in natural language (optional: variables)
extractsessionId, instructionExtract data from the page (optional: schema for structured output)
observesessionId, instructionList observable actions on the page matching the instruction
screenshotsessionIdTake a screenshot (returned as base64 PNG)
closesessionIdClose a browser session and release resources

Parameters

ParameterTypeDescription
actionstringRequired. One of the 7 actions listed above
sessionIdstringSession identifier returned by open
urlstringURL to navigate to
instructionstringNatural language instruction for act/extract/observe
variablesobjectKey-value pairs for variable substitution in instructions (e.g. %password%)
schemaobjectJSON Schema for structured extraction

Examples

Open a session and navigate

{
  "name": "browser",
  "arguments": {
    "action": "open",
    "url": "https://example.com"
  }
}

Returns: { "sessionId": "s_1708934400000_1" }

Interact with a page

{
  "name": "browser",
  "arguments": {
    "action": "act",
    "sessionId": "s_1708934400000_1",
    "instruction": "Click the login button"
  }
}

Extract structured data

{
  "name": "browser",
  "arguments": {
    "action": "extract",
    "sessionId": "s_1708934400000_1",
    "instruction": "Get the product name and price",
    "schema": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "price": { "type": "number" }
      }
    }
  }
}

Use variables for sensitive data

{
  "name": "browser",
  "arguments": {
    "action": "act",
    "sessionId": "s_1708934400000_1",
    "instruction": "Type %email% in the email field and %password% in the password field",
    "variables": {
      "email": "user@example.com",
      "password": "secret123"
    }
  }
}

Session Lifecycle

  1. Open creates a Stagehand instance and returns a sessionId
  2. Each action resets the TTL timer -- sessions stay alive while actively used
  3. Sessions auto-expire after the TTL (default 120s of inactivity)
  4. The agent should close sessions when done to free resources immediately
  5. On shutdown, all sessions are closed automatically

How It Works

Under the hood, the browser tool delegates to Stagehand V3 which combines Playwright with an LLM to understand page structure. When the agent calls act("Click the login button"), Stagehand uses the configured LLM model to identify the correct element and perform the action.

The LLM model used by Stagehand is configured via the llm.default section of your config (same provider, API key, and model as your main agent LLM).

Error Handling

  • If the browser config is not set, the tool returns [NOT CONFIGURED] with a link to docs
  • If provider is "browserbase" but browserbase.apiKey is missing, configCheck warns
  • Unknown or expired session IDs return success: false with an error message
  • Page navigation failures and Stagehand errors are caught and returned as tool errors

On this page