# agent_s4 The Agent S4 package, from the paper [Evolving Agent Interfaces](https://arxiv.org/abs/2610.28601). It evolves a **shadow interface**: a small Python tool library that a computer-use agent imports to operate a desktop. Each step, a **Builder** agent edits an interface on the host. A **task agent** then runs benchmark tasks on fresh AWS VMs with that interface installed, and its score becomes the variant's fitness. Computer-use agents are limited by the interfaces humans give them: an agent may type a spreadsheet cell by cell when one line of code would do. Agent S4 builds those interfaces itself. The Builder studies the task agent's trajectories on synthetic training tasks, without success labels, and writes and revises the interfaces and the knowledge of when to use them. Population-based evolution then keeps the variants that score best on validation tasks the Builder never sees, which favors changes that generalize. ## Results On OSWorld V2, Agent S4 with Qwen3.8-27B and its evolved interfaces reaches a **21.3%** binary score, a new state of the art for open-source computer-use agents and 3.8 times the same model with fixed interfaces. That is above GPT-5.5 (13.0%) and Claude Opus 4.8 (20.6%), at about 4.3% and 1.5% of their respective costs. > **Note:** OSWorld V2 scores a task as a strict binary pass/fail — 1 only if > every part of the task's checker succeeds, 0 otherwise, with no partial > credit for getting most of the way there. That's why these numbers look low > next to benchmarks that award partial credit: OSWorld V2 is widely regarded > as the hardest computer-use benchmark, and these are state-of-the-art > results under that strict scoring, not an indication of low real-world > reliability. On ScienceBoard, the evolved interfaces raise the success rate from 41.4% to 58.6% with the same model. ## Setup guides This file describes the code. For setup, credentials and the launch scripts behind the published runs, see the workspace READMEs in the [Agent-S repository](https://github.com/simular-ai/Agent-S): - [`osworld_setup/s4/README.md`](https://github.com/simular-ai/Agent-S/blob/main/osworld_setup/s4/README.md): OSWorld-V2, which is the default benchmark. - [`scienceboard_setup/s4/README.md`](https://github.com/simular-ai/Agent-S/blob/main/scienceboard_setup/s4/README.md): ScienceBoard. ## Install `agent-s4` is its own package; installing `gui-agents` does not include it. The package contains only the code. A run also reads setup files from the Agent-S repository: the Builder prompts, the seed interface, the task splits and the pinned Prime Agent runtime, all under `osworld_setup/s4/`. So you need a clone of the repository either way. Install the package from the clone: ```bash git clone https://github.com/simular-ai/Agent-S.git cd Agent-S pip install -e ./agent_s4 ``` or install it from PyPI and point it at the clone: ```bash pip install agent-s4 export SHADOW_EVOL_SHARED_ROOT=/path/to/Agent-S/osworld_setup/s4 ``` Without those files, `python -m agent_s4.cli run` stops and says what to set. The benchmark itself (the OSWorld-V2 checkout, AWS and model credentials) is set up as described in the workspace READMEs above. ## Entry points | Command | What it does | |---|---| | `python -m agent_s4.cli run ...` | Starts or resumes an experiment (`--help` lists the options). | | `python -m agent_s4.cli rerun --config-path runs//config.json` | Runs again from a saved config. | | `python -m agent_s4.osworld_v2_preflight` | Runs the offline OSWorld-V2 workspace checks on their own. | | `python -m agent_s4.eval.osworld_v2 ...`, `python -m agent_s4.eval.scienceboard_prime ...` | Eval workers. The evaluator harness normally starts these; they can also be run by hand on chosen tasks. | `run` defaults to `--benchmark osworld_v2`, which uses the splits pinned in `config/osworld_v2_release_pin.json`: `osworld_v2_train_50.json`, `osworld_v2_val_25.json` and `osworld_v2_test.json` as the held-out set. No train or val splits ship for `--benchmark osworld` (the original OSWorld) or `--benchmark scienceboard`, so both require `--train-set` and `--val-set`. ## How a run works **1. Bootstrap** (`orchestrator.run`): - If Prime Agent is used, checks its pinned runtime. For OSWorld-V2 it also runs the workspace preflight and checks the configured splits against the release pin. - Makes one clone of the benchmark's Evol checkout per island, named `