I let an AI coding agent run shell commands on my machine for the first time about a year ago. It was fast — embarrassingly fast. It scaffolded a custom Elementor widget, ran the build, and fixed its own errors. But somewhere between "it works" and "let me push this to the client's staging site," a colder thought arrived: this thing is running commands with my user account, on my machine, with access to everything I can read. My SSH keys. My .env files. My clients' wp-config.php files with live database passwords in them.
That is the exact problem OpenAI tried to answer on November 18, 2026, when it published "Inside the Codex sandbox," a technical deep dive by Michael Bolin of OpenAI's technical staff. It is the clearest explanation yet of what happens between "the model decided to run a command" and "that command actually touches your files."
A sandbox is a leash, not a cage
A sandbox limits what a program can access while it runs — a set of rules enforced on a process in your real environment, on your real files, not a separate computer you can throw away afterwards.
OpenAI's philosophy, stated plainly in the post, is "defense in depth." Model training and alignment are supposed to stop the agent from generating a harmful command in the first place. The sandbox is the second layer: if the model makes a mistake, or a prompt injection talks it into something it should not do, the sandbox limits the damage.
This matters for WordPress developers more than for most people, because our projects are unusually dangerous to hand to an agent. A typical WordPress install is not just code. It is a database password in plain text, API keys for payment gateways, and a production server one SSH key away. Point Codex at a client theme and you hand it the keys to everything your user account can reach, unless something in between says otherwise.
Why Codex doesn't use a container
The most surprising decision in the post is what the sandbox is not. Most people's instinct, mine included, is that you would run an agent's commands inside a Docker container or a virtual machine — a disposable box you delete when the session ends. OpenAI deliberately chose not to do that.
Instead, Codex uses each operating system's own sandboxing tools to constrain commands running in your existing environment. On macOS that means Seatbelt, enforced through /usr/bin/sandbox-exec. On Linux it means bubblewrap — the same low-level tool Flatpak uses — plus a seccomp filter. On Windows, Codex is moving to Microsoft's MXC library, replacing an earlier design that needed administrator rights just to set up.
The reason is practical. Reproducing a developer's environment inside a container is real work, and some workflows simply do not function in isolation. OpenAI's example is building an iOS app: the native Mac build toolchain and the iPhone simulator do not run inside a Linux container. The same logic applies to my WordPress work — specific PHP versions, Node tooling, and local databases I do not want to rebuild inside a container every time an agent runs a build. The price is that the sandbox can only ever be as strong as the operating-system primitive underneath it, and OpenAI says that out loud.
The :workspace defaults, in plain English
Every Codex session runs under a permission profile — a named set of filesystem and network rules applied to every command the agent launches. The default profile is called :workspace, and with a Git repository as your workspace root, it encodes three rules.
First, Codex can write inside your workspace, but .git and .codex stay read-only. The agent can edit source freely, but it cannot silently rewrite your Git hooks or its own config.toml — the rule that stops it editing its own permissions.
Second, Codex gets broad filesystem read access, anywhere your operating-system user already has permission to read. This is the uncomfortable one. Compilers and build tools genuinely need to read SDKs and configuration outside your repository, so a tight read boundary would break real work. But "broad reads" also means a command Codex runs can read files like ~/.aws/credentials if they exist on your machine. The sandbox does not hide your secrets from the agent. It only stops the agent from writing outside the workspace and from reaching the network.
Third, network access is disabled by default — the rule doing most of the heavy lifting. With no network, a command cannot upload anything: the agent may see a lot, but has nowhere to send it.
OpenAI's examples make the design click: a photo organizer might get ~/Pictures only, with network off; a code review might get docs access with source read-only. The profile is the unit of trust, and you shape it to the task.
Permission profiles: the part most developers will skip, and shouldn't
The built-in profiles start with a colon: :workspace, :read-only, and :danger-full-access, which is exactly what it sounds like. You can also define your own named profiles under [permissions] in Codex's config.toml, setting each path to read, write, or deny. OpenAI's sample dev profile extends :workspace and explicitly denies /.env files plus a secrets folder.
Network has three modes: off (the :workspace default), direct full access, or a proxy mode with domain rules, where Codex runs a network proxy and only allows the domains you list. One catch a follow-up analysis flagged: a domain allowlist does nothing unless the network proxy feature is actually switched on. And nothing in the default setup stops a developer from picking :danger-full-access — only a managed requirements.toml can lock that down for a team. The guardrails exist, but on a single developer's machine, they are voluntary.
OpenAI also admits the defaults are conservative but not airtight. Even inside :workspace, a command could patch a local copy of a dependency — the example given is patching node_modules/prettier — which then runs the next time you build. And broad read access means secrets outside the workspace are readable, even if they cannot be uploaded anywhere while the network is off. The sandbox limits blast radius. It does not make the agent trustworthy.
One more gap comes from that same follow-up analysis, and it is the one I most want WordPress developers to hear: stdio MCP servers — the helper servers that connect Codex to tools and data — start outside the sandbox by default. The sandbox covers the commands the agent runs, and very little else. If you have wired Codex up to an MCP server that can read your WordPress database or your hosting API, that server is not inside the leash.
How it is enforced, and where it gets thin
Under the hood, Codex exposes one sandboxing API across all three platforms: hand it a command and a permission profile, and it returns a child process. The whole process tree that grows out of that command inherits the same restrictions, including child processes that outlive the original command.
The details matter: macOS Seatbelt runs through sandbox-exec, which Apple marks deprecated; Linux bubblewrap needs unprivileged user namespaces, which some distributions disable; and the Windows MXC sandbox disables clipboard access and input injection. None of this is a reason not to use Codex — it is a reason to know which floor you are standing on.
What I do differently now on WordPress projects
Reading the post did not make me stop using AI coding agents. It changed how I set them up, and the changes are small enough that they are now my default for every client project.
One project, one workspace, no exceptions. I never point Codex at a folder containing two client sites, or at my home directory, or at a folder with SSH keys sitting next to the theme. The workspace boundary is the only write boundary the default profile gives me, so I make it a real boundary.
I deny secrets explicitly. The sample dev profile's /.env deny rule goes into every config.toml I use, and I add wp-config.php to it. If the agent needs a database password, it can ask me. It never needs to read one silently.
Network stays off unless the task genuinely needs it. Installing a package needs the network. Reviewing code does not. Editing a template does not. I approve a one-off network escalation for the install step and then go back to offline.
I never use :danger-full-access on a machine that can reach production. Full access belongs on a disposable VM, not my work machine.
I review diffs before anything is deployed, and treat MCP servers as un-sandboxed until proven otherwise. A command inside the workspace can still delete the wrong table or push a broken migration — the agent's work gets the same review a junior developer's would.
And one WordPress rule: agents work on staging, never on live. The sandbox protects the filesystem, not you from deploying a confident, broken change to a store taking orders.
The bigger picture
AI coding agents are moving from curiosities to infrastructure. Just last week, Amazon's Cairn report showed AI agents finding a real zero-day in eleven minutes — I wrote about that here on November 27 — and Anthropic let Claude start reviewing, fixing, and approving pull requests. The question is no longer whether agents can run commands. It is what limits those commands.
OpenAI's answer is refreshingly un-magical: conservative defaults, operating-system primitives, profiles you configure yourself, and an open admission that the result is not airtight. A sandbox you understand beats one you trust blindly.
If you use Codex, Cursor, or Claude Code, read OpenAI's post yourself, then open your config.toml, deny your .env files, and keep the network off until you need it. The agent will still be fast. It will just be fast inside a fence you built.
Conclusion
The Codex sandbox is not a promise that AI agents are safe. It is a set of tools — permission profiles, network controls, operating-system enforcement — that let you decide exactly how much of your machine an agent is allowed to touch, with sensibly cautious defaults. The gaps are real and OpenAI names them: broad read access that can reach your credentials, dependencies an agent can patch locally, and MCP servers that run outside the sandbox entirely. But knowing where the fence ends is what makes the fence useful. Set up a tight profile, deny your secrets, keep the network off by default, and review everything before it ships.
FAQ
What is the Codex sandbox?
The filesystem and network limits Codex applies to every shell command its coding agent runs. Instead of a virtual machine, it uses OS-native sandboxing — Seatbelt on macOS, bubblewrap on Linux, and Microsoft's MXC library on Windows.
What does the default :workspace profile allow?
Writes inside your workspace, with .git and .codex read-only. Broad filesystem reads anywhere your account can read, and no network access by default.
Can I customize what Codex is allowed to do?
Yes — define named profiles under [permissions] in config.toml, setting paths to read, write, or deny. Network has three modes: off, full access (:danger-full-access), or a domain-allowlist proxy.
Is the Codex sandbox completely secure?
No, and OpenAI says so openly. Broad reads can reach files like ~/.aws/credentials, an agent could patch a local dependency, and stdio MCP servers run outside the sandbox. One layer of defense, not a guarantee.
Should WordPress developers worry about AI coding agents?
Not worry — configure. One workspace per project, deny **/*.env and wp-config.php, keep network off unless needed, never use full access on a machine that can reach production, and review every diff.
Does the sandbox protect my live WordPress site?
Only indirectly. It limits commands on the agent's machine; it does not review code, stop a bad deployment, or protect a production server reachable through your credentials. Keep agents on staging and deploy only after human review.
