OpenAI details Codex sandbox design using native OS isolation instead of containers

·2026.11.18 17:00

Key point

The system restricts file and network access via Seatbelt, bubblewrap, and MXC to prevent data exfiltration while preserving local toolchains.

1 / 5

Details

  • Codex applies a defense-in-depth sandbox to agent commands, using native OS mechanisms rather than VMs or Docker to preserve local development environments like iOS toolchains.
  • The default :workspace profile allows broad file reads and writes within the workspace but blocks network access and keeps .git and .codex directories read-only to prevent configuration tampering.
  • A shared spawn_command_under_sandbox() API enforces permissions across macOS, Linux, and Windows, with child processes inheriting constraints from the parent process tree.
  • Network isolation is enforced via a proxy that filters requests against domain rules, pausing unmatched requests for user approval or auto-review to prevent data exfiltration.

Platform Implementation

  • macOS uses Apple's Seatbelt (SBPL) via sandbox-exec, starting with a deny default policy and allowing connections only to local proxy ports.
  • Linux combines bubblewrap for mount namespace isolation with seccomp-bpf for syscall filtering, using a host bridge to relay network traffic through a loopback listener.
  • Windows is transitioning from legacy ACL-based sandboxes to the Microsoft eXecution Container (MXC) library to eliminate the need for elevated privileges and persistent host state.

Configuration and Limitations

  • Permissions are defined in config.toml profiles, where explicit deny rules override allow rules, and managed requirements can restrict available profiles.
  • The codex sandbox CLI allows testing arbitrary commands under specific profiles without an active agent session.
  • stdio-based MCP servers are not sandboxed by default because the harness cannot reliably infer their resource needs, requiring manual wrapping with specific permission profiles.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.