You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: chmod is accepted but not enforced, and seeded files can't be made read-only #2387
I'm using bashkit as the tool surface for an LLM agent. The VFS holds a read-only projection of a document corpus — the model searches and reads it, then cites what it found. Nothing running inside the sandbox should be able to rewrite those files.
I can't find a way to enforce that from Python. chmod is accepted but doesn't stop a write:
Thanks for reporting this. There is a gap: Python cannot currently mark an arbitrary in-memory filesystem mount read-only while leaving the rest of the sandbox writable. We'll add per-mount read-only support and cover both Python and Node.
For an entirely read-only sandbox, current Python supports this (verified on 0.17.1):
Reads work; filesystem mutations are denied, including writes to /tmp. This is an option for the search/read/cite workflow if writable scratch space is unnecessary.
We are not planning full POSIX chmod permission enforcement for this change. VFS mode bits remain metadata; read-only mounts provide host-enforced protection that sandbox code cannot undo with chmod.
Activity
chaliy commentedon Sep 8, 2026
Thanks for reporting this. There is a gap: Python cannot currently mark an arbitrary in-memory filesystem mount read-only while leaving the rest of the sandbox writable. We'll add per-mount read-only support and cover both Python and Node.
For an entirely read-only sandbox, current Python supports this (verified on 0.17.1):
Reads work; filesystem mutations are denied, including writes to
/tmp. This is an option for the search/read/cite workflow if writable scratch space is unnecessary.We are not planning full POSIX
chmodpermission enforcement for this change. VFS mode bits remain metadata; read-only mounts provide host-enforced protection that sandbox code cannot undo withchmod.