OpenAI Responses API Computer Environment Update

OpenAI has integrated a computer environment into the Responses API, allowing AI agents to move beyond text generation to executing complex workflows. By providing models with a shell tool and a hosted container workspace, the platform can now run services, request data from APIs, and generate artifacts like spreadsheets or reports within an isolated environment.

The Shell Tool and Execution Loop

The shell tool enables models to interact with a computer via a command-line interface, utilizing familiar Unix utilities such as grep, curl, and awk. Unlike the existing code interpreter which is limited to Python, the shell tool allows for the execution of Go, Java, and NodeJS servers, significantly expanding the range of possible agentic tasks.

Orchestration via the Responses API

The Responses API acts as the orchestrator between the model and the hosted tools. For shell execution to function, the prompt must specify the use of the shell tool, and the model must be trained for shell commands (specifically GPT-5.2 and later).

The execution loop follows this process:

  1. The model proposes one or more shell commands.
  2. The Responses API forwards these commands to the container runtime.
  3. The API streams output back to the model in near real-time.
  4. The model inspects results and either issues follow-up commands or provides a final answer.

To maintain efficiency, the Responses API supports concurrent execution of multiple commands in separate container sessions and enforces output caps per command to prevent large terminal logs from consuming the context window.

Context Management and Compaction

To prevent long-running agent loops from exhausting the context window, OpenAI introduced native compaction. This system allows models to analyze prior conversation state and produce an encrypted, token-efficient representation of key details.

Compaction Implementation

Compaction is available as a built-in server-side feature or via a standalone /compact endpoint. Server-side compaction uses a configurable threshold to automatically handle timing, allowing requests near the context limit to be processed and compacted rather than rejected. This mechanism was developed and refined through the use of Codex, which utilizes compaction to sustain iterative tool execution in long coding tasks.

Container Context and Resource Management

The hosted container serves as the working context for the model, providing a controlled environment for data manipulation and external interaction.

File Systems and Databases

OpenAI provides container and file APIs to help models map available data, encouraging a pattern where resources are staged in the container file system rather than packed into the prompt. For structured data, the use of SQLite is recommended; models can be given table descriptions and query only the necessary rows, which is more scalable and cost-effective than scanning entire datasets in the prompt.

Secure Network Access

To mitigate risks associated with unrestricted internet access, hosted containers use a sidecar egress proxy. This centralized policy layer enforces allowlists and access controls. For authentication, domain-scoped secret injection is used at the egress point, meaning raw secret values remain outside the model-visible context and are only applied to approved destinations.

Reusable Agent Skills

Agent skills allow developers to package recurring multi-step patterns into reusable building blocks, preventing the model from having to rediscover workflows in every run. A skill consists of a folder bundle containing a SKILL.md file (metadata and instructions) and supporting resources like API specs.

Skill Integration Workflow

When a skill is utilized, the Responses API follows a deterministic sequence:

  1. Fetch skill metadata (name and description).
  2. Fetch the skill bundle, copy it to the container, and unpack it.
  3. Update the model context with the skill metadata and the container path.

The model then discovers these files using shell commands and executes the scripts according to the instructions.

Sources