Skip to content
AI Learning Ground Start learning

Models ·

Inside the Codex sandbox

OpenAI published a technical deep dive on the Codex sandbox, explaining how it runs agent commands directly on a user's machine while enforcing filesystem and network limits across macOS, Linux, and Windows.

Inside the Codex sandbox
Image: OpenAI

OpenAI has published an article, written by member of technical staff Michael Bolin, detailing the design of the Codex sandbox. The sandbox lets Codex run commands in a user's existing environment while enforcing filesystem and network restrictions that the user controls, as part of a defense in depth approach alongside training and alignment. Permissions are configured through permission profiles that define filesystem and network rules for a session.

Rather than using virtual machines or containers, Codex uses each platform's own sandboxing facilities to constrain commands in place. The built-in :workspace profile allows writes within a Git workspace while keeping .git and .codex read-only, permits broad filesystem reads subject to OS permissions, and disables network access. OpenAI notes limits remain: an agent could, for example, modify an ignored package like node_modules/prettier in ways that later execute outside the sandbox, which is why layered protections matter.

The harness exposes OS-specific mechanisms through a common API that takes a command and a permission profile, returning a Child handle, and child processes inherit sandbox constraints across the whole process tree. Developers can reuse the sandbox in their own tools, and enterprises can tailor permissions using the Codex security cookbook. For builders, this shows how to sandbox AI agents on the host machine directly, avoiding the friction of reproducing a dev environment in a container, such as when iOS build toolchains only run on the Mac host.

References

Read the full story at OpenAI ↗Like, save or discuss on Buzz

#models #products #research