Tag Archives: 操作系统安全

How OpenAI Confines Its Codex Coding Agent With OS-Level Sandboxing

Original author: OpenAI

OpenAI's engineers have described how Codex, its coding agent, runs commands on a user's own computer without getting unlimited access. Instead of moving work into a virtual machine or Docker container, Codex uses each operating system's own isolation features. That lets it keep using the developer's real toolchain, such as native Mac build tools and the iPhone simulator, which a container could not easily reach.

Behavior is controlled by permission profiles. The default workspace profile lets the agent write inside the project but keeps sensitive folders such as .git and .codex read-only. It allows broad reads so compilers and build tools keep working, and it turns off network access to block uploads of data. Users can define their own profiles, whitelist or blacklist domains, and mark files such as .env or a secrets folder as off limits. Enterprise administrators can set managed requirements that restrict which profiles employees may choose.

The article admits that the sandbox has limits. An agent could still tamper with a locally installed package that an editor later runs outside the sandbox. For that reason OpenAI presents sandboxing as one layer in a defense-in-depth strategy, alongside model training and alignment. A network proxy checks each request against domain rules, and unknown domains can be sent to the user or to an automated reviewer for approval. DNS lookups happen only after approval, because hostnames themselves can leak data.

Enforcement differs by platform. On macOS, Codex uses Apple's Seatbelt, which Apple has marked deprecated but which Chrome also relies on. On Linux it combines bubblewrap with seccomp filters, plus a relay that lets sandboxed programs reach the proxy. On Windows, OpenAI is moving to Microsoft's new MXC container library, which does not need admin rights. A codex sandbox command also lets developers wrap other tools, such as an MCP server, in the same restrictions.

For engineers, students and security-minded users, the piece is a practical look at how to give AI agents real capabilities while keeping control over what they can read, write and send.


Source: OpenAI
Original title: Inside the Codex sandbox
Original link: https://openai.com/index/inside-the-codex-sandbox/
Published: 2026-11-18

This is a summary written by our Editorial Team, not the full original text. Copyright remains with the original author and publisher; see the original link for the full article.

Disclaimer: The views and opinions expressed in this article are solely those of the original author(s) and do not necessarily reflect the views or positions of Overseas Chinese (overseaschinese.org). We republish, translate or summarize it for informational purposes only.