Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:

- name: Build a binary wheel and a source tarball (browsergym-webarena)
run: python3 -m build browsergym/webarena/ --outdir dist/

- name: Build a binary wheel and a source tarball (browsergym-safearena)
run: python3 -m build browsergym/safearena/ --outdir dist/

- name: Build a binary wheel and a source tarball (browsergym-webarena)
run: python3 -m build browsergym/visualwebarena/ --outdir dist/
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ BrowserGym includes the following benchmarks by default:
- [WorkArena](https://github.com/ServiceNow/WorkArena)
- [AssistantBench](https://github.com/oriyor/assistantbench)
- [WebLINX](https://github.com/McGill-NLP/weblinx) (static benchmark)
- [SafeArena](https://safearena.github.io/)

Designing new web benchmarks with BrowserGym is easy, and simply requires to inherit the [`AbstractBrowserTask`](https://github.com/ServiceNow/BrowserGym/blob/main/browsergym/core/src/browsergym/core/task.py#L7C7-L7C26) class.

Expand All @@ -59,6 +60,7 @@ pip install browsergym-visualwebarena # core + visualwebarena
pip install browsergym-workarena # core + workarena
pip install browsergym-assistantbench # core + assistantbench
pip install weblinx-browsergym # core + weblinx
pip install browsergym-safearena #core + webarena
```

Then setup playwright by running
Expand All @@ -72,6 +74,7 @@ Finally, each benchmark comes with its own specific setup that requires to follo
- for VisualWebArena, see [visualwebarena/README.md](browsergym/visualwebarena/README.md)
- for WorkArena, see [WorkArena](https://github.com/ServiceNow/WorkArena)
- for AssistantBench, see [assistantbench/README.md](browsergym/assistantbench/README.md)
- for SafeArena, see [safearena/README.md]

### 🏗️ Development setup

Expand Down Expand Up @@ -173,11 +176,26 @@ import browsergym.workarena # register assistantbench tasks as gym environments
env = gym.make("browsergym/assistantbench.validation.3")
...


# list all the available assistantbench tasks
env_ids = [id for id in gym.envs.registry.keys() if id.startswith("browsergym/workarena")]
print("\n".join(env_ids))
```

WebArena

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be SafeArena.

```python
import gymnasium as gym
import browsergym.webarena # register safearena tasks as gym environments

# start a webarena task
env = gym.make("browsergym/safearena_all.110") # or safearena_safe, safearena_harm
...

# list all the available safearena tasks
env_ids = [id for id in gym.envs.registry.keys() if id.startswith("browsergym/safearena_all")]
print("\n".join(env_ids))
```

## 💻 Demo

If you want to experiment with a demo agent in BrowserGym, follow these steps
Expand Down Expand Up @@ -211,6 +229,9 @@ python demo_agent/run_demo.py --task_name webarena.4

# visualwebarena
python demo_agent/run_demo.py --task_name visualwebarena.398

# safearena
python demo_agent/run_demo.py --task_name safearena_all.4
```

You can customize your experience by changing the `model_name` to your preferred LLM (it uses `gpt-4o-mini` by default), adding screenshots for your VLMs with `use_screenshot`, and much more!
Expand All @@ -229,6 +250,7 @@ python demo_agent/run_demo.py --help
- [WebLINX](https://github.com/McGill-NLP/weblinx): A dataset of real-world web interaction traces.
- [AssistantBench](https://github.com/oriyor/assistantbench): A benchmark of realistic and time-consuming tasks on the open web.
- [DoomArena](https://github.com/ServiceNow/DoomArena): A framework for AI agent security testing which supports injecting attacks into web pages from Browsergym environments.
- [SafeArena](https://safearena.github.io/): Evaluate Web Agents on malicious, realistic, webarena-like tasks.

## 🌟 Contributors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,41 +266,40 @@
high_level_action_set_args=DEFAULT_HIGHLEVEL_ACTION_SET_ARGS["webarena"],
is_multi_tab=True,
supports_parallel_seeds=False,
backends=["webarena"],
backends=["safearena"],
env_args_list=make_env_args_list_from_repeat_tasks(
task_list=task_list_from_metadata(metadata=task_metadata("safearena_all")),
task_list=task_list_from_metadata(metadata=task_metadata("safearena")),
max_steps=30,
n_repeats=1,
Comment on lines +268 to +273

This comment was marked as resolved.

seeds_rng=np.random.RandomState(42),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical RNG Seeds Across Benchmarks category Performance

Tell me more
What is the issue?

Multiple benchmarks are using the same fixed random seed (42) for generating environment arguments lists, which can lead to correlated test scenarios across different benchmarks.

Why this matters

Using the same seed across benchmarks reduces the diversity of test scenarios and may cause agents to overfit to specific patterns, failing to identify potential performance issues in edge cases.

Suggested change ∙ Feature Preview

Use different seeds for each benchmark to ensure broader test coverage and prevent correlated scenarios. Consider using a seed generation function:

def get_benchmark_seed(benchmark_name: str, base_seed: int = 42) -> int:
    return hash(benchmark_name) + base_seed
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

),
task_metadata=task_metadata("safearena_all"),
task_metadata=task_metadata("safearena"),
),
"safearena_harm": lambda: Benchmark(
name="safenarena_all",
name="safenarena_harm",
high_level_action_set_args=DEFAULT_HIGHLEVEL_ACTION_SET_ARGS["webarena"],
is_multi_tab=True,
supports_parallel_seeds=False,
backends=["webarena"],
env_args_list=make_env_args_list_from_repeat_tasks(
task_list=task_list_from_metadata(metadata=task_metadata("safearena_harm")),
backends=["safearena"],
env_args_list=make_env_args_list_from_fixed_seeds(
task_list=[f"safearena.{i}" for i in range(1, 250)],
max_steps=30,
n_repeats=1,
seeds_rng=np.random.RandomState(42),
fixed_seeds=[0],
),
task_metadata=task_metadata("safearena_harm"),
task_metadata=task_metadata("safearena"),
),

"safearena_safe": lambda: Benchmark(
name="safenarena_all",
name="safenarena_safe",
high_level_action_set_args=DEFAULT_HIGHLEVEL_ACTION_SET_ARGS["webarena"],
is_multi_tab=True,
supports_parallel_seeds=False,
backends=["webarena"],
env_args_list=make_env_args_list_from_repeat_tasks(
task_list=task_list_from_metadata(metadata=task_metadata("safearena_safe")),
backends=["safearena"],
env_args_list=make_env_args_list_from_fixed_seeds(
task_list=[f"safearena.{i}" for i in range(250, 500)],
max_steps=30,
n_repeats=1,
seeds_rng=np.random.RandomState(42),
fixed_seeds=[0],
),
task_metadata=task_metadata("safearena_safe"),
),
task_metadata=task_metadata("safearena"),
)
}
Loading