Writing
The Agent Needs an Environment, Not Just Tools
A search function and a database query were enough for short loops. Longer work needs a place to stand.
Writing
A search function and a database query were enough for short loops. Longer work needs a place to stand.
Notes
Tool calling gave language models a way to reach outside the prompt. Give the model a search function, a database query, or an API, and it can choose when to use it.
That was enough for short agent loops. It is not enough for the kind of work agents are starting to do now.
OpenAI's March 11 Responses API update makes the missing layer visible. The model can work with a shell tool inside a hosted container that has a filesystem, optional structured storage such as SQLite, restricted network access, reusable skills and native context compaction. The model still does not execute commands by itself. It proposes actions; the surrounding system runs them and feeds the results back.
My takeaway is that an agent needs more than tools. It needs somewhere for work to exist while the task is in progress.
A function call is usually narrow. Search for a file. Query a table. Send an HTTP request. Run a command.
A real task connects many of those operations through intermediate state.
Suppose an agent has to collect sales data from an API, compare it with last quarter, produce charts, write a short analysis and deliver a spreadsheet. The API response is not the final result. The agent needs somewhere to store raw data, transformed data, scripts, temporary charts and the workbook it is building.
Trying to keep all of that inside conversation context is a bad fit.
OpenAI's new environment treats the container as working context. Files can be staged in a filesystem. Structured data can live in SQLite. Shell processes can transform that data. The result can remain as an artifact instead of being serialised back into the prompt after every step.
That is closer to how ordinary software works. Programs do not keep their entire state inside one function argument. They use filesystems, databases, processes and services around them.
Agents are reaching the same point.
Long context made it tempting to solve every state problem by putting more information into the prompt.
That works until the task starts producing its own data.
A shell command may return thousands of lines. A CSV can contain millions of values. A research task may download documents that only matter for one calculation. A code task can generate build logs, test results and intermediate patches.
The model does not need all of those bytes occupying attention at the same time.
OpenAI recommends staging large inputs in the container and letting the model inspect only the files or rows it needs. For structured data, the system can expose the table schema and let the model query relevant records instead of copying the entire dataset into context. Shell output can be capped so raw logs do not consume the working window.
This is the same separation I argued for with memory: active context is working memory, not durable storage.
The environment gives the agent another level in that hierarchy.
Once a task lasts long enough, even a carefully managed context window fills up.
OpenAI's answer is compaction. The Responses API can compress prior conversation and tool state into a smaller representation, then continue the workflow across context boundaries. OpenAI says Codex uses the same mechanism for long-running coding tasks.
The architectural point matters more to me than the exact compaction method.
A long task cannot depend on every prior token remaining directly visible forever. The system needs ways to preserve what still matters while leaving low-value history behind.
This makes agent state look less like chat history and more like process state.
The current prompt contains what the model needs to decide next. The filesystem contains working artifacts. A database can hold structured state. The runtime retains execution state. Compaction carries forward a reduced history of the reasoning loop.
No single storage layer has to do everything.
Giving an agent a shell without network rules would create another problem.
Many useful workflows need external access. The agent may need to call an API, download a package, query a service or retrieve current data. But unrestricted outbound access means the same environment can send information somewhere it should not go.
OpenAI's hosted containers route outbound requests through a policy layer with allowlists and access controls. Credentials can be injected only for approved domains, while raw secrets remain outside model-visible context.
That is a useful design pattern beyond one API.
Permissions should belong to the environment, not to the model's judgment.
The model can decide that it wants to contact a service. Infrastructure should decide whether that destination is allowed and whether the required credential can be used there.
This becomes more relevant as agents move from code repositories into business systems. The broader the task, the more dangerous an unrestricted execution environment becomes.
Coding agents reached this problem earlier because repository work already requires an environment.
The Codex app gives parallel agents isolated worktrees so they can change the same repository without touching one another's Git state. It uses sandboxing, controlled network permissions and reviewable diffs around long-running work. OpenAI describes Codex as moving from writing code toward using code to complete broader work on a computer.
Research before these products pointed in the same direction. SWE-agent found that changing the interface between the model and the computer could materially change software-engineering performance. Its argument was simple: agents, like human users, perform differently depending on the environment and interface they are given.
That makes "model capability" an incomplete description of an agent system.
A capable model with a weak environment may spend time rediscovering files, lose intermediate state or receive poor feedback from commands. The same model inside a better execution setup can behave like a much stronger worker because the surrounding system makes state legible and actions verifiable.
This maps directly to the kind of Blender, rendering and game-development automation I care about.
Imagine an agent preparing a batch of product scenes for delivery. It may need to inspect project files, read naming rules, run Blender scripts, collect validation results, generate preview renders and prepare a report of failures.
I would not want every intermediate result pushed back into a chat transcript.
The agent should have a task workspace. Input files can be mounted or copied into it. Scripts can run there. Validation results can be written to structured files. Render previews can remain as artifacts. A final report can link back to those outputs.
The same applies to game-development work. A build investigation may involve source files, compiler output, logs, test artifacts and generated patches. The environment becomes the place where the investigation exists while the model decides what to do next.
This separation makes debugging easier too. If the agent fails, I can inspect the files and state it left behind rather than reconstructing the whole task from natural-language messages.
I think the environment will become a first-class part of agent architecture.
Tool catalogues will still matter, but they describe what an agent can request. The environment determines where those requests execute, where intermediate state lives, what resources can be reached and what survives between steps.
As agents take on longer jobs, I expect products to expose this layer more directly: isolated workspaces, durable artifacts, structured task state, scoped network access, reusable skills and policies around execution.
That will make the model only one part of the capability stack.
The model decides what should happen next.
The environment is where the work actually happens.
More