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?

  1. Add allowed_sandbox_modes = ["read-only", "workspace-write"] to /etc/codex/requirements.toml
  2. Start a new chat using a local worktree.
  3. 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_

View original on GitHub ↗

6 Comments

viyatb-oai contributor · 3 months ago

hey! the error message you linked

Error: invalid sandbox policy: invalid value for `sandbox_mode`: `DangerFullAccess` is not in the allowed set [ReadOnly, WorkspaceWrite] (set by /etc/codex/requirements.toml)

indicates you or the MDM is enforcing this in /etc/codex/requirements.toml.

faevourite · 3 months ago

@viyatb-oai I don't have danger-full-access set anywhere though! MDM setting is allowing workspace-write, which is what I use. Please reopen.

viyatb-oai contributor · 3 months ago

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.

ofigma · 3 months ago

This makes the codex.app unusable with worktree at the moment. I cannot find anywhere in my machine that set danger-full-access

faevourite · 2 months ago

@viyatb-oai Hey, any update on this? Worktrees have been broken in the Codex App for almost a week now. :'(

faevourite · 2 months ago

Ah, appears fixed in 26.422.20832