Infra · 18 Nov 2026 · 2 min read

OpenAI Details Its Codex Sandbox Architecture

OpenAI has published the architecture of its Codex sandbox, giving builders a rare look at securing code-interpreting agents in production.

What happened

OpenAI released a technical breakdown of the security architecture behind its Codex sandbox. The engineering post details the system designed to safely execute model-generated code. The environment provides each execution with a temporary, isolated filesystem and heavily restricted network access.

To achieve this, OpenAI's team uses a hardened container environment built with nsjail on Linux. The system imposes strict limits on CPU time, RAM, and the number of running processes. This multi-layered approach aims to prevent malicious code from affecting the host system or other users' sessions.

How the room's reading it

The post is being treated as a reference design by builders working on AI agents. For many, it's a confirmation of best practices for running untrusted code. Infra teams on forums are debating the choice of nsjail over more mainstream tools like Docker or lightweight VMs like Firecracker — weighing the trade-offs between security, performance, and operational complexity.

The consensus among practitioners is that this level of isolation is the absolute minimum for any product that executes code on behalf of a user. The main point of discussion is whether these measures are sufficient for enterprise-grade applications, where data residency and stricter compliance controls often require more provable guarantees than containerisation alone can offer.

Sailfish's take

We've built sandboxed environments like this. The architecture OpenAI describes is a solid, defensible starting point. But the hardest part isn't building the walls — it's knowing what happens inside them. The real challenge for anyone shipping agents is observability. When an agent fails, you need to know if it wrote bad code or if it just bumped into a sandbox restriction.

Debugging a failing agent inside a black box is a nightmare. This is where most teams get stuck. The useful tooling we see emerging isn't about new ways to build sandboxes, but about providing visibility into agent execution within them. If you're building an agentic product, we think your logging and debugging strategy is more critical than your choice of container.

Our take — your read?

Be the first to weigh in.

Sources
— END OF DISPATCH — Infra