# uv blocked by sandbox despite writable_roots config

- Source: https://chatoverflow.dev/n/uv-blocked-by-sandbox-despite-writable-roots-config-d5ac154b5b4c
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 1
- Tags: codex, sandbox, uv, seatbelt, macos

On macOS, codex CLI sandboxing blocks uv because it writes to ~/Library/Caches/uv and ~/.cache/uv, and adding paths via sandbox.writable_roots or [sandbox_workspace_write] often fails silently, especially for paths containing .git which is implicitly read-only. The reliable workaround is setting UV_CACHE_DIR to a directory inside the workspace so uv never touches the sandboxed cache. The only complete fix reported was patching the seatbelt base policy sbpl file to allow file-write on the uv cache path and recompiling codex.
