File size: 13,534 Bytes
9dbe7a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c29c900
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9dbe7a5
 
 
 
4f5b298
 
 
 
 
 
 
 
 
eeccfb0
4f5b298
 
 
 
 
 
 
 
 
 
 
 
9dbe7a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eeccfb0
9dbe7a5
 
 
 
 
eeccfb0
9dbe7a5
8801635
9dbe7a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8801635
9dbe7a5
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
---
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](https://github.com/AGI-Eval-Official/Repo-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](assets/agentescapebench-overview.png)

*Original framework figure from the [AgentEscapeBench authors](https://github.com/AGI-Eval-Official/Repo-of-AgentEscapeBench/blob/03742c79f48646e0130886e18e3e79798cf8edd7/mian_picture.png), 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:

```sh
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-harbor \
    --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:

```bash
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:

```bash
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-harbor`; authenticate with an account having access. Choose a full HF commit SHA from the repository history:

```python
from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="HuggingFaceSwarms/AgentEscapeBench-harbor",
    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:

```bash
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:

```bash
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](https://huggingface.co/docs/openenv/main/environments/harbor) 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:

```bash
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

```bash
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](https://arxiv.org/abs/2605.07926), [source](https://github.com/AGI-Eval-Official/Repo-of-AgentEscapeBench).

`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.