feat: allow sandbox to read/write some files/directories anywhere on the machine
Resolved 💬 7 comments Opened Apr 18, 2025 by jdemeulenaere Closed Aug 7, 2025
💡 Likely answer: A maintainer (fouad-openai, contributor)
responded on this thread — see the highlighted reply below.
The sandboxed mode currently fails to run gradle commands because it is not allowed to read the ~/.cache/ directory:
xargs: sysconf(_SC_ARG_MAX) failed
Exception in thread "main" java.io.FileNotFoundException:
/Users/jdemeulenaere/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1-bin.zip.lck (Operation not permitted)
at java.base/java.io.RandomAccessFile.open0(Native Method)
at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:366)
... (7 more lines)
It would be nice if we could give read or write access to some files when in sandboxed mode on macOS.
7 Comments
agreed! we should expand the list of "common roots" that are allowed for auto-approval.
Thank you for the feedback! Please try the latest version of Codex CLI, as we're actively addressing issues and improving the sandboxing capabilities. If the issue persists, feel free to let us know.
This persists. I cannot modify ~/.cache
I can't make codex use gradle.
The issue persists for me as well
Same here you guys! Cypress write cache in
~/.cache/Cypressand we can't write to it from our codebase sandbox!A list of directories in
config.tomlthat allows to write would really work!Are you guys able to implement that?
Since
v0.48.0:--add-dirto add an additional working directory.And then not sure exactly what version from, but maybe similar or earlier(?):
Edit: Seemingly
writable_rootshas been around for quite a while. Docs were added August 20th, which implies the feature may have existed even earlier than that:Edit 2: It looks like
writable_rootsmay have been first introduced in the following PR back on June 25th: