techlist.io

Llm Tool Use

1 posts

OpenAI2026-03-103 min readCurated summary

From model to agent: Equipping the Responses API with a computer environment

# Equipping the Responses API with a Computer Environment OpenAI argues that agents need more than prompting: they need a computer environment where models can run commands, store files, query data, and access the network under control. The Responses API, combined with a shell tool and hosted container workspace, provides an orchestration loop that executes model-proposed actions in an isolated environment, manages long-running context through native compaction, and packages reusable workflows as skills. Together these primitives let developers build repeatable, safer production workflows without writing their own execution harness. ## The Shell Tool and Agent Loop - The model only proposes tool calls; the platform executes them and feeds the output back into the next request. - The shell tool provides Unix utilities such as grep, curl, and awk, and supports more than Python, including Go, Java, and NodeJS servers, unlike the earlier code interpreter. - The Responses API keeps a streaming connection to the container, relays output to the model in near real time, and repeats the loop until the model returns a final answer with no further commands. - Multiple commands can run concurrently in separate container sessions, with their outputs multiplexed back as structured results. - The model sets an output cap per command. The API returns a bounded result that keeps the beginning and end of the output and marks what was omitted, so logs don't flood the context window. ## Compaction for Long-Running Tasks - Long tasks fill the context window with tool calls and reasoning summaries, so the API needs a way to keep only the important state. - Newer models produce a compaction item, an encrypted and token-efficient representation of prior state. The next window contains this item plus the most valuable earlier content. - Compaction is available as a server-side setting with a configurable threshold, which triggers automatically, or through a standalone `/compact` endpoint. - The server-side option tolerates small overages before compaction, so near-limit requests are compacted rather than rejected. - Codex uses this mechanism for long coding sessions, and OpenAI notes that Codex helped build and debug the compaction system itself. ## Container Context: Files, Databases, and Network - **File systems:** Resources are staged in the container through the container and file APIs. The model can then choose targeted file operations rather than receiving all inputs in the prompt. - **Databases:** Structured data can be stored in SQLite. The model receives table and column descriptions and queries only the rows it needs, for example to answer which products declined in sales this quarter. - **Network access:** All outbound traffic passes through a sidecar egress proxy that enforces allowlists and access controls and keeps traffic observable. - **Credentials:** Secrets are injected at egress with domain scoping. The model sees only placeholders, and raw values are applied only to approved destinations. ## Agent Skills - A skill is a versioned folder bundle containing `SKILL.md` (metadata and instructions) and supporting resources such as API specs or UI assets. - Before the model runs, the Responses API fetches skill metadata, copies the bundle into the container and unpacks it, then adds the metadata and container path to the model context. - The model reads the instructions progressively with shell commands and runs the skill's scripts within the same agent loop. ## Practical Takeaway Combining these components lets a single prompt drive an end-to-end workflow: find the right skill, fetch data, convert it into local structured state, query it efficiently, and produce durable artifacts such as spreadsheets or reports. OpenAI points to a cookbook example that packages a skill and runs it through the Responses API as a starting point.