Worktree creation fails with "invalid sandbox policy" when requirements.toml has `allowed_sandbox_modes`
Resolved 💬 6 comments Opened Apr 17, 2026 by faevourite Closed Apr 23, 2026
💡 Likely answer: A maintainer (viyatb-oai, contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
26.415.20818 (1727)
What subscription do you have?
Enterprise
What platform is your computer?
Darwin 25.4.0 arm64 arm
What issue are you seeing?
Worktree initiation fails on any starter message with this error:
Error: invalid sandbox policy: invalid value for `sandbox_mode`: `DangerFullAccess` is not in the allowed set [ReadOnly, WorkspaceWrite] (set by /etc/codex/requirements.toml)
[stderr] Error: invalid sandbox policy: invalid value for `sandbox_mode`: `DangerFullAccess` is not in the allowed set [ReadOnly, WorkspaceWrite] (set by /etc/codex/requirements.toml)
My own ~/.codex/config.toml has:
sandbox_mode = "workspace-write"
I don't use danger-full-access.
This started happening just today with 26.415.20818 (1727). Worked fine beforehand.
What steps can reproduce the bug?
- Add
allowed_sandbox_modes = ["read-only", "workspace-write"]to/etc/codex/requirements.toml - Start a new chat using a local worktree.
- Send any message to trigger the worktree creation (which fails).
Uploaded thread: f56ce032-c448-4253-92c5-6ca73a9d6d92
What is the expected behavior?
Worktree gets initialized and first message is processed.
Additional information
_No response_
6 Comments
hey! the error message you linked
indicates you or the MDM is enforcing this in
/etc/codex/requirements.toml.@viyatb-oai I don't have
danger-full-accessset anywhere though! MDM setting is allowingworkspace-write, which is what I use. Please reopen.sorry, I misread this as a codex cli issue! I'm tracking this internally for codex app team to see what the worktree creation flow is using.
This makes the codex.app unusable with worktree at the moment. I cannot find anywhere in my machine that set
danger-full-access@viyatb-oai Hey, any update on this? Worktrees have been broken in the Codex App for almost a week now. :'(
Ah, appears fixed in 26.422.20832