How OpenAI sandboxes Codex agents on Windows
· Do Minh Tuan · Business Hackers 🚀
OpenAI has described how it runs Codex agents safely on Windows. The short version: it gives the agent a dedicated account, uses Windows access control to fence it in, and strips its permissions down to what the task needs. The agent can write and run code, and it cannot reach sensitive system files or network ports.
I read this with some relief. I notice that most agent security writing assumes Linux and containers. Windows is where a lot of enterprise development actually happens, and it is much harder to isolate a process there without giving up the tooling people need.
The three pieces, without the jargon
A security identifier, or SID, is the ID Windows uses to know who a user or process is. An access control list, or ACL, is the list attached to a file saying which IDs may read or change it. A restricted token is a cut-down version of a process's permissions, so the process can do less than the person who launched it.
Put together, those give you a process that runs as a separate identity with a narrow set of rights. That is the shape of it: sandbox accounts where the agent works, separate from the account a developer uses.
The important design choice is the separate identity. If an agent runs as you, every action it takes looks like you in the logs, and every permission you have becomes a permission it has. A dedicated account makes the boundary visible and the audit trail readable. When something goes wrong, you can see what the agent did, as the agent.
The easy way to isolate code on a developer machine is a virtual machine, and I understand why people reach for it. It is also slow to start and awkward to script, which means people turn it off when it gets in the way.
Containers on Windows exist, and they are a reasonable option, but they bring their own overhead and their own configuration surface. For an agent that needs to run short commands many times a day, that friction matters.
Using the operating system's own security primitives is the cheaper path. It is also the less fashionable one, which is why I like it. ACLs are well understood by the people who administer enterprise machines, and they do not require installing another layer that has to be kept patched.
What this does and does not protect against
I think it protects the machine, and that is worth being precise about, because the announcement could be read as a broader safety claim.
A sandbox limits what the agent can touch, and I would not read it as more than that. It does not judge whether the agent should be doing the thing. If a poisoned document tells the agent to delete a repository, the sandbox decides whether the repository is reachable, not whether the instruction made sense. If the repository is in reach, the sandbox did its job and the agent still did damage.
So this is one layer in a stack that also needs approval for destructive actions, limits on what the agent can download, and a record of what it changed. Sandboxing is the layer that stops a small mistake from becoming a machine-wide one. It is not the layer that stops a bad instruction.
One more thing I would note. This is a design for a coding agent, and the same logic applies to any tool you let touch a repository. The account, the token and the access list are the parts that survive a change of vendor. The specific product is the part that does not.
The version a small team can copy
I do not think you need Codex or a Windows sandbox architecture to apply the principle. The next time you connect an AI tool to anything, ask three questions.
Does it run as a separate identity? If the answer is your own account, the agent inherits everything you can do, including the things you forgot you had access to.
The second question is network reach. A restricted process that can still call any endpoint is only half restricted. Egress rules matter as much as file permissions.
The third is the environment. API keys sitting in environment variables are readable by anything running in that context. If the agent does not need the key, the key should not be there.
None of that is exotic. It is the same least-privilege advice security teams give for servers, applied to a new kind of process that happens to be running on a laptop.
The part of the story I would want expanded is the boundary between the sandbox and the developer's real work. Agents are useful precisely because they touch real files. A sandbox that is too tight produces an assistant that can write code but cannot run the tests, so the developer copies everything out by hand and the isolation becomes theatre.
OpenAI's write-up suggests the balance is deliberate: enough access to be useful, not enough to be dangerous. That balance is the product. It is also the part that will need tuning per team, because the definition of 'the files this task needs' varies wildly between a data pipeline and a Windows desktop app.
For teams in Vietnam building for enterprise clients on Windows, this is worth reading closely. A client security review can ask how AI tooling is isolated, and 'the vendor says it is sandboxed' is a weaker answer than a description of the account, the permissions and the logs. Being able to explain the model in plain terms is worth more than any badge.
Written with AI assistance, reviewed and edited by Do Minh Tuan.