The claim
On 18 November OpenAI published “Inside the Codex sandbox”, on how Codex runs commands on a developer’s machine while enforcing filesystem and network limits the user controls, across macOS, Linux, and Windows. We could not read the post itself from our environment: it returned an error. Everything below comes from OpenAI’s May post Running Codex safely and from independent sources we did read, each labelled.
OpenAI’s own position is clear. It does not run Codex internally with open-ended outbound access. Its managed policy allows expected destinations, blocks others, and asks for approval on unfamiliar domains, with read-only and workspace-write as the required sandbox modes (vendor, OpenAI). The claim a buyer hears is simpler: switch on the sandbox and the agent is contained. That is the claim we test.
Three sandboxes, not one
“The Codex sandbox” is three different mechanisms, one per operating system (independent, Daniel Vaughan’s Codex Knowledge Base):
| Platform | Mechanism | Known limit |
|---|---|---|
| macOS | A default-deny Seatbelt profile for sandbox-exec | Network access is all-or-nothing, tracked in issue #10390 (Codex Knowledge Base) |
| Linux | Bubblewrap namespaces, a read-only root filesystem, and seccomp, with Landlock as a fallback | Not detailed in the sources we read |
| Windows | Commands run as dedicated CodexSandboxOffline or CodexSandboxOnline users with restricted tokens | Restricted tokens cannot block outbound traffic, so network isolation needs firewall rules and a one-time elevation; Group Policy, antivirus, and locked-down machines can break setup (Codex Knowledge Base) |
One rule is shared: .git is read-only on all three unless allow_git_write is set (independent, Codex Knowledge Base). Two more caveats come from Agent37, a hosting vendor with a commercial interest in running Codex for you: network domain rules need an active proxy, and environment variables with KEY, SECRET, or TOKEN in their names are not removed automatically (vendor, Agent37).
The test: did the sandbox hold?
Mostly. Not always. The Cloud Security Alliance documented two escapes, both reported on 12 August 2026 (independent):
| Heapjack | Overpatch | |
|---|---|---|
| Product | Codex Desktop | Codex CLI |
| Fixed in | Build 26.818.21641 | 0.149.0 |
| Patched within | Eight days of the report | |
| CVE assigned | None | |
| Mode | Strictest read-only, no user approval needed | Not stated in what we read |
Our reading, not a measured result: read-only is the mode a cautious team picks for unfamiliar code, and that is the mode Heapjack got out of. And because neither escape has a CVE, a scanner that keys on CVEs will not flag a laptop still running an affected build. Assumption: your vulnerability tooling matches on CVE identifiers. If it inventories application versions directly, the second point weakens.
Result: the claim holds for routine work on trusted code. It does not hold as a boundary for code you do not trust.
Where this breaks
- The primary was unreadable. OpenAI’s 18 November post returned an error from our environment. If it announces changes to any of the mechanisms above, this note is behind it.
- The per-OS detail is one independent author. Daniel Vaughan’s Codex Knowledge Base is thorough and was updated on 18 November, but it is one source. Linux network limits were not covered in what we read.
- Two escapes are not a rate. They show the boundary can fail. They do not tell you how often.
- Agent37 sells hosting. Its two caveats are plausible and checkable. Check them on your own build before you rely on them.
Five steps before Codex runs on managed laptops
- Step 1. Inventory versions. Find every Codex Desktop and CLI install and confirm Desktop build 26.818.21641 or later and CLI 0.149.0 or later. Do not wait for a CVE feed. Owner: endpoint security.
- Step 2. Lock the mode by policy. Read-only or workspace-write, network off by default, unfamiliar domains behind approval. Owner: platform security with the developer tools lead.
- Step 3. Test the Windows image you actually ship. Run sandbox setup on the locked-down build with your Group Policy and antivirus, and confirm the firewall rules apply. Owner: desktop engineering.
- Step 4. Strip secrets from the agent’s environment. Assume variables named KEY, SECRET, or TOKEN reach it. Move them to a secrets manager. Owner: platform security.
- Step 5. Put untrusted code in a disposable VM or container. Third-party repositories, outside pull requests, and suspicious dependencies get an outer box with no credentials. Owner: head of engineering.
Missing
- OpenAI’s 18 November post, read in full.
- What, if anything, it changes on each platform.
- Linux network isolation detail from a source we could read.
- Any CVE or advisory for Heapjack and Overpatch.
- A Prestanda test of the sandbox on each platform.
Frequently asked questions
Is the Codex sandbox the same on every operating system?
No. As documented by Daniel Vaughan's independent Codex Knowledge Base, Codex uses a default-deny Seatbelt profile on macOS, Bubblewrap namespaces with a read-only root filesystem and seccomp on Linux, with Landlock as a fallback, and dedicated sandbox users with restricted tokens on Windows. Each has different limits, so test the one your developers actually run.
Has anyone escaped the Codex sandbox?
Yes. The Cloud Security Alliance documented two escapes reported on 12 August 2026: Heapjack in Codex Desktop and Overpatch in Codex CLI. Both were patched within eight days, in Desktop build 26.818.21641 and CLI 0.149.0, and neither received a CVE. Heapjack worked in Codex Desktop's strictest read-only mode and needed no user approval.
When should developers run Codex inside a VM instead of relying on its sandbox?
When the agent works on code you do not trust, such as a third-party repository, a pull request from outside the team, or a dependency you are investigating. The built-in sandbox reduces risk on routine work, but it has been escaped once in read-only mode, so untrusted code belongs in a disposable VM or container with no access to your secrets.
Living page. Last updated 19 Nov 2026. We update this note when we can read OpenAI’s 18 November post, when either escape gets a CVE or advisory, or when we run the sandbox ourselves. Rolling Codex out to developer laptops? Talk to us.