explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • What problem the Codex sandbox tries to solve
  • Default boundaries: the :workspace profile
  • Permission profiles in config.toml
  • How the harness runs commands
  • The codex sandbox CLI for your own tools
  • Platform implementations
  • Enterprise rollout checklist
  • How this compares to external sandboxes
  • What developers are saying
  • What to do next
  • Related reading
← Back to blog

explainx / blog

Inside the Codex Sandbox: Permission Profiles, OS Enforcement, and Limits

OpenAI, Codex, Coding Agents, Security, Sandboxing

Part of OpenAI and ChatGPT

OpenAI published how the Codex sandbox runs shell commands on your machine with :workspace defaults, config.toml profiles, network proxying, and Seatbelt or bubblewrap enforcement.

Nov 18, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
Inside the Codex Sandbox: Permission Profiles, OS Enforcement, and Limits

OpenAI published a technical deep dive on November 18, 2026 explaining how the Codex sandbox constrains the shell commands its coding agent runs on your Mac, Linux PC, or Windows machine. Member of Technical Staff Michael Bolin argues Codex should stay in your existing environment — not inside a disposable container — while permission profiles you control cap filesystem and network reach.

The post lands one day after Prime Radiant's external sandbox pattern showed the community experimenting with routing agent Bash into isolated Linux guests. OpenAI's answer is the opposite axis: invest in OS sandboxes so Codex can compile iOS apps, talk to local simulators, and reuse host SDKs. Both schools matter because prompt-injected commands and poisoned dependencies keep showing up in real incidents.

Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

What problem the Codex sandbox tries to solve

Codex's most sensitive tool is the shell: it runs programs with your user account's reach. OpenAI's stated philosophy is defense in depth — alignment training plus harness controls — because a model that wants to help can still execute a harmful command.

A sandbox, in OpenAI's wording, is a runtime boundary on what a child process may touch. Examples from the post:

table · 3 cols
TaskProfile ideaRisk being managed
Photo organizerRead/write only ~/Pictures, network offUploading private images
Code reviewDocs sites allowed, repo read-onlyExfiltrating source through curl
Everyday repo work:workspace defaultsAccidental secret reads outside the repo

OpenAI is explicit that defaults are conservative but not airtight. Even with :workspace, a command could patch a local node_modules/prettier copy. Your editor might run that binary on save outside Codex's sandbox, executing malware without showing up in git status. That is why the article pairs sandboxing with auto-review and training rather than treating profiles as a guarantee.

Default boundaries: the :workspace profile

The built-in :workspace profile encodes three rules OpenAI wants every Git project to inherit:

  1. Writes inside the workspace, with .git and .codex read-only so agents cannot rewrite hooks or config.toml silently.
  2. Broad read access wherever your OS user already has permission — needed for compilers pulling system headers, but also meaning ~/.aws/credentials may be readable.
  3. Network disabled unless you widen the profile or approve a one-off escalation.

That third point is the main lever for blocking credential exfiltration. Downloads fail until you allow domains or switch to :danger-full-access, which OpenAI documents for the rare cases you truly need raw network.

Permission profiles in config.toml

Named profiles live under [permissions] in config.toml. OpenAI's sample dev profile extends :workspace, adds a writable ~/build-cache, keeps .vscode and .devcontainer read-only via the :workspace_roots table, and denies **/*.env plus a secrets folder.

Network has three modes in the post:

  • Off (default for :workspace)
  • Direct full access (:danger-full-access)
  • Proxy with domain rules — Codex runs codex-network-proxy, injects standard HTTP_PROXY variables, and resolves DNS only after policy allows the hostname (to block DNS exfiltration)

Enterprise admins can layer requirements.toml or cloud requirements to expose only :read-only and ban :danger-full-access. That mirrors how Microsoft Foundry customers ask for spend and policy guardrails — but here the guardrail is which syscall and socket families survive.

Agent sandbox testing concept for OpenAI Codex permission profiles on the host machineAgent sandbox testing concept for OpenAI Codex permission profiles on the host machine

How the harness runs commands

OpenAI ties sandboxing to the exec_command tool described in its Unrolling the Codex Agent Loop companion post. The harness calls spawn_command_under_sandbox() with a PermissionProfile and optional NetworkProxy, then keeps the entire process tree inside the same restrictions — important when build scripts spawn grandchildren.

Escalation is explicit: tool calls can request with_additional_permissions inside the sandbox or require_escalated execution outside it. Codex may prompt you or route through auto-review before honoring either path. That design parallels ScoutCode's permission modes, but OpenAI documents OS enforcement in far more detail than most harness READMEs.

The codex sandbox CLI for your own tools

Beyond Codex itself, the codex sandbox subcommand runs arbitrary programs under a profile. OpenAI's malicious Prettier example attempts to write .vscode/settings.json pointing at ./node_modules/evil-prettier; a read-only .vscode entry blocks the write and demonstrates how to regression-test profiles.

The same mechanism powers MCP installs: cache npx @modelcontextprotocol/server-memory with temporary network, then run the server read-only with network off and writes limited to cache and data dirs. If you orchestrate agents with Loops or custom CI, this CLI is the supported way to mirror Codex's boundaries.

Platform implementations

Permission boundary graphic for OS-native Codex sandbox enforcement on macOS, Linux, and WindowsPermission boundary graphic for OS-native Codex sandbox enforcement on macOS, Linux, and Windows

macOS: Seatbelt and sandbox-exec

Codex generates Sandbox Profile Language snippets and invokes /usr/bin/sandbox-exec. (deny default) is the base; explicit (allow network-outbound ...) opens only the local proxy ports. OpenAI notes Apple marks sandbox-exec deprecated yet Chrome and Chromium still rely on Seatbelt, so Codex plans to keep using it.

Linux: bubblewrap plus seccomp-bpf

codex-linux-sandbox wraps bubblewrap for mount namespaces, then applies seccomp-bpf compiled through the seccompiler crate. Deny globs expand to concrete paths per command — new files matching a glob mid-run are not auto-blocked, a subtle limitation red teams should remember.

When the network proxy is on, Codex forks a host bridge that accepts connections from an isolated network namespace and relays them to the shared proxy — more moving parts than macOS loopback, but necessary because bubblewrap unshares the network stack.

Windows: moving to MXC

OpenAI says it is replacing its older Windows sandbox with Microsoft's MXC (Microsoft eXecution Container) to drop admin-setup friction, slow ACL churn, and persistent firewall artifacts. MXC support is the forward path; legacy Windows behavior still appears in older docs.

Enterprise rollout checklist

OpenAI's post targets security engineers rolling Codex to hundreds of laptops the same week GPT-6.2 expanded coding use cases. A practical sequence:

  1. Inventory default profiles. Ensure no developer pinned :danger-full-access in a global config.toml left over from debugging.
  2. Publish requirements.toml before Christmas travel season, when contractors clone repos onto personal Macs.
  3. Deny env files centrally. Extend OpenAI's **/*.env deny pattern to **/.aws/** and **/id_rsa if your threat model includes cloud keys beside dotenv files.
  4. Enable proxy mode for CI mirrors. Allow *.ubuntu.com and your artifact registry hosts while blocking paste sites and raw IP endpoints.
  5. Log escalations. Every require_escalated approval is an audit event; feed those logs to the same SIEM watching GitHub Copilot routing.

OpenAI also documents managed requirements merging: arrays replace wholesale, tables merge recursively. That means your security team can add a single ".idea" = "read" row without forking the entire corporate baseline — important when IT refreshes profiles monthly.

Windows MXC migration notes

Teams on Surface fleets should read the MXC section twice. OpenAI admits the legacy Windows sandbox needed admin setup, slow ACL writes, and leftover firewall rules. MXC is supposed to shrink that operational tax. Until your tenant receives MXC builds, treat Windows Codex like any other partially sandboxed agent: pair it with EDR policies that watch for unexpected child processes.

How this compares to external sandboxes

table · 4 cols
ApproachWhere the agent runsIsolation strengthWorkflow fit
Codex OS sandboxHost harnessKernel policies on real filesBest for native mobile builds
Docker-all-inContainerStrong, fragile toolchainsDatacenter reproducibility
Prime Radiant external sandboxHost harness, Linux guest for BashClear audit splitExperimental, unaudited

None of these replace code review and secret hygiene. They reduce blast radius when a model hallucinates curl exfiltration, not when a human pastes production keys into the repo.

What developers are saying

The Hacker News thread is thin so far — bolinfest (likely Bolin) posted that the article is a deep dive on the sandbox component. Watch the thread for hands-on reports on bubblewrap versus distro packages and whether broad read defaults feel too loose for regulated laptops.

What to do next

  1. Read OpenAI's Codex security cookbook alongside this post.
  2. Copy the dev profile pattern, deny **/*.env, and run codex sandbox tests on your worst-case scripts.
  3. If you need Linux-in-a-box isolation anyway, pair host Codex with external sandbox servers — they are complementary, not either-or.
  4. Enterprises should publish requirements.toml before rolling Codex to hundreds of laptops, the same week you rationalize API key storage for agents.

For builders comparing harnesses, our GPT-6.2 launch coverage and Claude remote-access debate sit on the same security shelf: models got better, so execution policy is the product.

Quick answers to common Codex sandbox searches

table · 2 cols
Search intentShort answer
Codex sandbox modePermission profiles in config.toml, not a separate VM product
Codex disable sandboxProfiles like :danger-full-access exist but enterprises can ban them via requirements
Codex vs Claude CodeBoth run on host filesystems; compare their escalation prompts and enterprise policy files, not marketing slides
Is Codex open source?The harness is not fully open; OpenAI documents behavior in engineering posts like this one

If codex sandbox tests pass but production still scares you, run a parallel Loops workflow against a scratch repo before pointing Codex at monorepo mains. The CLI is the supported contract — reverse-engineering undocumented flags will break on the next CLI release.

OpenAI ends the engineering post with acknowledgments to contributors who built codex-linux-sandbox and the network proxy crate. If you maintain an internal fork of Codex tooling, track those component names in your SBOM — they are the surfaces your red team should fuzz first.

Related reading

  • External sandboxes for coding agents
  • How to run Loops with the Codex CLI
  • ScoutCode harness permission modes
  • Microsoft Agent Framework PyPI typosquat incident
  • MCP tool-provider misbinding risks
  • GPT-6.2 Astra and Sol launch
Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Nov 17, 2026

External Sandboxes for Coding Agents: v86, Containers, and Quicksand

On November 17, 2026 Simon Willison summarized Prime Radiant’s external sandbox pattern: keep Pi, Claude Code, or Codex on your Mac but route command execution to Alpine Linux in WebAssembly, Apple Containers, or Microsoft Quicksand with optional HTTP allow-list proxying.

Nov 12, 2026

OpenAI Codex on Amazon Bedrock: SSO Setup, Gateways, and Telemetry

On November 11, 2026 AWS published a hands-on guide for pointing OpenAI Codex at Amazon Bedrock. Codex stays on the developer laptop. Requests go to Bedrock through AWS credentials, and a team picks one of four rollout paths for control and audit.

Nov 3, 2026

Is OpenAI Silently Re-Enabling Training on Codex Chats? What Is Claimed and What Is Verified

Two Hacker News threads, two months apart, describe the "Improve the model for everyone" setting turning itself back on for ChatGPT and Codex users. OpenAI has not commented. Here is what the help center says, what is only anecdote, and a checklist to lock your settings down.