self_hosted environment, its shell commands, file reads and patches run in a Mirage workspace, under the workspace’s profile and mount modes. No sandbox holds the files.
The workspace connects through Codex’s exec-server relay, set up on the Codex page. The Agents API is in beta.
Install
Workspace
/workspace, where OpenAI’s examples work, is scratch space in memory. /redis keeps what the agent saves there after the workspace closes, which needs a Redis server and the redis extra:
workspace.yaml
Create a session
Connect the workspace
Hand the session’senvironment.id and environment.remote_url, with an environment key, to codex exec-server forward pointed at workspace demo. The agent’s commands then run in the workspace, and what it writes lands in its mounts.
Run a task
Open the session’s event stream, then send the task. The agent’s reply streams back while its commands run in the workspace:Example
examples/python/agents/openai_agents_api/redis_report.py runs the whole flow: it seeds /workspace/orders.csv, starts mirage codex-exec and codex exec-server forward, sends the task and prints the report.