Sandbox-First Capability Discovery for LLM Agents
Executive summary
Sandbox-First Capability Discovery:
Before designing a workflow around an LLM agent, give the agent a safe, general environment and enough basic tools to work. Let it solve representative tasks with as few assumptions about the method as possible. Observe what it can do. Add specialised components only after experiments show that they help.
The important word is discovery. Ordinary software components have explicitly implemented behaviour. LLMs learn behaviours during training, and their possible strategies lack a complete specification. Anthropic states this directly: “we don’t understand how models do most of the things they do.” (Anthropic 2025a)
A directly relevant research result comes from Cheng et al.’s 2026 paper, originally titled LLM-in-Sandbox Elicits General Agentic Intelligence and retitled Computer Environments Elicit General Agentic Intelligence in LLMs. It deliberately gives models a minimal, general-purpose computer environment with just Bash, a file editor and a finish action. Its two stated design principles are minimal and exploratory: preserve basic computer capabilities and encourage the model to “freely experiment within this environment”. Strong models spontaneously installed tools, used files to handle large inputs and wrote programs to check their own outputs. The authors report gains across six non-coding domains, although weaker models sometimes became worse when given the same sandbox. (Cheng et al. 2026)
This provides experimental support for the capability-elicitation premise. The research result and the proposed engineering method have distinct scopes:
LLM-in-Sandbox asks whether a computer environment can elicit more model capability.
Sandbox-First Capability Discovery is the proposed engineering method around that idea: start with a broad but bounded environment because the capability space is uncertain; learn from actual tasks; then progressively formalise the tools and structures justified by repeated evidence.
The primary sources reviewed do not establish a methodology using this exact name. Related ideas include LLM-in-Sandbox, CodeAct, ReAct, sandboxed autonomy, Anthropic’s simple-agent guidance, OpenAI’s harness engineering, YAGNI/evolutionary design and Sutton’s Bitter Lesson. These support parts of the proposed sequence without establishing it as a single named methodology. (Cheng et al. 2026; Wang et al. 2024; Yao et al. 2023; Anthropic 2026a; Anthropic 2024; OpenAI 2026a; Fowler, YAGNI; Sutton 2019)
The first-principles argument is simple:
- An LLM agent’s capabilities are not completely known in advance.
- Its observed ability depends on its environment and available tools.
- A prescribed workflow removes possible ways of solving the task.
- During capability discovery, unnecessary workflow restrictions can hide useful behaviour.
- A sandbox leaves more solution paths open while limiting what the agent can affect.
- Repeated observations of useful patterns or failures can guide the design of tools, components and workflows.
That is the core of the approach.
The Sandbox-First principle
A concise definition is:
Start with the agent in a safe, general-purpose sandbox. Give it the goal, the information it needs and a small set of powerful tools. Leave the solution method open. Observe what it does before deciding how the agent architecture should work.
“Few restrictions” needs one important qualification.
There are two different kinds of restriction:
So the approach is open about method and strict about consequences.
The sandbox therefore serves both containment and capability discovery: enforced boundaries allow the agent more room to act within the environment.
Anthropic makes essentially this security argument in its containment work: models can have substantial autonomy inside filesystem, network and process boundaries while the surrounding sandbox limits the possible blast radius. OpenAI’s Codex likewise runs work in isolated environments, and OpenAI’s 2026 Agents API treats the agent’s compute environment as a first-class part of the system. (Anthropic 2026a; OpenAI 2025; OpenAI 2026b)
The 2026 LLM-in-Sandbox paper goes a step further and treats the environment as a capability mechanism. Its minimal configuration contains three basic actions:
- Bash: run commands, programs and install or create further tools.
- File operations: read, write and organise information.
- Finish: indicate that the task is complete.
The researchers intentionally avoid domain-specific additions. From those primitives, stronger models spontaneously acquired or built what they needed. In one chemistry example, a model installed Java and a chemistry package; on long documents it used grep, sed and Python; on a constrained writing task it wrote verification programs. (Cheng et al. 2026)
That leads to a useful concept:
A general tool is a capability multiplier because the agent can compose it into actions that the system designer did not explicitly enumerate.
CodeAct reached a similar conclusion earlier. Wang et al. used executable Python as the agent’s action space rather than requiring every action to be represented by a predefined textual or JSON action. Across their experiments, executable code allowed agents to compose operations, keep intermediate state and react to execution results; they reported success-rate improvements of up to 20 percentage points over their tested alternatives. (Wang et al. 2024)
This is the proposed workbench:
flowchart TD
U[Task / user goal] --> A[Agent loop]
A --> M[LLM]
M --> A
subgraph S["Isolated sandbox"]
SH[Shell / Bash]
FS[Files]
PY[Python / code execution]
DT[Task tools: SQL, APIs, CLI]
OUT[Result / artefacts]
end
A --> SH
A --> FS
A --> PY
A --> DT
SH --> A
FS --> A
PY --> A
DT --> A
A --> OUT
B[Safety boundaries<br/>network · credentials · filesystem · resources] --> S
R[Reset / snapshot] --> S
A --> L[Trace log]
S --> L
OUT --> E[Outcome evaluator]
L --> E
A subtle point matters here: Sandbox-First does not discover “all possible capabilities”. No finite set of experiments can establish that. It discovers an expanding set of observed capabilities under known conditions. A capability is therefore better recorded as:
Model M, with environment E, tools T, instructions P and budget B, succeeds on task class C with reliability R.
That formulation prevents statements such as “the model can’t do X” after one badly designed interface, or “the model can do X” after one lucky attempt.
Related principles
Sandbox-First does not replace ordinary software-engineering principles. Several of them explain different parts of it.
The Bitter Lesson deserves careful wording. Sutton’s argument is that AI history repeatedly favoured general methods able to absorb more computation–especially search and learning–over hand-coded human knowledge. (Sutton 2019) It does not prove that an agent graph is bad or that specialised tools are bad.
The connection is narrower:
Avoid encoding an assumed solution method when a more general mechanism can discover a solution.
Sandbox-First applies this idea at the agent-system level. A shell, filesystem, code interpreter and useful external services are general mechanisms. “Planner agent -> SQL agent -> critic agent -> formatter agent” is a much stronger claim about how the solution should happen.
Anthropic’s agent-engineering guidance reaches a similar practical conclusion from experience: its teams found successful implementations commonly used “simple, composable patterns” and recommend adding complexity when it demonstrably improves results. They distinguish fixed workflows from agents precisely by whether code determines the path or the model dynamically chooses it. (Anthropic 2024)
Unknowns in LLM agent capability
The main unknown is not simply “how intelligent is the model?”. The useful unit is the model interacting with an environment.
Five questions matter.
Capability: What tasks can this model actually complete when it can investigate, compute, create intermediate artefacts and try alternatives?
Tool use: What new capability appears with Bash, Python, SQL, browsing, files, APIs or other tools? Can the agent compose them in ways that were not explicitly designed?
Conditions: Which instructions, tool interfaces, context, environment feedback and runtime affordances are needed for the capability to appear?
Component interactions: Does adding planning, review, memory, another agent or another tool improve the whole system? Under which task structures?
Dependability: How often does an observed successful behaviour recur, including on slightly different cases?
Research provides partial answers, but the reviewed evidence does not establish a general formula for predicting them in advance. (Cheng et al. 2026)
This evidence leads to an important rule for interpreting failures:
A failed agent run is evidence that this configuration failed. It is not yet evidence that the model lacks the capability.
SWE-agent is a clear example. Changing the computer interface changed what an agent could accomplish. (Yang et al. 2024) OpenAI reports a similar effect from production engineering: its agents initially struggled because their environment lacked the tools, information and structure they needed; improving that harness changed the outcome. (OpenAI 2026a)
The opposite is also true:
One successful run establishes possibility, not dependability.
τ-bench and Anthropic’s evaluation guidance both emphasise repeated trials. Anthropic recommends evaluating final environment state where possible, isolating trials and avoiding graders that unnecessarily require one particular action sequence. (Yao et al. 2024; Anthropic 2026b)
Those two statements–failure does not establish inability; success does not establish reliability–are probably among the most important foundations for capability-discovery engineering.
The experimental workbench
The proposed initial workbench uses a minimal agent loop and general tools. Framework features and multi-agent coordination can be added after the baseline exposes a specific need.
The capability core can be:
This is almost exactly the experimental baseline used by Cheng et al.: Bash + file editor + finish, with the model permitted to install or construct further tools. (Cheng et al. 2026)
For SQL tasks, the proposed baseline is a scoped SQL client/tool, a discoverable schema, files and Python. A SQL planner, analyst agent, reviewer agent or graph would be an additional component requiring evidence of value.
Separately, the experimental core should exist from the start:
Isolation and reset. Every trial should start from a known state. Database writes should either be prohibited, transactional/rollbackable or run against disposable copies. Anthropic’s evaluation guidance recommends isolated environments so trials do not contaminate one another. (Anthropic 2026b)
Trace logging. Record model/version, system prompt, task, tools available, tool calls, outputs and errors, files changed, database effects, tokens, elapsed time and final result. Anthropic distinguishes the agent trace from the final environmental outcome because both are useful for different purposes. (Anthropic 2026b)
Outcome evaluation. Prefer checks on the result or resulting state. If the task is “find these customers and produce a CSV”, check the CSV and the answers. A correct result should not fail evaluation solely because the tool-call order differed from an anticipated sequence, unless that sequence was itself a task requirement. (Anthropic 2026b)
Repeatability. Run important tasks several times. Record ordinary success rate and a strict reliability measure such as pass^k: whether all of repeated attempts succeed. (Yao et al. 2024)
Resource boundaries. Set time, tool-call, token, CPU, memory, disk and network limits. Keep production credentials outside the sandbox or expose them through tightly scoped interfaces. Anthropic’s containment work treats filesystem and network boundaries as enforcement mechanisms, while OpenAI’s Codex architecture similarly uses isolated execution. (Anthropic 2026a; OpenAI 2025)
The metrics can stay simple:
Record solution-path diversity as an observation rather than an optimization target. It can reveal unanticipated strategies.
Testable engineering principles
The principles can now be stated in plain language and tied to experiments.
Start sandbox-first
When agent capability is uncertain, begin with a general, safe environment and representative tasks.
Why: a broad computer environment can expose capabilities that do not appear in plain prompting or narrowly designed workflows. This now has direct experimental evidence from LLM-in-Sandbox. (Cheng et al. 2026)
Test: compare the agent with and without that environment on the same tasks.
Put hard limits on effects and leave solution paths open
Control what the agent can affect. Avoid prescribing how it must solve the task unless the method itself is a requirement.
Why: the sandbox lets exploration and containment coexist. (Anthropic 2026a)
Test: compare a goal-based prompt against a prompt requiring a particular plan or sequence.
Give general tools before specialised workflows
Begin with useful primitives–files, code, shell, data access and APIs–and see what the agent can compose from them.
Why: CodeAct and LLM-in-Sandbox both show that executable environments let models combine basic operations into higher-level behaviour. Anthropic’s code-execution work similarly finds advantages in letting agents filter, chain and transform tool results programmatically. (Wang et al. 2024; Cheng et al. 2026; Anthropic 2025c)
Test: compare a small general toolset against a larger collection of task-specific tools.
Experiment before abstracting
See the same need more than once before turning it into a shared agent component.
Why: this applies YAGNI and avoidance of premature abstraction to agent systems. An additional reason in LLM systems is that a general-purpose agent may already perform work otherwise assigned to a custom component. (Fowler, YAGNI; Metz 2016)
Test: introduce the proposed abstraction only after collecting representative traces, then evaluate it against the original baseline.
Measure outcomes and repeat runs
A successful demo shows possibility. Repeated success shows dependability.
Why: agent outputs vary. τ-bench shows that average success can hide poor consistency, and Anthropic recommends multiple isolated trials and outcome-based evaluation. (Yao et al. 2024; Anthropic 2026b)
Test: repeat the same tasks and perturb wording, data and starting conditions.
Make every added component prove its value
Retain a planner, reviewer, memory system, extra agent or framework only when experiments demonstrate an improvement against explicit system objectives.
Why: architecture effects are conditional. Google’s 180-configuration study found that multi-agent approaches helped some task structures and hurt others. Anthropic’s long-running-agent work likewise added specific harness mechanisms in response to observed long-horizon failures. (Kim et al. 2025; Anthropic 2025d)
Test: run an ablation–remove the component–and see what changes.
These rules produce progressive formalisation:
flowchart TD
A["General sandbox<br/>minimal agent"] --> B["Run real tasks"]
B --> C["Observe capabilities,<br/>failures and repeated patterns"]
C --> D["Form a specific hypothesis<br/>for a component"]
D --> E["A/B test the change"]
E -->|helps consistently| F["Keep the smallest<br/>useful component"]
E -->|does not help| B
F --> G["Validate on new tasks<br/>and new projects"]
G --> H["Shared tools / skills /<br/>workflow where justified"]
H --> I["Periodically remove or<br/>simplify components"]
I --> B
The architecture therefore has a different source than a framework-first design.
A framework-first process may begin with concepts such as agents, nodes, graphs, planners, routers, memory and supervisors, then map the problem into them.
Sandbox-First begins with tasks and observed behaviour. Components address repeated needs and failures identified through experiments.
That does not imply that the final system stays simple. It may eventually contain planners, reviewers, specialised tools, multi-agent coordination and strict workflows. The principle is that those structures are conclusions from experiments, not initial assumptions.
Next experiments and prioritised sources
The following experiments would test the proposed method directly.
The third and sixth experiments test two central assumptions of the method: whether general primitives already support work that might otherwise require a custom implementation, and whether a recurring need is stable enough to justify a shared component.
The capability record above (model, environment, tools, instructions, budget, task class, reliability) is the engineering form of the response-profile account in Dispositions as response profiles. What it does not yet do is vary a property of the task class and record how reliability changes; Measuring dispositions describes that step, and Capability claims and empirical method maps the two accounts onto each other.
Prioritised bibliography
The research therefore supports a fairly precise formulation of the approach:
Sandbox-First Capability Discovery is an engineering method for systems whose useful agent capabilities are not known in advance. Start with a minimal agent in a safe, general computer environment; expose powerful basic tools and real tasks; observe and measure what emerges; then add tools, rules and architecture only when repeated evidence gives them a clear job.
And the shortest version of its underlying law is:
When capability is unknown, preserve the space in which capability can be discovered.
A sandbox is what makes that practical: broad freedom of method inside a narrow boundary of consequences. The research from Cheng et al. makes that more than a software-design analogy–their minimal, exploratory computer environment actually elicited useful behaviours that had not been encoded as predefined workflows. (Cheng et al. 2026)
Library sources
- Baltes et al. 2025, Guidelines for Empirical Studies in Software Engineering involving Large Language Models (arXiv:2508.15503). Used in The experimental workbench.
Further reading:
- Song et al. 2025, Aegis (arXiv:2508.19504)
- Silver and Sutton 2025, Welcome to the Era of Experience
References
- Anthropic (2024). Building effective agents. ^anthropic-2024-agents
- Anthropic (2025a). Tracing the thoughts of a large language model. ^anthropic-2025-tracing
- Anthropic (2025b). Writing effective tools for agents – with agents. ^anthropic-2025-tools
- Anthropic (2025c). Code execution with MCP: building more efficient agents. ^anthropic-2025-code-execution
- Anthropic (2025d). Effective harnesses for long-running agents. ^anthropic-2025-harnesses
- Anthropic (2026a). How we contain Claude across products. ^anthropic-2026-containment
- Anthropic (2026b). Demystifying evals for AI agents. ^anthropic-2026-evals
- Cheng, Huang, Gu, Song, Chen, Dong, Zhao, Wen and Wei (2026). Computer Environments Elicit General Agentic Intelligence in LLMs. arXiv:2601.16206v3. Earlier versions were titled LLM-in-Sandbox Elicits General Agentic Intelligence. ^cheng-2026
- Fowler, Martin. Harvested Platform. ^fowler-harvested-platform
- Fowler, Martin. Is Design Dead?. ^fowler-design-dead
- Fowler, Martin. YAGNI. ^fowler-yagni
- Kim et al. (Google Research, 2025). Towards a science of scaling agent systems: when and why agent systems work. ^kim-2025-scaling
- Kwa, West, Becker et al. (METR, 2025). Measuring AI Ability to Complete Long Tasks. ^kwa-2025-metr
- Metz, Sandi (2016). The Wrong Abstraction. ^metz-2016
- OpenAI (2025). Introducing Codex. ^openai-2025-codex
- OpenAI (2026a). Harness engineering: leveraging Codex in an agent-first world. ^openai-2026-harness
- OpenAI (2026b). Introducing the Agents API. ^openai-2026-agents-api
- Sutton, Rich (2019). The Bitter Lesson. ^sutton-2019
- Wang et al. (2023). Voyager: An Open-Ended Embodied Agent with Large Language Models. arXiv:2305.16291. ^wang-2023-voyager
- Wang et al. (2024). Executable Code Actions Elicit Better LLM Agents (CodeAct). arXiv:2402.01030. ^wang-2024-codeact
- Yang et al. (2024). SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. arXiv:2405.15793. ^yang-2024-swe-agent
- Yao et al. (2023). ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629. ^yao-2023-react
- Yao, Shinn, Razavi and Narasimhan (2024). τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. arXiv:2406.12045. ^yao-2024-tau-bench