TRACELITE AI / RESEARCH

TwinEnv-Bench: Beyond Greenhouse Sandboxes via Counterfactual Evaluation of Reactive and Proactive Environment Adaptation in Software Agents

TraceLite AI1,2,3,4

1 Institute of Information Engineering, CAS 2 Institute of Automation, CAS 3 Zhongguancun Academy 4 Tsinghua University

TraceLite AI

Technical Report ·

Near-ceiling competence inside uniform greenhouse containers masks 31.3–72.3 percentage-point collapses when a single system property shifts.

Abstract

Prevailing benchmarks for software and terminal agents evaluate models almost exclusively inside uniform “greenhouse” containers configured with permissive system defaults, confounding algorithmic coding skill with real-world environment adaptability. We introduce TwinEnv-Bench, a controlled micro-scale benchmark of 117 scripting, systems, and data-engineering tasks that pairs identical user instructions and codebases across a standard baseline container and a target sandbox shifted along a single verified system property.

Spanning a five-layer operating-system taxonomy enforced by mechanical solvability contracts and leak-proof host-isolated grading, TwinEnv-Bench contrasts interactive-exposed shifts, where discrepancies trigger immediate errors during sample runs, against deployment-latent shifts, where sample runs pass silently while production constraints reside in scheduled jobs, mount boundaries, process privileges, or resource quotas.

Evaluating nine frontier models across non-refusal executed runs reveals that near-ceiling baseline competence collapses to 26.8%–67.1% single-run solve rates and 14.5%–59.5% multi-run reliability under single-variable shifts. Models that lead exposed shifts via runtime debugging and upfront shallow checking drop sharply and invert rankings under the silent constraints and production-layer shifts of the latent regime, where upfront multi-step reconnaissance is associated with a nearly sixfold higher solve rate than unprobed runs.

Controlled system-prompt interventions further confirm that explicit pre-flight reconnaissance causally lifts latent solve rates by nearly 30 percentage points and doubles multi-run reliability, yet a 43.6 percentage-point cross-model probe-to-action gap persists across the four tested models even under near-saturated probing—indicating that checklist guidance resolves reconnaissance blindness without equalizing underlying system-level reasoning from observed host state to boundary-safe code.

Full technical report PDF · English (45 pp.) · Chinese edition (42 pp.)

Beyond the Greenhouse Illusion

Evaluating agents solely inside permissive UTF-8, root, single-volume containers entangles algorithmic coding skill with silent reliance on default host settings.

TwinEnv-Bench overview: paired twin environments, exposed vs. latent regimes, and nine-model Target@1 leaderboard
TwinEnv-Bench pairs identical prompts and starter codebases across a standard Base container and a single-variable shifted Target sandbox. Scores reflect non-refusal executed runs across all nine frontier models.
Counterfactual tasks comparing interactive-exposed read-only package install against deployment-latent transient HTTP 503 batch pagination
Concrete counterfactual instances. In interactive-exposed tasks (a), sample runs surface immediate errors that guide workspace bundling; in deployment-latent tasks (b), the 45-row sample returns HTTP 200 cleanly while held-out batch export encounters transient HTTP 503 responses unless the agent probes and retries.
117 × 2
Tasks · 234 twin cells
5 / 15 / 31
Layers · groups · mechanisms
59 / 58
Exposed vs. latent shifts
7,702
6,318 main + 1,384 ablation runs

Counterfactual twin-cell architecture & admission contracts

Every failure isolates a single probe-verified system property on a task whose functional logic is demonstrably solvable.

Five-stage TwinEnv-Bench construction pipeline, single-variable sandbox audit, six-run solvability check, and exposure labeling
Construction pipeline and mechanical admission contracts. Tasks are grounded in over 200 real-world agent bug reports and verified across 55 container configurations.
01

Single-variable sandbox audit

55 reusable sandbox configurations (1 base + 54 variants) are audited under the agent’s exact UID and login shell to verify active target enforcement with zero collateral drift on unrelated properties.

02

Six-run solvability contract

Every task passes six deterministic checks across Base and Target: the unmodified workspace fails both (0, 0), the greenhouse-naive solution passes Base and fails Target (1, 0), and a portable reference solution passes both (1, 1).

03

Silent in sample, discoverable on host

Across all 58 deployment-latent tasks, sample inputs pass without error in the interactive shell, yet every active cron file, mount option, UID/capability mask, or kernel quota is readable via standard inspection commands from step 0.

Five OS layers. 15 groups. 117 controlled micro-scale tasks.

Grounded in open-source agent post-mortems and POSIX specifications, with compact codebases (median 22-line reference solution, +7-line adaptation delta) that isolate host adaptation from large-repo search.

E1

System Layer

Case-insensitive mounts, Unicode NFD/NFC filenames, byte-length limits, symlinks, FIFO pipes, and CRLF conventions (E1.1–E1.2).

12 tasks
E2

Software Stack Layer

Python 3.8/3.14 interpreter shifts, missing build toolchains, offline mirrors, BusyBox/BSD userlands, dash/zsh shells, and browser engines (E2.1–E2.4).

24 tasks
E3

Execution Context Layer

Regional GBK/Big5 encodings, locale decimals and Turkish casing, DST jumps, fractional UTC offsets, stripped cron PATHs, cross-UID repos, and umask (E3.1–E3.2).

43 tasks
E4

Boundary Layer

noexec/read-only mounts, EXDEV renames, dropped root capabilities, air-gapped/proxy routing, clock skew, scoped secrets, and kernel rlimits/cgroups (E4.1–E4.5).

36 tasks
E5

State Layer

Future-stamped stale bytecode caches (E5.1, 1 task) and upstream HTTP 503 overload under batch pagination (E5.2, 1 task).

2 tasks
E1–E5 task composition by exposure regime, 9-model mean Pass@1, and cross-layer capability radar
E1–E5 composition and cross-layer profiles (conditional on non-refusal runs). Multi-task bottlenecks concentrate in E4.5 Resource Limits (8 tasks, 21.9%) and E1.1 Filesystem Semantics (10 tasks, 38.4%), alongside single-task case E5.2 Service Reliability (11.1%).

Host-isolated execution & evaluation protocol

Zero-dependency host dispatch, post-termination grading injection, and parallel refusal-as-zero sensitivity accounting.

01

Leak-proof post-run grading

API credentials, reference solutions, and held-out judge feeds (mean 1,712.9 lines) stay strictly on the host across four runtime profiles, injected only after agent termination; all 1,709 package files are SHA-256 verified.

02

Compound pressure subset

Standard and scheduled tasks allocate up to 32,768 output tokens per turn, whereas the 19 host-isolated tasks pair silent UID, umask, FIFO, and rlimit boundaries with a tightened 6,000-token per-turn output cap and natural-turn termination.

03

Non-refusal & refusal-as-0

Each cell runs K = 3 independent repeats (Pass@1, Pass@3, Pass^3). Primary metrics condition on non-refusal executed runs; because Claude Opus 5.5 incurs 44/351 target refusals (12.5%) while the other 8 models incur zero, refusal-as-0 sensitivity is reported in parallel.

Main results: greenhouse collapse, regime inversion & Pareto frontier

All 6,318 scheduled trials (9 models × 117 tasks × 2 cells × 3 repeats) reached terminal verdicts, yielding 6,235 non-refusal executed runs across 1,047 paired task–model cells.

−47.6 pts

9-model mean Pass@1 drops from 98.1% on Base to 50.4% on Target (96.4% of failures pass in Base)

−22.9 pts

Mean Target Pass@1 falls from 61.7% on Exposed shifts to 38.8% on Latent shifts, inverting top ranks

88.0%

9-model Oracle Union across complementary E1–E4 family specializations (103 / 117 tasks)

Base Pass@1, Target Pass@1, and strict Target Pass^3 across nine frontier models
Collapse of the Greenhouse Illusion across nine frontier models (conditional on non-refusal executed runs). A 13.7-point structural gap separates the five-model frontier tier above 55% Target Pass@1 from the four-model tier below 42%.
Main counterfactual leaderboard across all 117 tasks · Model rows report metrics conditional on non-refusal executed runs; bottom row reports Claude Opus 5.5 end-to-end sensitivity with refusals scored as 0
Model Base@1 Target@1 Δshift Exposed Latent Δregime Pass@3 Pass3 Probe% Cmds Tokens (k) Cost ($)
Claude Opus 5.598.467.1−31.374.159.3−14.873.959.573.14.620.0$0.073
Qwen 3.8 Max95.163.8−31.375.152.3−22.876.947.082.827.1358.8$0.237
GPT-6.1 Sol97.463.0−34.477.448.3−29.168.458.170.74.715.9$0.031
Gemini 4 Argon99.161.0−38.173.448.3−25.170.151.358.010.0137.6$0.118
Hy4 Flash99.755.3−44.469.540.8−28.765.845.364.412.5115.2$0.002
DeepSeek V4.1 Flash99.441.6−57.846.336.8−9.558.125.659.816.2157.8$0.005
GLM-5.3 Flash96.940.7−56.253.727.6−26.152.128.240.815.5158.2$0.008
Grok 4.797.434.5−62.946.322.4−23.947.022.244.38.380.0$0.088
Kimi K3.1 Pro99.126.8−72.339.513.8−25.739.314.532.29.274.8$0.101
9-model mean98.150.4−47.661.738.8−22.961.339.158.512.0124.3$0.074
Opus 5.5, Refusal-as-088.058.7−29.367.849.4−18.470.147.9————

Under refusal-as-0 accounting, Qwen 3.8 Max leads unconditional Target@1 (63.8%) and Latent@1 (52.3%), while GPT-6.1 Sol leads unconditional Pass^3 reliability (58.1%); on the 92 zero-refusal common tasks, Claude Opus 5.5 still leads at 68.1% vs. 63.0% for Qwen 3.8 Max.

Explore the interactive model & OS-layer leaderboard →

Interactive-Exposed vs. Deployment-Latent Pass@1 leaderboard and rank shifts across nine models
Exposed vs. Latent leaderboard (conditional on non-refusal runs). Δregime reflects the joint effect of silent sample observability and its production-layer distribution (within overlapping E1+E3+E4 layers, 9-model mean still drops 29.6 pts from 68.6% to 39.0%). Upfront shallow checker GPT-6.1 Sol drops from #1 on Exposed (77.4%) to tied #3 on Latent (48.3%), whereas multi-step explorers Claude Opus 5.5 and Qwen 3.8 Max lead under both non-refusal and refusal-as-0 accounting.
Cost–Reliability Pareto frontier and Base-to-Target token and latency inflation across regimes
Cost–Reliability Pareto frontier and asymmetric compute friction. On non-refusal runs, Hy4 Flash ($0.002, 45.3% Pass^3), GPT-6.1 Sol ($0.031, 58.1% Pass^3), and Claude Opus 5.5 ($0.073, 59.5% Pass^3) trace the frontier, with GPT-6.1 Sol becoming the unconditional reliability peak under refusal-as-0.
15 dimension groups by 9 frontier models Target Pass@1 heatmap
Fine-grained Target Pass@1 across all 15 dimension groups (conditional on non-refusal runs). Rose summary pills mark the two multi-task bottleneck groups below 39%: E4.5 Resource Limits (8 tasks, 21.9%) and E1.1 Filesystem Semantics (10 tasks, 38.4%).

Trajectory diagnostics & causal reconnaissance prompting

Parsing all 6,235 main trajectories and 1,384 three-arm intervention trajectories at the atomic shell-command level separates observational probing correlations from direct causal leverage.

Stratified Target Pass@1 by probe depth and timing, r=0.92 correlation, and mean shell commands exposing premature blind exit
Observational trajectory stratification (RQ3). Unprobed deployment-latent runs record 13.2% Pass@1, whereas trajectories with ≥2 probes initiated in the first two commands reach 77.4% (a ×5.9 stratified gap; cross-model Pearson r = 0.92, p < 0.001). Failed latent runs average fewer commands than Base runs (8.9 vs. 10.3), diagnosing premature blind exit after clean sample runs.
Pass@k and Pass^k scaling across k=1..3, per-model reliability spans, and outcome consistency by probing repeats
Small-budget resampling limits and probing stability (conditional on non-refusal runs). Under a K = 3 unguided sampling budget, latent Pass@3 reaches 48.2%, still slightly below the strict 3/3 Pass^3 floor of exposed tasks (48.9%); consistently probed 3/3 pairs record 57.3% all-pass vs. 21.5% on unprobed pairs.
Failure anatomy of 267 probed zero-pass runs, timing-by-depth quadrants, and on-target solve conversion
When probing is not enough (conditional on non-refusal runs). Across 267 failed trajectories from 89 consistently probed zero-pass pairs, 49.4% stop after a single shallow check, 21.3% probe off-target axes, and 29.2% hit the target constraint ≥2 times yet fail state-to-code deduction.
Causal trajectory shifts from P0 Default to P1 Generic Reminder and P2 Taxonomy-Aligned Checklist across four models
Causal reconnaissance prompting across n = 688 strictly paired runs (RQ4). Appending a task-agnostic, taxonomy-aligned five-point pre-flight checklist (P2) drives multi-step probing from 17.4% to 94.5%, causally lifting Latent Pass@1 by +29.9 percentage points (32.0% → 61.9%) and propelling DeepSeek V4.1 Flash (80.9%) and GPT-6.1 Sol (76.4%) past unprompted non-refusal #1 Claude Opus 5.5 (59.3%), while a 43.6 pp cross-model probe-to-action spread remains.
Three-arm task-agnostic system-prompt intervention across all 58 deployment-latent tasks · P0 Default → P1 Generic Reminder → P2 Taxonomy-Aligned Checklist (n = 688 strictly slot-paired runs)
Model Paired n (Tasks) Pass@1 (P0 → P1 → P2) Δ(P2 − P0) Pass3 (P0 → P1 → P2) Probe% (P0 → P1 → P2) Deep ≥2% (P0 → P1 → P2)
DeepSeek V4.1 Flash173 (57)37.0 → 65.9 → 80.9+43.924.6 → 47.4 → 70.259.5 → 97.1 → 100.028.9 → 73.4 → 100.0
GPT-6.1 Sol174 (58)48.3 → 68.4 → 76.4+28.243.1 → 62.1 → 70.770.7 → 100.0 → 100.015.5 → 87.9 → 100.0
GLM-5.3 Flash167 (53)28.7 → 43.1 → 52.7+23.920.8 → 34.0 → 41.540.7 → 73.7 → 98.815.6 → 43.7 → 87.4
Kimi K3.1 Pro174 (58)13.8 → 17.2 → 37.4+23.65.2 → 8.6 → 22.432.2 → 86.8 → 100.09.8 → 25.9 → 90.2
4-Model Paired Total688 (226)32.0 → 48.7 → 61.9+29.923.4 → 38.0 → 51.350.9 → 89.5 → 99.717.4 → 57.9 → 94.5
Count-Truncation-as-0 (n = 695)695 (231)31.6 → 48.6 → 61.4+29.822.9 → 37.2 → 50.2——

Look inside the paired trajectories

Four sanitized trajectory pairs from Appendix D illustrating premature blind exit, single-step shallow stops, probe-to-action gaps, and Linux capability blind spots.

Clean 4.8 KB sample output hides a 1 MiB kernel RLIMIT_FSIZE ceiling.

On Task E4.5-05, unprobed runs retain a monolithic staging file and exit after 6 commands on the 60-row sample, crashing with Errno 27 on the 3.1 MB production feed; upfront ulimit -a inspection replaces staging with bounded streaming writers.

Case Box D.1 comparing unprobed 6-command failure against upfront ulimit -a streaming adaptation on Task E4.5-05
Case Box D.1 · Task E4.5-05 (Deployment-Latent, RLIMIT_FSIZE quota).

Checking login-shell TZ=+09:00 misses the +05:30 override inside /etc/cron.d.

On universally unsolved Task E3.1-29, agents query TZ in the interactive shell (Asia/Tokyo, +0900) and leave integer-hour rounding intact, misformatting +06:00 when nightly cron runs under TZ=Asia/Kolkata (+05:30).

Case Box D.2 comparing single-step interactive TZ check against multi-step /etc/cron.d inspection on Task E3.1-29
Case Box D.2 · Task E3.1-29 (Deployment-Latent, non-interactive cron TZ override).

Eight of nine models read Europe/Berlin—yet still crash on the repeated DST fallback hour.

On Task E3.1-28, models explicitly inspect /etc/timezone yet call tz_localize('Europe/Berlin') with default ambiguous='raise', crashing with AmbiguousTimeError on the repeated 02:00–02:59 autumn transition; only Qwen 3.8 Max disambiguates fold transitions.

Case Box D.3 showing AmbiguousTimeError despite reading Europe/Berlin versus explicit DST disambiguation on Task E3.1-28
Case Box D.3 · Task E3.1-28 (Interactive-Exposed, Europe/Berlin DST transition).

uid=0 is not omnipotent when CAP_DAC_OVERRIDE is dropped.

On Task E4.1-08, stopping after id shows uid=0(root) leads to PermissionError when opening foreign-owned 0444 files in place; inspecting CapEff in /proc/self/status reveals dropped capabilities and motivates sibling temporary file + atomic os.replace().

Case Box D.4 comparing coarse uid=0 check against /proc/self/status CapEff check and atomic os.replace on Task E4.1-08
Case Box D.4 · Task E4.1-08 (Deployment-Latent, root with dropped CAP_DAC_OVERRIDE).

Click any figure or trajectory card to enlarge.

Scope & limitations

TwinEnv-Bench is designed as a controlled micro-scale POSIX scripting, systems, and data-engineering benchmark (median 22-line reference solution) to guarantee single-variable causal purity and self-contained Docker reproducibility on standard Linux hosts. It does not claim to measure full-scale multi-thousand-line repository refactoring, native macOS or Windows desktop semantics, or multi-node distributed cluster failures.

Every task shifts a single verified mechanism Δdi rather than compositional multi-variable shifts, and E5 State currently comprises two tasks (including single-task case E5.2), so group-level bottleneck claims focus on multi-task groups E4.5 and E1.1. Across exposure regimes, Δregime reflects both silent observability and its natural OS-layer distribution, while the 19-task host-isolated subset represents a compound stress test combining silent boundaries with a 6,000-token per-turn output cap.

Finally, unguided test-time resampling findings are scoped to a small K = 3 budget under a unified single-agent tool harness, and our causal intervention evaluates task-agnostic prompt checklists rather than environment-aware reinforcement-learning post-training, for which the residual 43.6 percentage-point cross-model conversion spread provides motivation.

Inspect, compare, reproduce

Verify SHA-256 package digests, run deterministic three-state contract checks without API keys, and launch paired counterfactual evaluations.

01

Verify integrity & contracts

Run fetch_tasks.py to verify all 1,709 SHA-256 digests and octal file modes, then run --mode none, --mode naive, and --mode ref across Base and Target.

02

Compare models & OS layers

Use the interactive leaderboard to sort models across Base@1, Target@1, Exposed/Latent regimes, Pass^3 reliability, E1–E5 layers, and Refusal-as-0 sensitivity.

03

Audit command-level traces

Inspect sanitized main-benchmark and P0/P1/P2 prompt-intervention trajectories to trace atomic host probes, on-target hits, and post-termination verdicts.

BibTeX

@techreport{tracelite2026twinenv,
  title       = {TwinEnv-Bench: Beyond Greenhouse Sandboxes via Counterfactual Evaluation of Reactive and Proactive Environment Adaptation in Software Agents},
  author      = {{TraceLite AI}},
  institution = {Institute of Information Engineering, CAS and Institute of Automation, CAS and Zhongguancun Academy and Tsinghua University},
  year        = {2026},
  month       = nov,
  url         = {https://tracelite.ai/twinenv-bench.html}
}