OpenAI detailed how Codex runs shell commands inside OS-enforced sandboxes with filesystem and network limits you set.
It does not move your work into Docker.
The built-in :workspace profile writes inside the repo while holding .git and .codex read-only, OpenAI said. It allows broad reads outside the repo so compilers, runtimes and SDKs keep working. Network stays off by default to block uploads, which also blocks dependency downloads until you allow them.
Those limits stop a large class of bad behavior but not all of it. OpenAI showed how Codex could poison node_modules/prettier, which Git often ignores. A host editor running that Prettier on save would then execute outside the sandbox. That local execution requirement is why OpenAI pairs the sandbox with training and alignment for intent.
The harness swaps subprocess.Popen for spawn_command_under_sandbox, OpenAI said. The call takes a command, working directory, permission profile and optional network proxy, and limits inherit down the process tree. The exec_command tool can ask for use_default, with_additional_permissions or require_escalated, but the harness decides whether to prompt, auto-review or block. The same primitives also power file reads and the Codex sandbox command, including sandboxing an MCP server.
A dev profile can extend :workspace to add write access to ~/build-cache, per OpenAI. It can pin .vscode and .devcontainer to read-only and deny */.env and secrets. Network has three paths: off, full direct access, or proxied domain rules with explicit deny beating allow. OpenAI keeps iOS builds on the Mac host, where Docker cannot run the toolchain or iPhone simulator, and constrains them with native facilities on macOS, Linux and Windows.
Beam frames the practical choice as read-only, workspace-write or danger-full-access and notes workspace-write with on-request approvals covers most local work. A 2026 guide puts that same sandbox and approval model alongside config.toml, AGENTS.md, MCP and cloud delegation as five systems to master. The contrast is isolation versus control: containers move work away from the bespoke laptop, Codex tries to lock work where it already runs.
OpenAI published no bypass rates, approval-friction numbers or sandbox overhead, so the cost of leaving network off is still anecdotal. Published telemetry on escalation prompts and blocked exfiltration attempts would change the read. How many teams keep :workspace defaults once dependency installs force the network question?





