> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Browser Use (Sandbox)

> AI-powered browser automation running in an E2B sandbox

## Overview

The Browser Use Sandbox tool runs the open-source [browser-use](https://browser-use.com) framework inside a secure E2B sandbox. Describe what you want the agent to do in plain language, and it will navigate the web, fill forms, extract data, and more — all powered by OpenAI models.

For Human-in-the-Loop workflows, set `keep_session: true` to pause after the task and receive a `sandbox_id`. Pass that `sandbox_id` back to a subsequent `BROWSER_USE_SANDBOX_RUN_TASK` step to reconnect to the same browser session and continue.

## Configuration

| Field            | Description                                                  |
| ---------------- | ------------------------------------------------------------ |
| `openai_api_key` | Your OpenAI API key. Leave blank to use Jinba Credit.        |
| `timeout`        | Execution timeout in milliseconds (default: 600000 = 10 min) |

## Inputs

| Field                | Type    | Description                                                                                                                                                                                             |
| -------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `task`               | string  | Natural-language description of what to do in the browser                                                                                                                                               |
| `sandbox_id`         | string  | E2B sandbox ID from a previous run with `keep_session: true`. When provided, reconnects to that session and continues. Use `{{steps.<step_id>.result.sandbox_id}}`. Leave empty to start a new session. |
| `llm_model`          | enum    | OpenAI model to use (`gpt-4.1` / `gpt-4.1-mini` / `gpt-5.1`)                                                                                                                                            |
| `max_steps`          | number  | Maximum agent steps (default: 20)                                                                                                                                                                       |
| `capture_screenshot` | boolean | Return a signed URL to the final browser screenshot                                                                                                                                                     |
| `keep_session`       | boolean | Keep the browser session alive after the task completes. Only used when starting a new session (no `sandbox_id`). Returns `sandbox_id` and `current_url` for use in a subsequent step.                  |

## Example — Simple task

```yaml theme={null}
- id: browse
  tool: BROWSER_USE_SANDBOX_RUN_TASK
  input:
    - name: task
      value: "Go to https://example.com and return the page title and main heading text."
    - name: llm_model
      value: gpt-4.1-mini
    - name: max_steps
      value: 10
```

## Example — Human-in-the-Loop form submission

```yaml theme={null}
- id: fill_form
  tool: BROWSER_USE_SANDBOX_RUN_TASK
  input:
    - name: task
      value: "Go to https://example.com/contact, fill in the name and email fields, then stop before clicking submit."
    - name: llm_model
      value: gpt-4.1
    - name: keep_session
      value: "true"

- id: wait_for_approval
  tool: WAIT_FOR_APPROVAL
  input:
    - name: message
      value: "Please review the filled form and approve to submit."

- id: submit_form
  tool: BROWSER_USE_SANDBOX_RUN_TASK
  input:
    - name: sandbox_id
      value: "{{steps.fill_form.result.sandbox_id}}"
    - name: task
      value: "Click the submit button. Reviewer comment: {{steps.wait_for_approval.result.comment}}"
    - name: llm_model
      value: gpt-4.1
    - name: capture_screenshot
      value: "true"
```
