Technology

Codex keeps agents on your machine, on a leash

OpenAI detailed how Codex sandboxes shell commands on macOS, Linux and Windows without moving work into containers.

StartupHub.ai Staff

By StartupHub.ai Staff, reviewed by Daniel Singer, Editor

2 min read

Codex sandbox permission controls for commands
Credit: OpenAI News

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?

Sources

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

TopicsOpenAICodexmacOSLinuxWindowsPrettierGitMCP

StartupHub.ai StaffDaniel SingerWritten by StartupHub.ai Staff, Editorial teamReviewed by Daniel Singer, EditorAbout

StartupHub.ai Staff, Editorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Daniel Singer, Editor

Daniel Singer is an AI expert who has been writing about, covering and building AI technology since 2018.

More from Daniel Singer

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.