Building a safe, effective sandbox to enable Codex on Windows
The Codex engineering team has developed a new sandbox implementation for Windows, enabling a safer and more effective environment for OpenAI's coding agents. This solution addresses the previous lack of robust isolation features on Windows, allowing Codex to operate with controlled file write and network access without requiring administrative privileges. The team developed its own solution using SIDs and write-restricted tokens to achieve granular control over file system modifications, along with environmental overrides to limit network access, ensuring a balance between productivity and security.
When the Codex engineering team began its work, Windows users of OpenAI's coding agents faced a dilemma: an absence of robust sandbox implementation. This meant that Codex, a powerful coding agent enabling human-model interaction, ran with the full permissions of a real user by default. While powerful, this setup presented significant security risks as it could perform any action the user could, from running tests to modifying files or creating Git branches. Other operating systems offered built-in isolation tools, but Windows lacked this capability. To address this, the team embarked on creating a custom sandbox for Windows, aiming to match the safety and user-friendliness experienced on other platforms. This custom solution was designed to operate without requiring administrative privileges, a critical goal for user convenience.
The core of the Windows sandbox involved carefully limiting file write operations and network access. To control file writes, the team leveraged two key Windows features: Security Identifiers (SIDs) and write-restricted tokens. SIDs, typically used for defining user or group permissions, were adapted to create unique identifiers exclusively for the Codex sandbox. These SIDs, when incorporated into Access Control Lists (ACLs), allowed for precise control over which files and directories the sandbox could modify. Write-restricted tokens, a special type of process token, introduced an additional security layer by performing extra checks on write operations, ensuring that files could only be modified in approved locations. This combination provided the necessary granularity for secure file system interaction.
Limiting network access posed a different challenge, especially due to the constraint of not requiring elevated permissions. Standard tools like Windows Firewall were not an option without administrator rights. The team’s approach focused on making network-dependent tools fail gracefully within the sandbox. This involved environmental overrides to redirect traffic from common tools like Git and package installers to non-existent endpoints. While effective for many common scenarios, this method was advisory rather than a hard block. It aimed to discourage unauthorized network activity by making typical internet-facing operations within the sandbox unsuccessful, prompting the user to approve such actions outside the sandbox.
Related articles
Build real agentic apps using CUGA: two dozen working examples on a lightweight harness
CUGA, IBM's open-source Agent Harness, simplifies building agentic applications by handling infrastructure, allowing developers to focus on tools and prompts. It offers pre-assembled components for planning, execution, and state management, significantly reducing development time. CUGA has topped agent benchmarks like AppWorld and WebArena.
OpenAI launches new initiative to help find and patch open source bugs
OpenAI has launched "Patch the Planet," a new initiative in partnership with cybersecurity firm Trail of Bits, to enhance the security of open-source projects. This program aims to assist maintainers in identifying and patching bugs, utilizing OpenAI's AI-powered security tools while reducing the burden on project teams.
PP-OCRv6 on Hugging Face: 50-Language OCR from 1.5M to 34.5M Parameters
Baidu has released PP-OCRv6, an advanced optical character recognition (OCR) model supporting 50 languages. Available on Hugging Face, this version significantly improves accuracy and efficiency across various parameter sizes, from 1.5 million to 34.5 million, marking a substantial leap in multilingual OCR technology.
