You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugSomething isn't workingregressionBehaviors that worked in previous versions but were broken due to an updatesandboxIssues related to permissions or sandboxing
Additional signal from a separate Linux repro that appears to be the same regression family.
I opened #16790 with a more specific failure mode.
What is new in that report:
same machine / same repo / same day
working under 0.117.0
failing under 0.118.0
approval_policy:"on-request" in both cases
plan_type:"pro" in both cases
failing session does not just prompt on writes; even basic sandboxed reads fail before command execution
Exact stderr from the failing 0.118.0 sandbox bootstrap:
bwrap: Can't create file at /root/kiara/.codex: Permission denied
This affects even:
pwd
rg --files ...
wc -l ...
id
env
Extra host context from the repro:
/root is 701 root:root
/root/kiara is 755 kiara:kiara
/root/kiara/.codex does not exist outside the sandbox when inspected
So this looks broader than an apply_patch-only problem. In this repro, 0.118.0 appears to fail in sandbox bootstrap itself when touching first-time project-local .codex, and the approval prompts are downstream of that failure.
Experiencing a similar regression where all edits fail in sandbox. Not sure if the root cause is the same but I also experienced this as a regression upgrading to v118.0
Additional reproduction/details from another Linux 0.118.0 setup:
Environment
Codex CLI: 0.118.0
Platform: Linux x86_64
Sandbox mode: workspace-write
Approval policy shown in session metadata: on-request
Observed behavior
In workspace-write, normal file edits trigger the TUI prompt "Would you like to make the following edits?" / patch approval repeatedly.
This still happens after using /approvals and switching back to default.
The same workflow works under full access, which strongly suggests the problem is isolated to the restricted/sandboxed approval path rather than repo permissions or the patch itself.
Important distinction
I saw two related symptoms:
Earlier sessions had real sandbox write failures (EROFS / Read-only file system) for paths like ~/.codex, ~/.npm, and some .git lock/config writes when writable roots were too narrow.
After widening writable roots and restarting, normal apply_patch-style edits still triggered patch approval in workspace-write even without a corresponding sandbox write error.
Evidence from local logs
Session metadata showed approval_policy = on-request and workspace-write sandbox.
A normal apply_patch edit was attempted, and the log then showed op.dispatch.patch_approval without an ERROR codex_core::tools::router sandbox failure for that edit.
/approvals -> default did not change the behavior.
danger-full-access/full access avoids the problem.
This makes it look like there may be both:
a 0.118.0 sandbox writable-roots regression on Linux, and
a separate or related regression in workspace-write + on-request edit approvals / patch_approval routing.
If useful I can provide the exact log excerpts showing apply_patch followed by patch_approval without a write error.
Also happens for me n 0.120.0. Edits with sed work. bwrap itself also only worked after using the solution described here: #14919 (comment)
Same here: codex-cli 0.120.0
I even tried to add a custom .codex/config.toml in the repository with an explicit writable root, still fails.
Summary from codex itself:
- Expected behavior: apply_patch should edit the file directly with no approval prompt,
because the file is inside an allowed writable root and no escalated command was requested.
- Actual behavior: Codex UI prompted: “Would you like to make the following edits? Reason:
command failed; retry without sandbox?” and offered approval options. The patch was then
aborted and not applied.
- Why this is unexpected: apply_patch is not a shell command that should need unsandboxed
retry, and edits to the same repo were already allowed earlier in the session.
Relevant:
Reacted by Stas (Stanislav) Korzovsky and Elsa Granger
I keep peeking at later versions hoping things are de-sucked and keep having to npm install -g @openai/[email protected] and then tell codex to ignore updates until the next version...
In the last several releases, 0.114.0 and 0.117.0 were the only two that were usable on Ubuntu 24.
To make this setting survive reboots, run the following: echo 'kernel.apparmor_restrict_unprivileged_userns=0' | sudo tee /etc/sysctl.d/60-apparmor-namespace.conf
And then run the following to apply: sudo sysctl --system
Additional 0.121.0 repro that appears to be in the same apply_patch / misleading sandbox-retry family.
Environment
Codex CLI: 0.121.0
Model shown by /status: gpt-5.4
Provider shown by /status: Oracle Code Assist
Approval policy: on-request
Sandbox mode: workspace-write
Later /status also showed: workspace-write with network access
What happened
In a normal workspace repo, Codex attempted a trivial apply_patch edit to: env-config/src/main/java/com/oracle/helidon/oci/envconfig/OciEnvLocationOverrideBlueprint.java
Intended change:
Optional<String> faultDomain();
-> Optional<Integer> faultDomain();
The TUI prompted:
Would you like to make the following edits?
Reason: command failed; retry without sandbox?
After the prompt, the target file remained unchanged and git diff -- env-config/src/main/java/com/oracle/helidon/oci/envconfig/OciEnvLocationOverrideBlueprint.java was empty.
Evidence from persisted session logs
Session ID: 019d964e-7b44-7f52-8126-012751b2835b
Main JSONL: ~/.codex/sessions/2026/04/16/rollout-2026-04-16T14-40-19-019d964e-7b44-7f52-8126-012751b2835b.jsonl
First attempt turn: 019d9656-5ca0-7993-a55d-c90780e6ee76
shows custom_tool_call for apply_patch
then custom_tool_call_output = aborted by user after 248.2s
shows more reads/searches and then another custom_tool_call for apply_patch
the persisted log ends at the patch request
I could not find a matching failed exec_command_end for that resumed turn that would explain the sandbox retry prompt
Why this looks useful
This did not look like a normal writable-roots problem.
The approval reason shown to the user was command failed; retry without sandbox?, but in the saved JSONL trace for the resumed turn there was no corresponding failed shell command persisted.
That makes this look like either:
an apply_patch / patch-approval routing failure, or
a stale/generic error reason being surfaced by the TUI for a broader class of failures.
This may be the same regression family as earlier apply_patch approval-loop reports, but the missing failed-command evidence seems worth capturing explicitly.
Same issue on NixOS 25.11 and codex 0.121.0. Resolved by setting sandbox_workspace_write.network_access = false or removing this setting entirely. Diagnostic from codex:
the internal Linux sandbox helper panics because the legacy sandbox policy says network_access = true while the split policy for apply_patch derives network_access = false.
bugSomething isn't workingregressionBehaviors that worked in previous versions but were broken due to an updatesandboxIssues related to permissions or sandboxing
Activity
github-actions commentedon Apr 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
apply_patchenters patch-approval loop (command failed; retry without sandbox?) while 0.117.0 works #16407 as a duplicate of this issuejasny commentedon Apr 1, 2026
This seems to be
apply_patchspecific. Write files viasedor other shell commands work normally. For more info see #16407tomas-langer commentedon Apr 1, 2026
I see exactly the same regression after upgrade to 0.118.0
jabowery commentedon Apr 4, 2026
work around on Ubuntu with apparmor:
Manerba commentedon Apr 4, 2026
Additional signal from a separate Linux repro that appears to be the same regression family.
I opened #16790 with a more specific failure mode.
What is new in that report:
0.117.00.118.0approval_policy:"on-request"in both casesplan_type:"pro"in both casesExact stderr from the failing
0.118.0sandbox bootstrap:This affects even:
pwdrg --files ...wc -l ...idenvExtra host context from the repro:
/rootis701 root:root/root/kiarais755 kiara:kiara/root/kiara/.codexdoes not exist outside the sandbox when inspectedSo this looks broader than an
apply_patch-only problem. In this repro,0.118.0appears to fail in sandbox bootstrap itself when touching first-time project-local.codex, and the approval prompts are downstream of that failure.Issue with details: #16790
scharalambous3 commentedon Apr 4, 2026
Experiencing a similar regression where all edits fail in sandbox. Not sure if the root cause is the same but I also experienced this as a regression upgrading to v118.0
TheEnolaGay commentedon Apr 4, 2026
Additional reproduction/details from another Linux 0.118.0 setup:
Environment
Observed behavior
Important distinction
Evidence from local logs
This makes it look like there may be both:
If useful I can provide the exact log excerpts showing apply_patch followed by patch_approval without a write error.
smerrill commentedon Apr 8, 2026
Confirming this regression has come back on Ubuntu 24.04.
ghosty141 commentedon Apr 13, 2026
Also happens for me n 0.120.0. Edits with sed work. bwrap itself also only worked after using the solution described here: #14919 (comment)
tomas-langer commentedon Apr 13, 2026
Same here:
codex-cli 0.120.0I even tried to add a custom
.codex/config.tomlin the repository with an explicit writable root, still fails.Summary from codex itself:
Relevant:

slumtrimpet commentedon Apr 13, 2026
I keep peeking at later versions hoping things are de-sucked and keep having to
npm install -g @openai/[email protected]and then tell codex to ignore updates until the next version...In the last several releases, 0.114.0 and 0.117.0 were the only two that were usable on Ubuntu 24.
luispabon commentedon Apr 14, 2026
Confirmed on Ubuntu 25.10 and v0.120.0
staskorz commentedon Apr 16, 2026
Running this resolved the issue for me:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0Source: Codex Docs (Sandbox)
Update:
To make this setting survive reboots, run the following:
echo 'kernel.apparmor_restrict_unprivileged_userns=0' | sudo tee /etc/sysctl.d/60-apparmor-namespace.confAnd then run the following to apply:
sudo sysctl --systemdanielkec commentedon Apr 16, 2026
Additional 0.121.0 repro that appears to be in the same
apply_patch/ misleading sandbox-retry family.Environment
0.121.0/status:gpt-5.4/status: Oracle Code Assiston-requestworkspace-write/statusalso showed:workspace-write with network accessWhat happened
apply_patchedit to:env-config/src/main/java/com/oracle/helidon/oci/envconfig/OciEnvLocationOverrideBlueprint.javaOptional<String> faultDomain();Optional<Integer> faultDomain();git diff -- env-config/src/main/java/com/oracle/helidon/oci/envconfig/OciEnvLocationOverrideBlueprint.javawas empty.Evidence from persisted session logs
019d964e-7b44-7f52-8126-012751b2835b~/.codex/sessions/2026/04/16/rollout-2026-04-16T14-40-19-019d964e-7b44-7f52-8126-012751b2835b.jsonl019d9656-5ca0-7993-a55d-c90780e6ee76custom_tool_callforapply_patchcustom_tool_call_output=aborted by user after 248.2s019d9662-5eea-79e2-bed4-63494ed7890dcustom_tool_callforapply_patchexec_command_endfor that resumed turn that would explain the sandbox retry promptWhy this looks useful
command failed; retry without sandbox?, but in the saved JSONL trace for the resumed turn there was no corresponding failed shell command persisted.apply_patch/ patch-approval routing failure, orThis may be the same regression family as earlier
apply_patchapproval-loop reports, but the missing failed-command evidence seems worth capturing explicitly.fjolne commentedon Apr 19, 2026
Same issue on NixOS 25.11 and codex 0.121.0. Resolved by setting
sandbox_workspace_write.network_access = falseor removing this setting entirely. Diagnostic from codex:viyatb-oai commentedon Apr 21, 2026
this should be fixed in
0.122.0! please let us know if you still it.algogrit commentedon Jun 2, 2026
Still facing issues in Ubuntu 24.04 LTS using codex-cli 0.136.0.