Need ability to whitelist ~/.cache in safe sandbox mode

Resolved 💬 4 comments Opened Aug 19, 2025 by alexchandel Closed Aug 19, 2025
💡 Likely answer: A maintainer (bolinfest, collaborator) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Need the ability to whitelist ~/.cache for tools like uv and pre-commit which hit it often and have issues and complications moving their cache locations.

Codex gets confused when it can't access ~/.cache and frequently doesn't recognize the errors uv throws because of this, and begins running unpredictable hacky commands. Thus it often fails to ask for approval. Just let us whitelist a folder for Codex when it's running in an otherwise safe sandbox mode.

Are you interested in implementing this feature?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

bolinfest collaborator · 1 year ago

Oops, this is not currently documented on https://github.com/openai/codex/blob/main/codex-rs/config.md#sandbox_mode, but you can do this in your config.toml to include additional writable folders:

sandbox_mode = "workspace-write"

[sandbox_workspace_write]
writable_roots = ["/Users/YOU/.cache"]
alexchandel · 1 year ago

Oh perfect! I can close, or hold off if you want to document it.

bolinfest collaborator · 1 year ago

Fixed: thanks for the report!

mishamsk · 11 months ago

@bolinfest it doesn't seem to work, at least with my setup and/or latest uv version. I outlined details in another open issue: https://github.com/openai/codex/issues/1457#issuecomment-3315374593