ManipulationArena / release /docs /GETTING_STARTED.md
krystal7's picture
Add files using upload-large-folder tool
0cc4f3a verified
|
Raw History Blame Contribute Delete
7.38 kB
# Install and run
The commands below use Ubuntu 24.04 on an x86_64 machine with Linux amd64 containers. Keep configuration, Python environments and run outputs outside the release directory.
## Install host dependencies
```bash
sudo apt-get update
sudo apt-get install -y docker.io python3 python3-venv curl xz-utils
sudo systemctl enable --now docker
sudo usermod -aG docker "$USER"
```
Sign out and sign in again so the Docker group takes effect. Open a Bash shell, then set the release path and an external working directory:
```bash
cd /path/to/ManipulationArena
export MANIPULATIONARENA_ROOT="$PWD"
export PYTHONDONTWRITEBYTECODE=1
export ARENA_HOME="$HOME/.local/share/manipulationarena"
mkdir -p "$ARENA_HOME/tools" "$ARENA_HOME/config" "$ARENA_HOME/runs"
python3 -m venv "$ARENA_HOME/venv"
source "$ARENA_HOME/venv/bin/activate"
python -m pip install 'requests>=2.31' 'PyYAML>=6'
python -B -m manipulationarena validate --require-checksums
```
Install Node.js 22 for the pinned host Red CLI. The MEMORY channel uses its own bundled Node.js 20 inside task containers.
```bash
curl --fail --location https://nodejs.org/dist/v22.14.0/node-v22.14.0-linux-x64.tar.xz \
--output "$ARENA_HOME/tools/node-v22.14.0-linux-x64.tar.xz"
curl --fail --location https://nodejs.org/dist/v22.14.0/SHASUMS256.txt \
--output "$ARENA_HOME/tools/SHASUMS256.txt"
(cd "$ARENA_HOME/tools" && sha256sum --check --ignore-missing SHASUMS256.txt)
tar -xJf "$ARENA_HOME/tools/node-v22.14.0-linux-x64.tar.xz" -C "$ARENA_HOME/tools"
export PATH="$ARENA_HOME/tools/node-v22.14.0-linux-x64/bin:$ARENA_HOME/claude/bin:$PATH"
npm install --global --prefix "$ARENA_HOME/claude" @anthropic-ai/claude-code@2.1.303
node --version
claude --version
docker info
```
## Download and load the runtime image
Fill `ARENA_IMAGE_URL` with the download link in the README. Set `ARENA_IMAGE` to the image name printed by `docker load`.
```bash
ARENA_IMAGE_URL=''
curl --fail --location "$ARENA_IMAGE_URL" --output "$ARENA_HOME/native-runtime.tar"
docker load --input "$ARENA_HOME/native-runtime.tar"
export ARENA_IMAGE='IMAGE_NAME_FROM_DOCKER_LOAD'
python -B -m manipulationarena doctor --image "$ARENA_IMAGE"
```
The image contains AppWorld, Gaia2, MedAgent, HealthAgent and Tau banking, together with their native tools and fixed auxiliary runtime dependencies. Native suites may fetch their original dependencies while running; allow network access to the configured model APIs and package sources. Runtime dependencies are listed in [DEPENDENCIES.md](DEPENDENCIES.md).
## Configure model APIs
```bash
cp config/roles.example.json "$ARENA_HOME/config/roles.json"
"${EDITOR:-vi}" "$ARENA_HOME/config/roles.json"
```
Set each role's `api_url` and the Blue `model`. Red remains Claude Code with `deepseek-v4.1-flash`. Judge, native scorer and user simulator retain their supplied model identities and can each use a separate endpoint and credential.
```bash
export ARENA_RED_API_KEY='YOUR_RED_KEY'
export ARENA_BLUE_API_KEY='YOUR_BLUE_KEY'
export ARENA_JUDGE_API_KEY='YOUR_JUDGE_KEY'
export ARENA_NATIVE_SCORER_API_KEY='YOUR_NATIVE_SCORER_KEY'
export ARENA_USER_SIMULATOR_API_KEY='YOUR_USER_SIMULATOR_KEY'
```
The example uses DSH for Blue. For another harness, install its adapter in the runtime image and configure `roles.blue.harness`, `roles.blue.adapter` and `roles.blue.python` as described in [BLUE_ADAPTERS.md](BLUE_ADAPTERS.md). Configure authorized package sources in `environment.package_index_url` and `environment.package_extra_index_url` when required for pinned dependencies.
For a different DSH model, declare its actual `roles.blue.capabilities.context_window` and `max_output_tokens`; see [Blue configuration](BLUE_ADAPTERS.md). These fields describe model capacity and do not change the native evaluation budget.
## Check the runtime
The lightweight check above inspects the daemon and local image only. The full check starts a local container and writes its findings to a fresh external directory:
```bash
python -B -m manipulationarena doctor --full \
--config "$ARENA_HOME/config/roles.json" --image "$ARENA_IMAGE" \
--output "$ARENA_HOME/runs/preflight"
```
It checks host dependencies and CLI versions, credentials, configured container limits, the native manifest, task metadata, suite assets and interpreters, Judge dependencies and Blue adapter imports or DSH provisioning prerequisites. Use `--family FAMILY` or repeated `--unit-key KEY` to check a selection. A failed check exits with code 1. Details are in `preflight.json`; the stopped container is retained.
Add `--check-apis` to query each role's `/models` endpoint from its execution location and verify that the configured model is listed. This sends authenticated discovery requests and performs no inference. A provider without `/models` can be checked with the native first run instead. Full preflight does not execute task tools or attack hooks.
## Run one unit
List the dataset, select a unit and validate its prepared plan:
```bash
python -B -m manipulationarena inspect
ARENA_UNIT="$(python -B -c 'from manipulationarena.dataset import Dataset; print(Dataset().select()[0].key)')"
python -B -m manipulationarena inspect --unit-key "$ARENA_UNIT" --show-plan
ARENA_PREPARE="$(mktemp -d "$ARENA_HOME/runs/prepare.XXXXXXXX")"
python -B -m manipulationarena prepare --unit-key "$ARENA_UNIT" \
--config "$ARENA_HOME/config/roles.json" --image "$ARENA_IMAGE" \
--output "$ARENA_PREPARE/unit" --check-plan
```
Run it in a fresh output directory. This command calls the configured model APIs and executes the native task:
```bash
ARENA_RUN="$(mktemp -d "$ARENA_HOME/runs/run.XXXXXXXX")"
python -B -m manipulationarena run --unit-key "$ARENA_UNIT" \
--config "$ARENA_HOME/config/roles.json" --image "$ARENA_IMAGE" \
--output "$ARENA_RUN/unit"
```
The equivalent executable DSH example uses the same native tools, event persistence and attack gates:
```bash
python -B examples/run_dsh.py --unit-key "$ARENA_UNIT" \
--config "$ARENA_HOME/config/roles.json" --image "$ARENA_IMAGE" \
--output "$ARENA_HOME/runs/dsh-example"
```
Each unit workspace contains `execution.json`, `attack_plan.json`, `attempt.json`, `arena_result.json`, private role files and native evidence under `runs/`. A valid `arena_result.json` has `status` equal to `attack_success` or `attack_failure`; an exit code alone is not an attack verdict.
## Run and resume a batch
```bash
python -B -m manipulationarena batch \
--config "$ARENA_HOME/config/roles.json" --image "$ARENA_IMAGE" \
--output "$ARENA_HOME/runs/benchmark"
python -B -m manipulationarena batch --resume \
--config "$ARENA_HOME/config/roles.json" --image "$ARENA_IMAGE" \
--output "$ARENA_HOME/runs/benchmark"
python -B -m manipulationarena summarize --output "$ARENA_HOME/runs/benchmark"
```
`batch` runs the selection sequentially. Omit filters for all 888 units, or use `--family`, repeated `--unit-key`, and `--limit`. Resume with the same selection and configuration. It skips valid verdicts and runs units that have never started. Add `--retry-incomplete` explicitly to retry incomplete attempts; their evidence is retained in separate directories. `summary.json` and `summary.csv` report valid verdicts and other outcomes separately. Output paths, success fields and budget accounting are described in [EVALUATION.md](EVALUATION.md).