Sulat.com / Writing on AIThursday, November 19, 2026
Agent Engineering/19 November 2026

OpenAI says the Codex sandbox runs on your own machine, with the network off by default

OpenAI says Codex runs commands in an OS-level sandbox on your own machine, with network access off by default and writes to .git and .codex blocked. Auto-review can answer the approval prompts for you.

Glossy green 3D OpenAI logo inside a glowing glass sandbox box beside a laptop showing blurred code, on a pale mint background

At a glance

  • OpenAI says Codex constrains commands with OS-level sandboxing in your existing environment instead of moving them into a separate container, and posted the design on X on 19 November NZ time.
  • In a Git workspace, the default profile lets Codex edit source files without approval but blocks writes to the root .git and .codex folders, OpenAI says; the docs add .agents and .aws.
  • The default profile disables network access, and a command that asks for it goes to you or to auto-review; allowing a registry's domain in a permission profile skips the prompt.
  • macOS enforces the sandbox with Seatbelt, Linux with bubblewrap plus seccomp, and Windows with MXC, and Codex refuses to run a command on macOS if the platform can't enforce the policy.
  • With approvals_reviewer set to auto_review, a separate reviewer agent decides eligible approval requests, and a denial tells the main agent to find a materially safer path or ask you.

OpenAI says Codex runs your commands inside an operating-system sandbox on your own machine instead of a separate container, and that the default profile keeps network access off. OpenAI Developers laid out the design in a thread on X on 19 November NZ time, with a link to an OpenAI post titled Inside the Codex sandbox.

The thread’s first post gives the reason: as models get more capable, limits on what they can reach matter more. OpenAI’s example is that a command editing your repo shouldn’t automatically get network access.

What the default profile allows

When a Git repository is the workspace for a Codex session, the default permission profile lets Codex edit source files without asking, but blocks writes to the root .git and .codex folders, OpenAI says. It also allows broad reads across the filesystem. The approvals and security docs add that .agents and .aws get the same protection when they exist, and that it’s recursive, so everything under those folders is read-only.

Allowed versus blocked: Codex edits source files and reads broadly, but can't write to .git and .codex, and has no network access by default
The default profile lets Codex edit your code and keeps .git, .codex and the network closed.

A permission profile is a named policy that pairs filesystem rules with network rules. Codex ships three built-in ones: :read-only, :workspace and :danger-full-access, which removes the local sandbox restrictions. You can write your own under [permissions.<name>], or start from a built-in with extends = ":workspace" so the protected paths stay read-only unless you override them. The permissions page labels profiles a beta, and says a config uses either profiles or the older sandbox_mode setting, never both.

Why it uses the OS and not a container

Instead of moving the work into a separate container, Codex has the operating system constrain each command in the environment you already use, OpenAI says. Its example is building an iOS app on a Mac with Codex. The sandbox covers spawned commands, not only Codex’s own file operations, so git, package managers and test runners inherit the same limits, according to the sandbox docs.

Each operating system does the enforcing its own way. On macOS, Codex uses Seatbelt, Apple’s built-in sandbox, and runs commands through sandbox-exec. On Linux it uses bubblewrap (bwrap) plus seccomp, a Linux feature that filters which system calls a process can make. Windows uses MXC, with elevated and unelevated modes kept as legacy fallbacks, and WSL2 uses the Linux version.

Three cards: macOS uses Seatbelt, Linux and WSL2 use bubblewrap plus seccomp, Windows uses MXC with legacy elevated and unelevated fallbacks
Each operating system enforces the same boundary with its own tool.

On macOS, if the platform sandbox can’t enforce the selected policy, Codex refuses to run the command instead of running it unsandboxed, the permissions docs say. Linux users install bubblewrap first. Codex uses the first bwrap it finds on the path and otherwise falls back to a bundled helper, which needs support for unprivileged user namespaces.

OpenAI wrote up the Windows side on 13 May in Building a safe, effective sandbox to enable Codex on Windows. It says Windows doesn’t provide this kind of isolation out of the box, so OpenAI built its own, and that every Codex command is sandboxed from the start with every descendant process staying inside the same boundary.

Network access stays off until you open it

The default profile disables network access. When a command asks for it, Codex can prompt you directly or route the request to auto-review, OpenAI says. If your build regularly downloads from a package registry, you can allow that registry’s domain in a permission profile and skip the prompt.

Flow: a command asks for the network, the default profile says no, Codex asks you or auto-review, or you allow a registry domain in a profile
A blocked network request goes to you or auto-review, unless a profile already allows the domain.

Two settings do the work. network.enabled = true in a profile lets commands reach the network, and features.network_proxy = true makes Codex enforce the profile’s domain rules. With the network on and the proxy off, commands connect directly with no domain limits. In the domain list, "example.com" matches that exact host, "*.example.com" matches subdomains only, "**.example.com" matches the apex and its subdomains, and a deny rule beats an allow rule.

OpenAI’s permissions docs show a profile that builds on :workspace, keeps matching .env files denied and allows one API domain:

default_permissions = "project-edit"

[features]
network_proxy = true

[permissions.project-edit]
description = "Project editing with OpenAI API access."
extends = ":workspace"

[permissions.project-edit.filesystem.":workspace_roots"]
"**/*.env" = "deny"

[permissions.project-edit.network]
enabled = true

[permissions.project-edit.network.domains]
"api.openai.com" = "allow"

Auto-review answers the prompts

Auto-review picks who answers an approval prompt, and it doesn’t move the sandbox boundary. With approvals_reviewer = "auto_review", Codex sends eligible approval requests to a separate reviewer agent instead of stopping for you. If the reviewer approves, the command runs. If it denies, the main agent is told to find a materially safer path or stop and ask you. Actions the profile already allows run without review.

The docs list what triggers a review: requests for escalated sandbox permissions, commands that match a rule set to prompt, network requests to destinations that need approval, file edits outside the writable roots, and MCP or app tool calls that need approval. The reviewer is built to block sending private data, secrets or credentials to untrusted destinations, probing for credentials, tokens or cookies, broad or lasting security weakening, and destructive actions that risk irreversible damage.

OpenAI applies the same limits to its own deployment. In its 8 May post Running Codex safely at OpenAI, it says it doesn’t give Codex open-ended outbound access: its managed network policy allows expected destinations, blocks others and requires approval for unfamiliar domains.

Test a profile before you rely on it

The Codex CLI has a sandbox command that runs a command under a profile so you can see what gets blocked. It’s also available as codex debug, and the macOS version also takes a --log-denials flag.

# macOS
codex sandbox macos [--permissions-profile <name>] [--log-denials] [COMMAND]...
# Linux
codex sandbox linux [--permissions-profile <name>] [COMMAND]...
# Windows
codex sandbox windows [--permissions-profile <name>] [COMMAND]...

The full profile syntax, including filesystem globs and the managed settings for organisations, is on the permissions page.

Disclosure: I’m an OpenAI, Firecrawl and Devin ambassador.


Discover more from Sulat AI & Tech News

Subscribe to get the latest posts sent to your email.