Problem
On macOS, setting network_access = true under [sandbox_workspace_write] in ~/.codex/config.toml has no effect. The seatbelt sandbox unconditionally sets CODEX_SANDBOX_NETWORK_DISABLED=1, causing all outbound network calls (OCI CLI, curl, API clients, etc.) to fail with connection timeouts.
This affects any workflow that requires network access from within a Codex session — cloud CLI tools (OCI, AWS, GCP), package registries, API calls, etc.
Environment:
- macOS (Darwin 25.2.0)
- Codex CLI installed via Homebrew (
/opt/homebrew/bin/codex)
config.toml with network_access = true under [sandbox_workspace_write]
Reproduction:
- Set
network_access = true in ~/.codex/config.toml:
[sandbox_workspace_write]
network_access = true
- Launch
codex and run any network command (e.g. curl https://example.com or an OCI/AWS CLI call)
- Command fails with connection timeout / "not reachable"
Root cause: The macOS seatbelt sandbox profile (codex-rs/core/src/seatbelt_network_policy.sbpl) enforces network blocking at the OS level regardless of config.toml.
Confirmed Workaround
The only reliable fix is bypassing the seatbelt sandbox via CLI flag:
codex --sandbox danger-full-access "your prompt"
Or as a persistent shell alias:
alias codex='CODEX_SANDBOX_NETWORK_DISABLED=0 codex --sandbox danger-full-access'
Setting sandbox_mode = "danger-full-access" in config.toml alone is not sufficient — the CLI flag is required.
Proposed Fix
The seatbelt profile should respect the network_access = true configuration from config.toml the same way the Linux Landlock sandbox does. When a user explicitly opts in to network access via config, the seatbelt policy should conditionally allow outbound connections instead of unconditionally blocking them.
A potential implementation path:
- In
codex-rs/core, read network_access from the resolved config before generating the seatbelt profile
- Conditionally include/exclude the network deny rule in
seatbelt_network_policy.sbpl
- This would make macOS behavior consistent with the documented
config.toml settings
Happy to submit a PR if the team agrees with this approach.
Related Issues
Problem
On macOS, setting
network_access = trueunder[sandbox_workspace_write]in~/.codex/config.tomlhas no effect. The seatbelt sandbox unconditionally setsCODEX_SANDBOX_NETWORK_DISABLED=1, causing all outbound network calls (OCI CLI, curl, API clients, etc.) to fail with connection timeouts.This affects any workflow that requires network access from within a Codex session — cloud CLI tools (OCI, AWS, GCP), package registries, API calls, etc.
Environment:
/opt/homebrew/bin/codex)config.tomlwithnetwork_access = trueunder[sandbox_workspace_write]Reproduction:
network_access = truein~/.codex/config.toml:codexand run any network command (e.g.curl https://example.comor an OCI/AWS CLI call)Root cause: The macOS seatbelt sandbox profile (
codex-rs/core/src/seatbelt_network_policy.sbpl) enforces network blocking at the OS level regardless ofconfig.toml.Confirmed Workaround
The only reliable fix is bypassing the seatbelt sandbox via CLI flag:
codex --sandbox danger-full-access "your prompt"Or as a persistent shell alias:
Setting
sandbox_mode = "danger-full-access"inconfig.tomlalone is not sufficient — the CLI flag is required.Proposed Fix
The seatbelt profile should respect the
network_access = trueconfiguration fromconfig.tomlthe same way the Linux Landlock sandbox does. When a user explicitly opts in to network access via config, the seatbelt policy should conditionally allow outbound connections instead of unconditionally blocking them.A potential implementation path:
codex-rs/core, readnetwork_accessfrom the resolved config before generating the seatbelt profileseatbelt_network_policy.sbplconfig.tomlsettingsHappy to submit a PR if the team agrees with this approach.
Related Issues
CODEX_SANDBOX_NETWORK_DISABLED=1forced)danger-full-access)