Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.908.70816
What subscription do you have?
Business
What platform is your computer?
Darwin 27.0.0 arm64 arm
What issue are you seeing?
Codex App, when used without explicit project and a custom permission profile, will have the sandbox deny every execution after the first.
codex-cli does not show the same behaviour (though of course always has some dir implicitely as project dir) unless you explicitely use /permissions.
What steps can reproduce the bug?
Run Codex App with a permission profile.
default_permissions = "mine"
[permissions.mine]
extends = ":workspace"
[permissions.mine.filesystem]
":root" = "deny"
":minimal" = "read"
"/opt/homebrew" = "read"
"/opt/homebrew/var/mysql" = "deny"
"/usr" = "read"
"/bin" = "read"
"~/.ssh" = "deny"
"~/.env" = "deny"
"~/.bash_profile" = "read"
"~/.bashrc" = "read"
[permissions.mine.filesystem.":workspace_roots"]
"**/*.env" = "deny"
Start a chat, but OUTSIDE a project, you write: Please try calling "date"
Output: The date
You write: "Again"
Output: "Couldn’t run date again: the updated sandbox blocks the command runner’s configured /opt/homebrew/bin/bash, and permission was not granted."
You write: "Show exact error message"
Output: "sandbox-exec: execvp() of '/opt/homebrew/bin/bash' failed: Operation not permitted"
You write "Run it through /bin/bash"
Output: "It still fails before executing the command because the runner itself launches the configured Homebrew Bash:"
Also, it's super irritating that the visually selected policy seems to change automatically after the first test.
Also, if it tries to request permission, you can give it but sandbox will still fail.
On Codex App, without projects, default behaviour is already buggy.
Within a project, changing the active permissions through the UI in any way will also trigger the bug and condemn the chat to all access failing.
On codex CLI, sandbox will stay stable until you call /permissions in any way. Even switching to "Full access" will immediately fail with:
failed to load AGENTS.md instructions for environment `local`: fs sandbox helper failed with status exit status:
71: sandbox-exec: execvp() of '/opt/homebrew/bin/codex' failed: Operation not permitted
The root cause of all this seems to be the ":root" = "deny" entry in the config, even though it's officially in your documentation. Remove it from the profile (which I don't want), the problem vanishes.
What is the expected behavior?
Reliable sandbox behaviour.
Additional information
This might be related to #45657 - I am not sure. A sandbox that's tried to be constructed within the current sandbox might cause these problems.
Activity
[-]Sandbox forbids all commands on Mac OS once permissions ever change[/-][+]Sandbox with custom profile forbids all commands on Mac OS once permissions ever change[/+]ryandamico commentedon Oct 5, 2026
Same failure here (0.160.1, macOS), with a profile that extends
:workspaceand sets":root" = "deny"and":minimal" = "read".On my system the issue depends on how
codexis launched. Through the installer's symlink (~/.local/bin/codexor~/.codex/packages/standalone/current/bin/codex), every session fails at startup:But when launched by the resolved path (
~/.codex/packages/standalone/releases/0.160.1-aarch64-apple-darwin/bin/codex), it starts normally and the profile still blocks reads outside the workspace. It looks like the helper gets re-executed through the path codex was invoked with, and the profile denies that path.My workaround for now is to replace the
~/.local/bin/codexsymlink with a script that resolves the path first:tokenmaxxr commentedon Oct 20, 2026
Additional reproduction on codex-cli 0.163.0, installed through Homebrew, on macOS 27.0.1 (26A434).
This also blocks resuming an existing CLI session:
Observed error (personal paths redacted):
Relevant parts of the current configuration (excerpt, not a standalone minimal reproduction):
Earlier turns in the affected session used the custom restricted profile. The final saved
turn_contextcontains:{ "approval_policy": "never", "permission_profile": {"type": "disabled"}, "sandbox_policy": {"type": "danger-full-access"} }Verified workaround: the same session resumes and reaches the idle prompt when the policy is explicitly supplied:
Additional checks:
--no-daemonstill produces the original resume failure.codex sandbox -P workspace-only /opt/homebrew/bin/codex --versionsucceeds.Operation not permitted (os error 1).sandbox-exec ... deny(1) file-read-metadata /opt/homebrew/bin/codexduring the failing resume.This appears consistent with the permission-transition issue described above, with resume restoring a saved disabled profile as another trigger. The exact internal cause is not confirmed.
mrtomatwo commentedon Dec 1, 2026
I observed the same failure after selecting Full access in an existing local chat on Codex Desktop
26.1120.50957(build30866), bundled engine0.171.0-alpha.13.2, macOS27.2.1(26B131), arm64.The chat began with a custom restricted profile containing
":root" = "deny"and":minimal" = "read". After selecting Full access, two consecutive turns recordedactive_permission_profile.id = ":danger-full-access"andapproval_policy = "never". The effectivepermission_profileremainedmanaged, and the savedsandbox_policy.typewasworkspace-writewith no writable roots. The tool instructions reported read-only.The filesystem policy changed from 32 read rules, 5 write rules, and 38 deny rules to one write rule (
:root = write) plus the exact same 38 deny rules, including:root = deny. The:minimal = readrule disappeared.A minimal failing call was
/usr/bin/truevia/bin/sh, withlogin: falseandworkdir: "/private/tmp". It returned exit code 134 with empty output. A matching macOS crash report for/bin/shshowsEXC_CRASH / SIGABRTindyld, includingdyld4::CacheFinder. A new side conversation in the same project recorded effectivedanger-full-accessandpermission_profile.type = "disabled". The identical call returned 0 there. This comparison uses the affected chat and a fresh control. A standalone reproduction with only the two custom rules above has yet to be verified.The tagged build's session settings update preserves prior filesystem denials. The merge turns an unrestricted profile into root-write plus the previous denies. That explains the policy recorded in this chat. The resulting profile also lacks the grant that enables macOS platform read defaults.
Expected: apply Full access when permitted. If required restrictions prevent that mode, show the effective mode and preserve a working shell or reject the change with an actionable error. The root-deny merge also resembles #37562 on Linux.