How OpenAI Built a Secure Windows Sandbox for Codex Agents

· Source: InfoQ · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cybersecurity & Data Privacy, Software Development & Engineering · Depth: Intermediate, quick

Summary

OpenAI detailed its custom Windows sandbox architecture for the Codex coding agent, released on June 05, 2026. This engineering effort addresses the challenge of balancing security, usability, and developer productivity on Windows, as existing isolation mechanisms like Windows Sandbox and Mandatory Integrity Control (MIC) proved inadequate for autonomous coding agents. Codex, which runs locally and interacts with developer environments, required a solution to restrict its access without disrupting workflows. OpenAI initially implemented an "unelevated sandbox" using Windows security identifiers (SIDs), access control lists (ACLs), and write-restricted tokens, creating a "sandbox-write" SID for controlled directory access. This was later redesigned into an "elevated sandbox," which establishes dedicated local Windows accounts, such as CodexSandboxOffline and CodexSandboxOnline, for executing commands with restricted tokens and managing network access via firewall rules. This approach aims to provide a secure yet functional environment for coding agents.

Key takeaway

For AI Architects designing agentic systems on Windows, this architecture demonstrates a viable path to secure execution. If you are evaluating how to integrate coding agents without granting unrestricted system access, consider adapting OpenAI's approach of custom local accounts and granular access controls. This allows your agents to interact with developer tools and files securely, mitigating risks associated with autonomous code execution while preserving workflow efficiency.

Key insights

OpenAI built a custom Windows sandbox for Codex to balance agent security with developer workflow integration, overcoming limitations of existing OS primitives.

Principles

Method

OpenAI's sandbox design evolved from an "unelevated" system using SIDs/ACLs/write-restricted tokens to an "elevated" one with dedicated local Windows accounts and firewall-controlled network access.

In practice

Topics

Best for: CTO, VP of Engineering/Data, Director of AI/ML, AI Engineer, AI Architect, AI Security Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.