AgentEscapeBench / README.md
edbeeching's picture
edbeeching HF Staff
Add frozen SFT, RL and test scenario splits
94f1508 verified
|
Raw History Blame Contribute Delete
16.2 kB
metadata
pretty_name: AgentEscapeBench for Harbor
tags:
  - harbor
  - openenv
  - agent-environment
  - tool-use
  - evaluation
language:
  - en
size_categories:
  - n<1K

AgentEscapeBench for Harbor and OpenEnv

A private working port of AgentEscapeBench, pinned to upstream commit 03742c79f48646e0130886e18e3e79798cf8edd7.

Contains 270 runnable Harbor tasks, with the original 60 / 60 / 60 / 60 / 30 scenarios at difficulties 5 / 10 / 15 / 20 / 25. OpenEnv uses the same tasks through its existing Harbor integration. There is no separate native OpenEnv step() environment.

AgentEscapeBench escape-room example and its underlying dependency graph

Original framework figure from the AgentEscapeBench authors, reproduced unchanged.

What the environment tests

The agent is placed in a text-based escape room containing unfamiliar tools and items. It must inspect their interfaces, interpret narrative clues, and carry intermediate results through a dependency graph to obtain and submit the victory string. Correct interactions can reveal previously hidden entities, so the agent must track both the information it has collected and the parts of the room it has unlocked.

Property Behavior
Observation Opening text, initially visible entities, available input values, and the victory node ID; investigations provide interfaces, contents, and clues.
Actions investigate, tool_call, use_item, and submit_answer, exposed through the escape CLI with JSON responses.
Tools 33 templates present in the corpus, including arithmetic, hashing, encoding, ZIP/JSON/CSV operations, graph algorithms, terminals, and isolated Python execution.
Hidden state Tool/item availability changes as the agent satisfies dependencies and triggers active or investigation-based drops. The full graph and reference values remain in the puzzle service.
Success An exact correct answer submitted through submit_answer; obtaining the value without submitting does not finish the episode.
Reward Binary: 1 for successful submission, otherwise 0 for a valid unsuccessful episode. Infrastructure failures are reported separately.
Budget 500 puzzle actions and a 1,200-second agent time limit. Invalid actions count; observation and state reads do not.
Runtime One isolated Docker Compose trial per scenario, with separate agent, puzzle-service, and Python-worker containers, followed by a fresh verifier.

Difficulty is the number of nodes in the underlying graph:

Difficulty (nodes) Scenarios
5 60
10 60
15 60
20 60
25 30
Total 270

Each scenario becomes an independent Harbor task with a stable ID and a self-contained build context. The runtime and action semantics are shared; the puzzle graph, clues, initial information, hidden entities, and victory value vary by task. The figure illustrates the puzzle mechanics; interaction in this port uses text and tool calls.

Run a task

Requirements: Linux Docker Engine, Docker Compose, Python 3.13, and uv. The tested Harbor version is 0.25.0. Docker is the supported sandbox; E2B and HF Sandbox do not support this task's multi-container layout.

Launch directly from Hugging Face

No repository checkout is required. Authenticate Git access with an HF account that can read the private dataset:

uv tool install --python 3.13 'harbor==0.25.0'
uvx --from huggingface-hub hf auth login --add-to-git-credential

harbor run \
    --repo https://huggingface.co/datasets/HuggingFaceSwarms/AgentEscapeBench \
    --include-task-name '*agentescape-5-skeleton-032856e7' \
    --agent oracle \
    --env docker \
    --jobs-dir results/agentescape

harbor view results/agentescape

Remove --include-task-name to run all 270 tasks. No --dataset flag is needed: Harbor discovers the repository's tasks/ directory directly. To pin the task artifacts, append @10499427e61ddd71f02c3c59995a12923f87d6e0 to the --repo URL.

Launch from a local checkout

From this repository checkout:

uv sync --extra harbor --extra hub --extra openenv
uv run agentescape-port --pilot --output-dir pilot-tasks
uv run harbor run -p pilot-tasks -a oracle --env docker -n 1

The source distribution includes all 270 generated tasks under tasks/; running the generator is optional. --pilot produces an item-chain task and a 25-node Python-execution task. Generate the entire suite with uv run agentescape-port --output-dir tasks; pass --overwrite only when replacing previously generated output intentionally. The generator requires this source checkout, including data/ and runtime-requirements.txt.

For an actual coding agent, replace oracle with a supported Harbor agent and specify its model, for example:

uv run harbor run -p tasks -a claude-code -m anthropic/claude-sonnet-4-6 --env docker -n 1

The model command is illustrative; no paid model baseline or original-paper score reproduction is claimed. Agent model/API credentials are configured through Harbor, outside the puzzle and code-worker services.

Download a pinned HF release

The dataset is private at HuggingFaceSwarms/AgentEscapeBench; authenticate with an account having access. Choose a full HF commit SHA from the repository history:

from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="HuggingFaceSwarms/AgentEscapeBench",
    repo_type="dataset",
    revision="10499427e61ddd71f02c3c59995a12923f87d6e0",
    local_dir="./agentescape-snapshot",
    allow_patterns=["tasks/**"],
)

Using local_dir gives real files suitable for Harbor uploads. Run the downloaded suite with:

uv run harbor run -p ./agentescape-snapshot/tasks -a oracle --env docker -n 1

All runtime files required by each task are inside that task. No development package, sibling task, source-repository checkout, or top-level shared runtime is needed inside the sandbox.

OpenEnv

This checkout pins OpenEnv main to 1e5317e9ebbe016fb9f94e545cf4a996d464e22b through uv.lock and the openenv optional dependency. Use a compatible OpenAI-style endpoint and the downloaded task directory:

uv run openenv harbor info \
  --llm-url "$LLM_URL" --dataset ./agentescape-snapshot/tasks

uv run openenv harbor rollout \
  --llm-url "$LLM_URL" --dataset ./agentescape-snapshot/tasks \
  --task-index 0 --harness opencode --sandbox docker \
  --out rollout.json

See OpenEnv's Harbor reference for endpoint authentication and proxy reachability. Plain HF IDs load a floating repository revision in the inspected OpenEnv loader; use the pinned local snapshot for reproducibility.

tests/openenv_smoke.py uses the actual OpenEnv rollout implementation, capture proxy, and an explicitly registered validation-only Harbor oracle seam. A scripted localhost model endpoint supplies one acknowledgement per trial, then the oracle solves the puzzle through public actions. Both pilots return ok=true, one captured model turn, and reward 1. The expected one-turn warning reflects this scripted test. It does not measure model capability, validate an installed coding harness, or test training-quality token IDs/log probabilities.

Episode behavior

The agent runs escape observe, then uses:

escape investigate NODE_ID
escape tool-call NODE_ID --arguments-json '{"parameter": "value"}'
escape use-item NODE_ID --arguments-json '{"parameter": "value"}'
escape submit-answer 'exact victory string'
escape state

Only exact successful submission earns 1. An incorrect answer allows retry; revealing or computing the victory value without submitting earns 0. There is no requirement to visit every node. Infrastructure failure does not become an ordinary zero reward.

Each task permits 500 puzzle actions, counting invalid actions. Observation/state reads are free. This is an explicit CLI scaffold variant: upstream limits model turns, and one model turn can contain several tool actions. The wall-clock agent limit is 1,200 seconds. Each Python tool execution has a 5-second wall-clock limit, 3-second CPU limit, 256 MiB address-space limit, and 64 KiB code/serialized-output limits.

Original graph, tool, parameter-feedback, revelation, and exact-answer semantics are retained. The wrapper removes internal _template_id feedback. It adds terminal episode state and budget enforcement and removes the agent's ability to reset/load arbitrary files or access upstream administrative routes.

Known upstream behavior is preserved:

  • Opening narratives live in metadata, but upstream's loader uses a top-level field, so the generic opening is shown. Node-specific narrative clues remain available.
  • Terminals expose different output ports for partial versus complete input combinations. The victory value is the first stored reference output port, which need not be the first output returned by a particular call.
  • Some stored golden inputs include trigger ports of type Item/Hidden_Item even though investigation omits those ports. The reference solver supplies those stored inputs. This port does not silently fix that interface inconsistency.

The reference solver uses trusted scenario inputs to choose calls, traverses public puzzle actions, and submits the value returned by the victory port. It never directly sets success or submits a reference answer without obtaining that value through the service. It is a correctness oracle, not an agent baseline.

Isolation and grading

Each trial has an agent container, a puzzle-service container containing only its scenario, and a Python execution worker. The agent image contains the CLI, not the source graph, references, oracle, or grader. Oracle files are uploaded by Harbor only for oracle trials.

Python executes as an unprivileged child in the read-only worker container, with no scenario files or server module. A seccomp filter blocks sockets, process-memory inspection, and namespace/mount operations. The worker and puzzle service use an internal network unavailable to the agent. The worker receives only the code string, never reference values or credentials.

The service stores outcomes and traces on its own filesystem. Harbor stops the agent, invokes an export inside the service, collects service-scoped artifacts, and grades them in a fresh verifier container. Agent-created files at the same apparent container paths are not accepted as service evidence. Missing evidence or an unavailable service fails verification instead of fabricating a score.

Agent egress remains available for coding-harness/model compatibility. The original answers are publicly available upstream; this packaging prevents local answer-file exposure, but does not prevent an agent downloading public answers or using memorized data. Controlled evaluations should configure Harbor's agent-phase network allowlist for their model/proxy endpoint. No claim of contamination resistance is made.

Validation

uv run pytest -q
uv run python tests/corpus_docker.py
uv run python tests/openenv_smoke.py
uv run harbor run -p pilot-tasks -a agentescape_port.testing:ForgeAgent --env docker -n 2

See reports/validation-summary.json for measured results and scope. A cold download of revision 10499427e61ddd71f02c3c59995a12923f87d6e0 matched all 6,481 task-file hashes, exposed all 270 tasks, and passed both OpenEnv/Harbor pilots with scripted text capture. Those cold pilots also checked the agent CLI, invalid-node feedback, and incorrect-answer retries. Corpus validation covers all 270 scenarios and all 33 tool templates through the upstream-backed facade, with Python actions in Docker. It is not 270 independent Harbor container trials. Full Harbor and OpenEnv pilot trials separately test their lifecycle and verifier paths. The forgery agent must receive reward 0.

Do not treat the original scenarios as independent training and test splits. This release retains the original evaluation corpus and difficulty groups.

Provenance and license status

Original benchmark: Zhengkang Guo, Yiyang Li, Lin Qiu, Xiaohua Wang, Jingwen Xv, Dongyu Ru, Xiaoyu Li, Xiaoqing Zheng, Xuezhi Cao, and Xunliang Cai, AgentEscapeBench: Evaluating Out-of-Domain Tool-Grounded Reasoning in LLM Agents (2026). Paper, source.

server.py, models.py, and simulator.py are vendored unchanged at the pinned revision; hashes are recorded in source-lock.json. Scenarios are copied unchanged. The original README is preserved at data/UPSTREAM_README.md.

The upstream README declares MIT but its referenced LICENSE file is absent from the pinned source archive. This private working release preserves that declaration and records the missing notice; it does not invent an upstream copyright/license notice. Clarify the missing notice and data redistribution terms before making the dataset public. New adapter files are offered under LICENSE.port; that file does not replace upstream licensing.

This is an independent port, not an official upstream release or an original-model-score reproduction.

Frozen SFT / RL / test splits (v1)

Select a named Harbor registry dataset and pin this repository's commit: agentescape-sft@1.0.0, agentescape-rl@1.0.0, or agentescape-test@1.0.0. The explicit membership in splits/v1.json is authoritative. registry.json references the existing task directories at immutable implementation revision 144b647af561e28d681552cb04bc7b4a8dbeb1ce; task contents are not duplicated.

Difficulty SFT RL Test
5, 10, 15, 20 (each) 25 25 10
25 12 13 5
Total 112 113 45

Scenario identity is the difficulty/skeleton task ID. Each scenario and all its trajectories, model variants, and swarm sizes belong to exactly one split. Within each difficulty, sort IDs by SHA256 of UTF-8 agentescape-splits-v1:42:<scenario_id>; allocate test, then SFT, then RL. The committed manifest freezes the assignments; new scenarios must not reshuffle v1. Generation source digest and content hashes are recorded. Reproduce with python splits/generate.py SNAPSHOT OUTPUT. The generator refuses to overwrite different existing membership.

Use SFT only for demonstrations and RL only for policy training. Retain scenario ID, split version, manifest digest, registry/task commits, prompts, model revision, and rollout settings in exported trajectories and run manifests. Use development subsets of SFT/RL for prompt, hyperparameter, and checkpoint selection. Reserve test for reporting. This is a fresh protocol: previous training checkpoints and sweeps are not automatically clean held-out comparisons. Public scenarios do not guarantee absence from foundation-model pretraining.

Report per-difficulty success and an equal-weight average across difficulties. Average repeat trials within each scenario before aggregating. Report infrastructure failures separately from valid unsuccessful attempts. This protocol tests new scenarios within known difficulties, not unseen mechanics.

Flock configuration (replace REGISTRY_COMMIT with the published full SHA):

task:
  repo: https://huggingface.co/datasets/HuggingFaceSwarms/AgentEscapeBench-harbor
  revision: REGISTRY_COMMIT
  dataset: agentescape-rl@1.0.0
  selector: EXACT_TASK_ID_FROM_RL_MANIFEST

Flock requires the selector to match one task inside that dataset. Split-aware experiments must specify the dataset; legacy implicit discovery still exposes all tasks and is not a split-isolation boundary. Environment-only fixes may update the implementation revision while preserving membership and content hashes; record both pins. Changed scenario content or reassignment requires a new split version.