codex - 💡(How to fix) Fix [sandbox_workspace_write].network_access = true causes fs sandbox helper write failures on Linux [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18337Fetched 2026-04-18 05:55:42
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
1
Author
Participants
Timeline (top)
labeled ×4unlabeled ×2

Error Message

Observed error: 2026-04-17T13:18:54.904978Z ERROR codex_core::tools::router: error={"output":"Failed to read file to update /home/<redacted>/Code/test/ReadMe.md: fs sandbox helper failed with status exit status: 101: thread 'main' (1283634)panicked at linux-sandbox/src/linux_run_main.rs:130:27:legacy sandbox policy must match split sandbox policies: provided=WorkspaceWrite { writable_roots:[AbsolutePathBuf("/home/<redacted>/.codex/memories")], read_only_access: FullAccess, network_access: true,exclude_tmpdir_env_var: false, exclude_slash_tmp: false }, derived=WorkspaceWrite { writable_roots:[AbsolutePathBuf("/home/<redacted>/.codex/memories")], read_only_access: FullAccess, network_access: false,exclude_tmpdir_env_var: false, exclude_slash_tmp: false }note: run with RUST_BACKTRACE=1 environment variable to display a backtrace","metadata":{"exit_code":1,"duration_seconds":0.0}}

Root Cause

I can reproduce this with codex exec --full-auto: the run starts normally, but when Codex tries to update a file through the fs sandbox helper, it fails with a panic caused by a mismatch between the legacy sandbox policy and the split filesystem/network sandbox policies.

Code Example

[sandbox_workspace_write]
network_access = true

---

2026-04-17T13:18:54.904978Z ERROR codex_core::tools::router: error={"output":"Failed to read file to update /home/<redacted>/Code/test/ReadMe.md: fs sandbox helper failed with status exit status: 101: thread 'main' (1283634)panicked at linux-sandbox/src/linux_run_main.rs:130:27:legacy sandbox policy must match split sandbox policies: provided=WorkspaceWrite { writable_roots:[AbsolutePathBuf(\"/home/<redacted>/.codex/memories\")], read_only_access: FullAccess, network_access: true,exclude_tmpdir_env_var: false, exclude_slash_tmp: false }, derived=WorkspaceWrite { writable_roots:[AbsolutePathBuf(\"/home/<redacted>/.codex/memories\")], read_only_access: FullAccess, network_access: false,exclude_tmpdir_env_var: false, exclude_slash_tmp: false }note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace","metadata":{"exit_code":1,"duration_seconds":0.0}}

---

[sandbox_workspace_write]
network_access = true

---

codex exec "Please modify the content in ReadMe.md to xxxxx" --skip-git-repo-check --full-auto
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.121.0

What subscription do you have?

plus

Which model were you using?

gpt-5.4

What platform is your computer?

Linux 6.8.0-78-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

When using the legacy permissions model with:

[sandbox_workspace_write]
network_access = true

sandboxed file writes/edits can fail on Linux.

I can reproduce this with codex exec --full-auto: the run starts normally, but when Codex tries to update a file through the fs sandbox helper, it fails with a panic caused by a mismatch between the legacy sandbox policy and the split filesystem/network sandbox policies.

Observed error:

2026-04-17T13:18:54.904978Z ERROR codex_core::tools::router: error={"output":"Failed to read file to update /home/<redacted>/Code/test/ReadMe.md: fs sandbox helper failed with status exit status: 101: thread 'main' (1283634)panicked at linux-sandbox/src/linux_run_main.rs:130:27:legacy sandbox policy must match split sandbox policies: provided=WorkspaceWrite { writable_roots:[AbsolutePathBuf(\"/home/<redacted>/.codex/memories\")], read_only_access: FullAccess, network_access: true,exclude_tmpdir_env_var: false, exclude_slash_tmp: false }, derived=WorkspaceWrite { writable_roots:[AbsolutePathBuf(\"/home/<redacted>/.codex/memories\")], read_only_access: FullAccess, network_access: false,exclude_tmpdir_env_var: false, exclude_slash_tmp: false }note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace","metadata":{"exit_code":1,"duration_seconds":0.0}}

What steps can reproduce the bug?

  1. Put the following in ~/.codex/config.toml:
[sandbox_workspace_write]
network_access = true
  1. In a directory containing a ReadMe.md, run:
codex exec "Please modify the content in ReadMe.md to xxxxx" --skip-git-repo-check --full-auto
  1. Observe that the run fails partway through when Codex attempts to read/update the file via the fs sandbox helper.

What is the expected behavior?

The legacy permissions model should continue to work correctly on Linux when [sandbox_workspace_write].network_access = true is set, and sandboxed file writes should not panic.

Additional information

From Codex digging the source code:

I inspected the source at commit d0047de7c, and this looks like a legacy-vs-split-policy mismatch in the fs sandbox helper path.

Relevant code refs:

  • Legacy [sandbox_workspace_write] config is still parsed into a legacy SandboxPolicy::WorkspaceWrite in codex-rs/ config/src/config_toml.rs:634-648.
  • In the normal config-loading path, the split policies are derived from that legacy policy:
    • file_system_sandbox_policy = FileSystemSandboxPolicy::from_legacy_sandbox_policy(...)
    • network_sandbox_policy = NetworkSandboxPolicy::from(&sandbox_policy)
    • see codex-rs/core/src/config/mod.rs:1660-1685
  • The Linux sandbox helper explicitly checks that the provided legacy policy and the split policies are semantically equivalent, and errors if they differ:
    • mismatch handling: codex-rs/linux-sandbox/src/linux_run_main.rs:292-319
    • semantic comparison includes network policy equality: codex-rs/linux-sandbox/src/linux_run_main.rs:350-360
  • In the fs sandbox helper path, the network split policy appears to be forced to Restricted even when the legacy sandbox policy still has network_access = true:
    • codex-rs/exec-server/src/fs_sandbox.rs:51-59
  • That seems to explain the panic: the helper receives:
    • a legacy WorkspaceWrite { network_access: true, ... }
    • but split policies whose derived legacy form becomes WorkspaceWrite { network_access: false, ... }

There also seems to be a newer permissions/profile model, but I could not find clear public migration documentation for replacing the legacy [sandbox_workspace_write] config.

From reading the source, the new profile-based model seems to use:

  • default_permissions = "..."
  • [permissions.<profile>.filesystem]
  • [permissions.<profile>.network]

Example test config:

  • codex-rs/core/src/config/config_tests.rs:403-420

Network enablement in the new profile model appears to come from:

  • codex-rs/core/src/config/permissions.rs:137-145

However, I could not find migration docs that explain:

  • how to translate legacy [sandbox_workspace_write]
  • what the equivalent of legacy writable_roots is
  • whether the new model is intended to fully replace workspace-write + network_access + extra writable_roots

In fact, from the current implementation it looks like profile-based writes outside the workspace root are explicitly rejected:

  • implementation: codex-rs/protocol/src/permissions.rs:881-885
  • test coverage: codex-rs/core/src/config/config_tests.rs:790-823

So it is currently unclear whether there is any equivalent in the new model for legacy extra writable_roots.

extent analysis

TL;DR

The issue can be fixed by updating the configuration to use the new profile-based model instead of the legacy permissions model.

Guidance

  • The legacy permissions model is causing a mismatch between the legacy sandbox policy and the split filesystem/network sandbox policies, leading to a panic when trying to update a file.
  • To fix this, you can try updating the configuration to use the new profile-based model, which seems to be the intended replacement for the legacy model.
  • You will need to translate the legacy [sandbox_workspace_write] config to the new model, which involves setting default_permissions and configuring filesystem and network permissions for a specific profile.
  • The new model appears to have different semantics for writable roots and network access, so you may need to adjust your configuration accordingly.

Example

default_permissions = "..."
[permissions.my_profile.filesystem]
writable_roots = ["/home/<redacted>/.codex/memories"]
[permissions.my_profile.network]
access = "allow"

Note that this is just an example and you will need to consult the documentation and source code to determine the correct configuration for your specific use case.

Notes

  • The migration from the legacy model to the new profile-based model is not well-documented, so you may need to experiment and consult the source code to get it working correctly.
  • The new model appears to have some limitations, such as rejecting writes outside the workspace root, so you may need to adjust your workflow accordingly.

Recommendation

Apply workaround: Update the configuration to use the new profile-based model, as the legacy model appears to be deprecated and is causing issues. This will require some experimentation and consultation of the source code, but it seems to be the intended solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix [sandbox_workspace_write].network_access = true causes fs sandbox helper write failures on Linux [1 participants]