0.118.0 sandbox write regression on Linux
Resolved 💬 17 comments Opened Apr 1, 2026 by CrypticError Closed Apr 21, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.118.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.4
What platform is your computer?
Linux 6.14.0-37-generic x86_64 x86_64
What terminal emulator and version are you using (if applicable)?
Ghostty
What issue are you seeing?
File write's don't work, prompting with
command failed; retry without sandbox?
This does not happen in the same setup under 0.117.0, which I have reverted back to
I am using the following settings in codex config
approval_policy = "on-request"
sandbox_mode = "workspace-write"
What steps can reproduce the bug?
Writing a file? Possibly only diff format, unsure
What is the expected behavior?
For the initial write to work within sandbox
Additional information
_No response_
17 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This seems to be
apply_patchspecific. Write files viasedor other shell commands work normally. For more info see #16407I see exactly the same regression after upgrade to 0.118.0
work around on Ubuntu with apparmor:
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
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
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.
Confirming this regression has come back on Ubuntu 24.04.
Also happens for me n 0.120.0. Edits with sed work. bwrap itself also only worked after using the solution described here: https://github.com/openai/codex/issues/14919#issuecomment-4223539341
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:
<img width="1125" height="545" alt="Image" src="https://github.com/user-attachments/assets/b575a2c3-ba00-41a5-9965-f2234dd071b8" />
I keep peeking at later versions hoping things are de-sucked and keep having to
npm install -g @openai/codex@0.117and 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.
Confirmed on Ubuntu 25.10 and v0.120.0
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 --systemAdditional 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.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:this should be fixed in
0.122.0! please let us know if you still it.Still facing issues in Ubuntu 24.04 LTS using codex-cli 0.136.0.