r/CodexAutomation • u/anonomotorious • 14d ago
News & Releases OpenAI explains the Codex sandbox: workspace limits, network rules and MCP server access
TL;DR
OpenAI has published a detailed explanation of how the Codex sandbox restricts local commands. Its built-in workspace profile allows workspace writes and broad reads subject to operating-system permissions, while disabling network access by default. The article also highlights an important boundary: Codex does not automatically sandbox the command that starts a stdio MCP server.
What OpenAI describes
Codex applies permission profiles to commands using operating-system mechanisms in the existing environment. Child processes inherit the restrictions. On macOS it uses Seatbelt; on Linux it combines bubblewrap and seccomp; on compatible Windows devices OpenAI says it is transitioning to an MXC-based sandbox. These are OpenAI’s descriptions, not independent tests.
The workspace profile protects directories including .git and .codex from writes, but broad reads can still include sensitive files outside the workspace if the user’s OS permissions allow them. A sandbox also cannot prevent every harmful change: OpenAI gives the example of an altered ignored dependency later executed by an editor outside the sandbox.
Practical implications
Review the active permission profile and its filesystem and network scope before running automation. A network domain allowlist requires the network proxy to be enabled; OpenAI says domain rules are not enforced if the proxy is disabled. Broad wildcard or DNS access can still permit data leakage.
For stdio MCP servers, review the server and its permissions separately. OpenAI demonstrates wrapping a server with codex sandbox --permission-profile … -- … and a dedicated profile. Test any profile with the actual command and environment before relying on it. On Linux and Windows, the article says deny globs are expanded before launch, so newly created matching paths are not automatically added to that running command’s restrictions.
This article explains existing mechanisms and a Windows transition; it does not claim a new release or that every configuration has the same protections. Check the current documentation and managed requirements for your installation.
1
u/radim11 13d ago
The stdio MCP bit is easy to miss. If I connect a GitHub MCP server with a write token, I still need to check which tools Codex can call through it. For a session where I just want it to triage issues, I’d give the server a read-only token. Otherwise I’m relying on the tool permissions to catch every write I didn’t intend to allow.