TRACELITE AI / RESEARCH BENCHMARK

TwinEnv-Bench: Same Task, Shifted Environments — Evaluating Real-World Agent Adaptation

Beyond Greenhouse Sandboxes: Counterfactual Evaluation of Reactive and Proactive Environment Adaptation in Software Agents

TraceLite AI Research · Technical Report & Benchmark Suite

Near-100% scores in uniform greenhouse containers mask severe 31.3–72.3 pt collapses under single-variable environment shifts.

Overall Base vs. Target Performance on TwinEnv-Bench
Figure 1 — Collapse of the Greenhouse Illusion. All 9 frontier models saturate the standard base sandbox (95.1%–99.7% Pass@1) yet drop by 31.3–72.3 percentage points when a single controlled environment variable shifts in target, with strict production reliability (Pass^3) falling to 14.5%–59.5%.

Abstract

Modern software and terminal agent benchmarks evaluate models almost exclusively inside homogeneous 'greenhouse' containers—assuming UTF-8 locales, root privileges, GNU coreutils, permissive ulimit quotas, standard local filesystems, and direct interactive environment inheritance. High scores in such uniform sandboxes conflate algorithmic coding skill with real-world environment adaptability.

We introduce TwinEnv-Bench, a counterfactual benchmark of 117 real-world software and data engineering tasks (234 twin cells) spanning a grounded five-layer environment taxonomy (E1–E5, 15 dimension groups, 31 mechanisms). Every task pairs an identical prompt and workspace across a standard baseline container (base) and a counterfactual sandbox (target) shifted along exactly one verified system dimension, enforced by a three-state mechanical verification contract.

By balancing Interactive-Exposed shifts (59 tasks, where discrepancies surface during interactive commands) and Deployment-Latent shifts (58 tasks, where sample runs pass silently while production constraints reside in cron, rlimits, mounts, or cross-account ownership), TwinEnv-Bench exposes a fundamental cognitive bottleneck: frontier coding agents excel at error-driven reactive patching but critically lack proactive environment reconnaissance—triggering sharp accuracy drops and leaderboard rank reversals.

Core Design Pillars & System Architecture

Isolating causal environment sensitivity without confounding task difficulty or leaking held-out oracles.

01

Counterfactual Twin Cells

Each task executes identically on base and target sandboxes differing along a single probe-verified system mechanism across 55 container configurations.

02

3-State Mechanical Contract

Every task passes 6 deterministic checks: unmodified workspace fails both; environment-naive solution passes base & fails target; reference solution passes both.

03

Exposed vs. Latent Regimes

59 Interactive-Exposed tasks test error-driven recovery; 58 Deployment-Latent tasks require proactive host reconnaissance before writing code.

04

Leak-Proof Host Isolation

API keys, reference solutions, and held-out judge/ inputs remain strictly on the host; judge/ and verify.sh are injected only after agent termination.

Five-Layer Environment Taxonomy (E1–E5)

Grounded in real-world open-source agent failure issues and POSIX/runtime specifications—revealing orthogonal capability profiles across model families.

E1-E5 Environment Taxonomy, Regime Split and Cross-Layer Model Capability Radar
Figure 3 — Taxonomy, Shift Regime Split & Orthogonal Layer Capabilities. (a) Architectural breakdown of all 117 tasks across E1–E5 and 15 dimension groups, showing Interactive-Exposed (59) vs. Deployment-Latent (58) composition and 9-model average Target Pass@1 (highlighting bottleneck groups E5.2 = 11.1%, E4.5 = 21.9%, E1.1 = 38.4%). (b) No single frontier model dominates every layer: Gemini 4 Argon leads E1 System (77.8%), GPT-6.1 Sol leads E2 Software Stack (76.4%) & E4 Boundary (66.7%), and Claude Opus 5.5 leads E3 Execution Context (75.2%) and ties Qwen 3.8 Max on E5 State (66.7%), yielding an 88.0% 9-model Oracle Union.
E1

System Layer

E1.1 Filesystem Semantics (casefold, Unicode NFD, sparse/atomic) · E1.2 System Conventions (CRLF)

12 tasks
E2

Software Stack Layer

E2.1 Language Runtime · E2.2 Dependencies & Offline Wheels · E2.3 BusyBox/BSD Shell · E2.4 Browser Engine

24 tasks
E3

Execution Context Layer

E3.1 Locale, Character Encoding & Timezone Drift · E3.2 Cron Daemon, Non-Login Shell & Subprocess Env

43 tasks
E4

Boundary Layer

E4.1 Ownership, umask & EXDEV Mounts · E4.2 Network/Proxy · E4.3 Clock Skew · E4.4 Credentials · E4.5 Kernel rlimits

36 tasks
E5

State Layer

E5.1 Stale PID/Lock/Cache Platform Residuals · E5.2 Upstream Service Transient Faults & Retries

2 tasks

Reactive Patching vs. Proactive Reconnaissance

When environment discrepancies no longer surface in interactive sample runs, reactive leaders drop sharply and leaderboard rankings flip.

−31.3 ~ −72.3

Percentage-point drop from Base Pass@1 (95.1%–99.7%) to single-variable shifted Target Pass@1 (26.8%–67.1%) across 9 frontier models.

#1 → T-#3

GPT-6.1 Sol plunges −29.1 pts from Exposed (77.4% #1) to Latent (48.3% T-#3), while Claude Opus 5.5 (59.3% #1, Overall 67.1% #1) and Qwen 3.8 Max (52.3% #2, Overall 63.8% #2) take the top two.

×5.9 Surge

Upfront probing (steps 1–2, ≥2 probes) lifts Deployment-Latent Pass@1 from 13.2% to 77.4% (r = 0.92 across 9 models).

Interactive-Exposed vs. Deployment-Latent Leaderboard
Figure 2 — Regime Drop & Rank Reversals. Models ordered by Deployment-Latent Pass@1 (58 tasks) vs. Interactive-Exposed Pass@1 (59 tasks). Badges indicate rank changes relative to Interactive-Exposed.
Main Leaderboard · Unified 117 Counterfactual Tasks (3 independent repeats per cell; unexecuted API refusals skipped)
Model Base Pass@1 Target Pass@1 Shift Drop (Δ) Exposed (59) Latent (58) Target Pass@3 Target Pass^3 Span (@3−^3)
Claude Opus 5.598.4%67.1%-31.374.1%59.3%73.9%59.5%14.4
Qwen 3.8 Max95.1%63.8%-31.375.1%52.3%76.9%47.0%29.9
GPT-6.1 Sol97.4%63.0%-34.477.4%48.3%68.4%58.1%10.3
Gemini 4 Argon99.1%61.0%-38.173.4%48.3%70.1%51.3%18.8
Hy4 Flash99.7%55.3%-44.469.5%40.8%65.8%45.3%20.5
DeepSeek V4.1 Flash99.4%41.6%-57.846.3%36.8%58.1%25.6%32.5
GLM-5.3 Flash96.9%40.7%-56.253.7%27.6%52.1%28.2%23.9
Grok 4.797.4%34.5%-62.946.3%22.4%47.0%22.2%24.8
Kimi K3.1 Pro99.1%26.8%-72.339.5%13.8%39.3%14.5%24.8
Cost-Reliability Pareto Frontier and Environment Friction Tax
Figure 6 — Cost–Reliability Pareto Frontier & Environment Friction Tax. (a) Three-node Pareto frontier spanning sub-cent Hy4 Flash ($0.002/run · 45.3% Pass^3), GPT-6.1 Sol ($0.031/run · 58.1% Pass^3 cost-efficiency knee), and Claude Opus 5.5 ($0.073/run · 59.5% Pass^3 & 67.1% Pass@1 peak, 3.2× cheaper than heavy-exploration Qwen 3.8 Max at $0.237/run). (b) Across 9 models on Interactive-Exposed shifts, reactive error-patching inflates mean tokens ×1.65 (91.8k → 152.0k) and latency +39%.

Open interactive leaderboard, E1–E5 breakdowns & 117-task explorer →

Behavioral & Reliability Diagnostics

Command-level trajectory analysis explains why agents fail silently on latent shifts—and why naive test-time retries cannot substitute for reconnaissance.

Impact of Environment Probing and Premature Exit Diagnostics
Figure 4 — Trajectory-Level Reconnaissance & Effort Diagnostics. (a) Target Pass@1 by probe depth (0, 1, ≥2) and timing (Late step ≥3 vs. Early step 1–2). (b) Cross-model probe rate strongly predicts Deployment-Latent Pass@1 across 9 models (Pearson r = 0.92). (c) Latent Fail runs average only 8.9 shell commands—fewer than Base (10.3)—exposing premature blind exit after clean sample runs.
Test-Time Scaling, Reliability Spans, and Probing Consistency
Figure 5 — Multi-Run Scaling & Reliability Mechanisms. (a) Even with 3× retries on Deployment-Latent, Pass@3 (48.2%) still falls short of the strict Pass^3 floor of Interactive-Exposed (48.9%). (b) Per-model Pass^3 ↔ Pass@1 ↔ Pass@3 spans across 9 models show Claude Opus 5.5 leading Pass^3 (59.5%) & Pass@1 (67.1%), Qwen 3.8 Max overtaking to #1 on Pass@3 (76.9%), and GPT-6.1 Sol remaining most deterministic (Δ10.3). (c) Consistent 3/3 probing boosts consistent 3/3 task pass ×2.7 (21.5% → 57.3%).

When Probing Is Not Enough: Probe Quality & the Probe-to-Action Gap

Why do 19.2% (89/464 pairs) of consistently probed (3/3 Probed) tasks still fail 0/3, why does Qwen 3.8 Max trail Opus despite an 82.8% probe rate, and how does Gemini 4 Argon tie for #3 with a 58.0% probe rate?

~70%

Shallow & Off-Target Probing

Among 3/3 Probed → 0/3 Fail runs, 66.7% probe early (steps 1–2) yet average only 1.52 probes: 49.4% stop after 1 surface check (missing /etc/cron.d), and 21.3% probe an unrelated axis.

39.0% vs 74.5%

Probe-to-Action Reasoning Gap

Even with on-target probing, models fail to deduce boundary side-effects (e.g., DST fall-back crashes or dropped CAP_DAC_OVERRIDE). Kimi hits 85.4% On-Target yet converts only 39.0% vs. Opus's 74.5%.

Timing & Depth

Upfront Timing + Depth Govern Reliability

Qwen 3.8 Max leads raw (82.8%) & deep (59.2%) probing (#1 Pass@3 = 76.9%) yet probes late (Early = 14.4%, Pass^3 = 47.0% vs. Opus 69.0% / 59.5%), while Gemini achieves peak conversion (68.3%).

Deployment-Latent Probing Efficiency Across 9 Frontier Models (Non-Refusal Executed Runs)
Model Exec. N Exec. Pass@1 Probe% Early% Deep (≥2)% On-Target% Pass | Probe Pass | On-Target Pass | NoProbe
Claude Opus 5.514559.3%73.1%69.0%27.6%89.5%67.0%74.5%38.5%
Qwen 3.8 Max17452.3%82.8%14.4%59.2%88.9%61.8%68.0%6.7%
GPT-6.1 Sol17448.3%70.7%68.4%15.5%74.6%56.9%67.1%27.5%
Gemini 4 Argon17448.3%58.0%42.5%37.9%83.5%68.3%69.7%20.5%
Hy4 Flash17440.8%64.4%48.3%33.3%72.8%55.4%68.0%14.5%
DeepSeek V4.1 Flash17436.8%59.8%25.3%28.7%75.8%54.8%66.7%10.0%
GLM-5.3 Flash17427.6%40.8%10.3%15.5%74.2%50.7%52.2%11.7%
Grok 4.717422.4%44.3%33.9%12.1%77.9%41.6%39.6%7.2%
Kimi K3.1 Pro17413.8%32.2%20.1%9.8%85.4%35.7%39.0%3.4%

Note: Consistent with the Main Leaderboard, all metrics on Deployment-Latent (58 tasks × 3 repeats = 174 scheduled runs) are evaluated over non-refusal executed runs (Exec. N); for Claude Opus 5.5, excluding 29 unexecuted API refusals yields Exec. N = 145 and Exec. Pass@1 = 59.3%, while all other 8 models have full Exec. N = 174.

Causal Intervention: Explicit Reconnaissance Prompting

Does upfront reconnaissance exert direct causal leverage, or merely correlate with stronger coding skill? Zero-spoiler system-prompt interventions across all 58 Deployment-Latent tasks (n = 688 strictly paired runs across 4 representative models) prove both causal lift and a rigid reasoning ceiling.

+29.9 pp Lift

P0 (Default) → P1 (Generic Recon) → P2 (SRE Checklist) lifts paired Deployment-Latent Pass@1 from 32.0% to 61.9%, doubling Pass^3 (23.5% → 51.3%) as Deep ≥2 probes surge ×5.4 (17.4% → 94.5%).

80.9% & 76.4%

Breaking shallow-probing habits unlocks DeepSeek V4.1 Flash (+43.9 pp to 80.9%) and GPT-6.1 Sol (+28.2 pp to 76.4% in 5.8 cmds)—both surpassing unprompted #1 Claude Opus 5.5 (59.3%).

43.6 pp Ceiling

Even at 100% probing under P2, Kimi K3.1 Pro caps at 37.4% vs. DeepSeek's 80.9%—proving prompts cure reconnaissance blindness but cannot replace post-trained Probe-to-Action reasoning.

Causal Reconnaissance Prompting Ablation across Deployment-Latent Tasks
Figure 7 — Causal Intervention via Explicit Reconnaissance Prompting (P0 → P1 → P2, n = 688 Strictly Paired Runs). (a) Trajectory shift on the (Probe Rate, Latent Pass@1) plane against the P0 9-model regression fit (r = 0.92), revealing both above-trend unlocks and the 43.6 pp vertical Probe-to-Action Gap at 100% probing. (b) ×5.4 surge in multi-step deep probing (Deep ≥ 2). (c) Paired Pass@1 and Pass^3 gains across models.
Causal Reconnaissance Prompting Ablation · Strictly Paired Deployment-Latent Slots (P0: Default → P1: Generic Recon → P2: SRE Checklist)
Model Paired N (Tasks) Pass@1 (P0 → P1 → P2) Δ (P2 − P0) Pass^3 (P0 → P1 → P2) Probe% (P0 → P1 → P2) Deep ≥2% (P0 → P1 → P2) Pass | Probe (P0 → P1 → P2)
DeepSeek V4.1 Flash173 (57)37.0% → 65.9% → 80.9%+43.9 pp24.6% → 47.4% → 70.2%59.5% → 97.1% → 100.0%28.9% → 73.4% → 100.0%55.3% → 67.9% → 80.9%
GPT-6.1 Sol174 (58)48.3% → 68.4% → 76.4%+28.2 pp43.1% → 62.1% → 70.7%70.7% → 100.0% → 100.0%15.5% → 87.9% → 100.0%56.9% → 68.4% → 76.4%
GLM-5.3 Flash167 (53)28.7% → 43.1% → 52.7%+24.0 pp20.8% → 34.0% → 41.5%40.7% → 73.7% → 98.8%15.6% → 43.7% → 87.4%52.9% → 56.9% → 53.3%
Kimi K3.1 Pro174 (58)13.8% → 17.2% → 37.4%+23.6 pp5.2% → 8.6% → 22.4%32.2% → 86.8% → 100.0%9.8% → 25.9% → 90.2%35.7% → 18.5% → 37.4%
4-Model Paired Macro688 (226)32.0% → 48.7% → 61.9%+29.9 pp23.5% → 38.1% → 51.3%50.9% → 89.5% → 99.7%17.4% → 57.9% → 94.5%52.3% → 53.7% → 62.1%

Note: P2 − P1 macro gain = +13.2 pp (95% task-level bootstrap CI: [+6.7, +20.1] pp). Counting the 7 single-turn 6k output-limit truncations as 0 (n = 695: 31.7% → 48.6% → 61.4%) yields virtually identical effect sizes.

Counterfactual Trajectory Case Studies

Four canonical tasks from TwinEnv-Bench illustrating the full spectrum of failure mechanisms: premature blind exit, shallow probing illusion, probe-to-action reasoning gap, and granularity blind spots.

E4.5-05-fsize-staging-split · Boundary Layer Deployment-Latent

Monolithic staging file passes on 60-row sample, crashes with Errno 27 (File too large) under 1 MiB RLIMIT_FSIZE

Task: Clean and distribute national outage logs into regional files. The inherited splitter stages all cleaned rows into a single intermediate file before splitting.

Base SandboxUnlimited per-file size (ulimit -f unlimited).
Target Sandbox (Single Shift)Kernel RLIMIT_FSIZE capped at 1 MiB (ulimit -f prints 1024 blocks).
Unprobed Premature Exit (0/3 Pass)6 cmds
$ python3 split_outages.py --input sample/outages.csv
Wrote 4 regional CSVs (staging size: 5 KB).
# Zero errors on KB-scale sample -> submits immediately!
[Judge Verify] OSError: [Errno 27] File too large on 3 MB national log
Upfront Quota Reconnaissance (3/3 Pass)11 cmds
$ ulimit -a && ulimit -f
file size (blocks, -f) 1024  # 1 MiB per-file ceiling!
# Eliminates monolithic staging; streams directly to regional handles
$ python3 test_synth_40k_rows.py
[Judge Verify] All regional files written under 1 MiB cap (PASS)

BibTeX

@article{twinenvbench2026,
  title   = {TwinEnv-Bench: Beyond Greenhouse Sandboxes via Counterfactual Evaluation of Reactive and Proactive Environment Adaptation in Software Agents},
  author  = {TraceLite AI Research},
  year    = {2026},
  url     = {https://github.com/TraceLite-AI/TwinEnv-Bench}
}