Skip to content

Symlinked .codex breaks the entire macOS sandbox in rust-v0.149.0 #39874

Open

Description

@jyxjjj

What version of the Codex App are you using (From “About Codex” dialog)?

26.818.31338

What subscription do you have?

Pro 200 for OSS

What platform is your computer?

macOS 26.6.2

What issue are you seeing?

rust-v0.149.0 introduced a regression for users who symlink ~/.codex/visualizations (for example, to a RAM-backed or temporary filesystem).

PR #39599 now rejects any writable root containing a nested symlink component. Since Codex automatically adds .codex/visualizations/... as a writable root, a symlink at ~/.codex/visualizations causes Seatbelt preparation to fail entirely, even when the visualization functionality is not being used.

Would it be possible to address this in one of these ways?

Do not add .codex/visualizations/... to writable roots when the visualization/plugin functionality is disabled or unused.
Allow configuring the visualization output directory explicitly.
For Codex-managed auxiliary writable roots, resolve the symlink before sandbox creation and authorize the resolved target, while preserving the security guarantees introduced by #39599.

The important part is that an optional Codex-managed output directory should not make the entire sandbox unusable merely because that directory is symlinked.

A common use case is intentionally redirecting ephemeral visualization output to RAM-backed storage.

What steps can reproduce the bug?

https://github.com/jyxjjj/jyxjjj/blob/9da79012b598a15f1a540cdd8bddad6ff1e56b62/zshrc.d/23.functions-devices.sh#L50

What is the expected behavior?

No response

Additional information

ls -al:

lrwxr-xr-x@   1 [REDACTED]  staff    30B Aug 13 14:48 visualizations -> /Volumes/TMP/Codex/visualizations

Temp fix:

rm ~/.codex/visualizations
mkdir -p ~/.codex/visualizations

Activity

  1. added
    app
    on Aug 21, 2026
  2. added
    bug
    sandbox
    on Aug 21, 2026
  3. xMythicx commented on Aug 21, 2026

    @xMythicx

    +1 in hopes of a patch, Im generally ok with added security but not to the detriment of loosing all sessions and work progress. Perhaps there is a better migration here that supports the change while keeping session data available post update. This one is defiantly impacting me as well on Mac OS. Can this be fixed in a patch? The new build has broken all previous session history leaving codex chat unusable. With error :

    Fatal error: Session data under .codex/sessions looks corrupt or unreadable. Clearing the sessions directory may help (this will remove saved threads). (underlying error: failed to load AGENTS.md instructions for environment local: failed to prepare fs sandbox: failed to prepare Seatbelt sandbox: writable root .agents contains symlink component {redacted} ; symlinked writable roots are not supported)

  4. Dmitryshock commented on Sep 17, 2026

    @Dmitryshock

    Regression still present in 26.911.61220 / codex-cli 0.155.0: computer-use crashes even with the symlink opt-out enabled

    I can confirm that this regression is still present in the current macOS desktop build, and it completely prevents the integrated computer-use/browser runtime from starting.

    Environment

    • macOS 26.6.2 (25G83), Apple Silicon
    • ChatGPT/Codex desktop 26.911.61220 (build 9647)
    • Bundled codex-cli 0.155.0-alpha.2.6
    • The problem began immediately after updating the desktop app. The same external-storage configuration worked reliably before the update.

    Storage setup

    Codex task/session data is intentionally stored on a permanently attached external SSD because active rollouts alone currently occupy about 20.20 GB (codex doctor). Moving the data back to the internal disk is not a viable workaround.

    ~/.codex itself is a normal directory. Large state subdirectories are symlinked to the external Codex runtime, including:

    ~/.codex/visualizations -> /Volumes/<external-ssd>/CodexRuntime/home/.codex/visualizations
    

    The documented opt-out suggested by the runtime error is enabled at the top level of the active config:

    allow_symlinked_codex_home = true
    sqlite_home = "/Volumes/<external-ssd>/CodexRuntime/home/.codex"

    For completeness, the same opt-out was also added to the mirrored config on the external runtime. The desktop app was fully quit and restarted afterward.

    codex --strict-config doctor --summary reports:

    Configuration
      [ok] config       loaded
    

    So the option is recognized and the config parses successfully.

    Reproduction

    1. Start the updated desktop app with the storage arrangement above.
    2. Open an existing projectless Codex task.
    3. Invoke the first unified computer-use call:
    await cua.getState();
    1. The trusted Node process exits before returning any browser or UI state.

    The first attempt may report:

    trusted Node process exited unexpectedly; kernel reset, rerun your request
    

    The next attempt consistently exposes the underlying failure:

    Error: writable root /Users/<user>/.codex/visualizations/<date>/<thread-id>
    contains symlink component /Users/<user>/.codex/visualizations;
    symlinked writable roots are not supported.
    
    If this writable root is at or beneath CODEX_HOME and you trust its symlink
    targets, set allow_symlinked_codex_home = true at the top level of
    $CODEX_HOME/config.toml, then restart Codex or its executor.
    

    That is already the exact configuration in use, but the computer-use runtime still rejects the path.

    Actual impact

    • The integrated browser/computer-use runtime is completely unavailable.
    • It fails on initialization, even before any website is opened.
    • Core Codex and shell tools still work, so this appears specific to the trusted Node/computer-use sandbox setup.
    • A fallback that controls the user's normal Chrome session is disruptive and is not an acceptable replacement for the isolated integrated browser.

    Expected behavior

    At least one of the following should happen:

    1. allow_symlinked_codex_home = true should authorize Codex-managed writable roots below ~/.codex, including visualizations.
    2. The desktop app should resolve the managed visualization directory and pass its physical /Volumes/... path to the sandbox.
    3. The visualization/computer-use storage root should be explicitly configurable so large Codex data can remain on external storage.

    The fix must not require moving multi-gigabyte task/session data back to the internal disk.

    Possible boundary issue

    This looks as though the computer-use trusted Node runner either validates the injected visualization writable root before applying the loaded opt-out, or classifies it as a generic workspace root rather than a Codex-managed root. The CLI accepts the configuration, but the computer-use runner does not honor it.

    This is a post-update regression with a previously working, permanently attached external volume—not a transient missing-volume failure.

  5. jyxjjj commented on Sep 23, 2026

    @jyxjjj
    Author

    There is an additional impact of the same symlink restriction: symlinks can also make Codex plugins unusable.

    In rust-v0.155.0-alpha.9.2, managed marketplace detection relies on lexical path matching:

    https://github.com/openai/codex/blob/rust-v0.155.0-alpha.9.2/codex-rs/core-plugins/src/marketplace_policy.rs#L500-L544

    is_expected_managed_path() only accepts exact path equality, with special-case normalization for /private/var vs /var on macOS (and Windows device paths). It does not resolve/canonicalize symlinks.

    This matters because managed_marketplace_config_name() / managed_local_marketplace_name() use that check to determine whether a local marketplace is one of Codex's managed marketplaces. If the same managed marketplace is reached through a symlink, it loses that managed provenance.

    The consequence is not merely cosmetic: for reserved managed marketplace names, allowed_configured_marketplace_names_with_policy() fails closed, and policy_filtered_plugin_config() then removes both the marketplace and plugins belonging to it from the effective configuration. In other words, a symlink can cause an otherwise valid installed plugin to disappear from the usable plugin configuration entirely.

    There is even an explicit test named symlinked_marketplaces_cannot_borrow_managed_provenance, so this behavior appears intentional at the policy layer.

    This broadens the impact described in #39874: symlink handling is no longer only capable of breaking sandbox initialization / visualizations; it can also prevent the plugin system from functioning for users whose Codex-managed data paths are redirected with symlinks.

    It would be useful to distinguish between an untrusted marketplace attempting to spoof a managed path and a Codex-managed path whose trusted parent/component is intentionally symlinked. Resolving the managed path and validating the resolved target (rather than rejecting the alias purely because the lexical paths differ) could preserve the provenance/security check without making symlink-based Codex storage layouts incompatible with plugins.

    Error Msg:

    marketplace openai-bundled is reserved and cannot be added from this source
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions