Summary
On macOS (Apple Silicon), defining any [permissions.<name>] profile and activating it — via -P <name> on codex sandbox, or via default_permissions in config.toml — makes the sandboxed child process abort before exec (SIGABRT, no output, no denial log). Reproduced on codex-cli 0.144.6 and 0.145.0 (npm @openai/codex, darwin-arm64).
This matters beyond the crash itself: the permissions-profile explicit-rule mechanism appears to be the only way to relax the default read-only protection of a workspace's git directory under workspace-write (append_default_read_only_project_root_subpath_if_no_explicit_rule in codex-rs/protocol/src/permissions.rs). With profiles aborting, there is no working opt-out, so orchestrated/unattended agents (e.g. an openai/symphony-style orchestrator driving codex via app-server) cannot git add/commit/push in their own workspace under any configuration we could find.
Repro (model-free, codex sandbox)
mkdir -p /tmp/repro && cd /tmp/repro && git init -q . && echo x > f.txt
# Baseline (no [permissions] table): exec works
codex sandbox -- sh -c 'echo ALIVE' # prints ALIVE
# Any permissions profile: child aborts before exec, silently
export CODEX_HOME=/tmp/repro-home && mkdir -p "$CODEX_HOME"
cat > "$CODEX_HOME/config.toml" <<'EOF'
default_permissions = "p1"
[permissions.p1]
[permissions.p1.filesystem]
"/tmp/repro/.git" = "write"
EOF
codex sandbox -P p1 -- sh -c 'echo ALIVE' # no output; child exits via SIGABRT
codex sandbox -- sh -c 'echo ALIVE' # same (default_permissions active): no output
Also reproduces with an empty profile ([permissions.p1] with only a description). Adding a [permissions.p1.workspace_roots] table produces the same abort. --log-denials prints the "Sandbox denials" header with no entries (the abort happens at/before sandbox apply, not as a file denial).
Context: what we were actually trying to do
Under workspace-write, git-metadata writes fail (fatal: Unable to create '<repo>/.git/index.lock': Operation not permitted). We verified the protection is thorough — it covers .git at any depth, and follows a .git gitfile pointer to a separate git dir of any name (nice work — name-based dodges don't slip past it). That makes the profile explicit-rule path the intended relaxation mechanism, and it is unreachable while profiles abort.
Two related observations from the app-server lane (codex 0.144.6, orchestrated use):
- An explicit per-turn
sandboxPolicy with writableRoots is acknowledged in turn_context but the extra roots are not enforced in the exec seatbelt.
- Config-level
sandbox_workspace_write.writable_roots is not applied when an explicit turn policy is present (the turn policy replaces it), while network_access and the exclude flags do take effect. (codex sandbox CLI honors config-level writable_roots; the app-server turn exec does not.)
Ask
- Fix permission-profile application so profile-based sandboxes can exec (the SIGABRT above).
- Or/and: provide a supported, documented opt-in for git-directory writability under
workspace-write for orchestrated use (equivalently: honor turn-policy writableRoots in app-server turn exec so an orchestrator can grant it deliberately).
Environment
- codex-cli 0.144.6 and 0.145.0 (npm), darwin-arm64
- macOS 15.x, Apple Silicon (Mac mini)
- Repro is host-local
codex sandbox; no model calls involved
Summary
On macOS (Apple Silicon), defining any
[permissions.<name>]profile and activating it — via-P <name>oncodex sandbox, or viadefault_permissionsinconfig.toml— makes the sandboxed child process abort before exec (SIGABRT, no output, no denial log). Reproduced on codex-cli 0.144.6 and 0.145.0 (npm@openai/codex, darwin-arm64).This matters beyond the crash itself: the permissions-profile explicit-rule mechanism appears to be the only way to relax the default read-only protection of a workspace's git directory under
workspace-write(append_default_read_only_project_root_subpath_if_no_explicit_ruleincodex-rs/protocol/src/permissions.rs). With profiles aborting, there is no working opt-out, so orchestrated/unattended agents (e.g. an openai/symphony-style orchestrator driving codex via app-server) cannotgit add/commit/pushin their own workspace under any configuration we could find.Repro (model-free,
codex sandbox)Also reproduces with an empty profile (
[permissions.p1]with only adescription). Adding a[permissions.p1.workspace_roots]table produces the same abort.--log-denialsprints the "Sandbox denials" header with no entries (the abort happens at/before sandbox apply, not as a file denial).Context: what we were actually trying to do
Under
workspace-write, git-metadata writes fail (fatal: Unable to create '<repo>/.git/index.lock': Operation not permitted). We verified the protection is thorough — it covers.gitat any depth, and follows a.gitgitfile pointer to a separate git dir of any name (nice work — name-based dodges don't slip past it). That makes the profile explicit-rule path the intended relaxation mechanism, and it is unreachable while profiles abort.Two related observations from the app-server lane (codex 0.144.6, orchestrated use):
sandboxPolicywithwritableRootsis acknowledged inturn_contextbut the extra roots are not enforced in the exec seatbelt.sandbox_workspace_write.writable_rootsis not applied when an explicit turn policy is present (the turn policy replaces it), whilenetwork_accessand the exclude flags do take effect. (codex sandboxCLI honors config-levelwritable_roots; the app-server turn exec does not.)Ask
workspace-writefor orchestrated use (equivalently: honor turn-policywritableRootsin app-server turn exec so an orchestrator can grant it deliberately).Environment
codex sandbox; no model calls involved