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
bug: SQLite-based agents fail in sandboxes because the default policy leaves /var/tmp unwritable #5958
I run coding agents such as Codex in OpenShell sandboxes. Codex 0.172 exits at startup in a sandbox with the default policy, because its SQLite state database can't create a temporary file. I need common agent CLIs to start under the default policy without per-image workarounds.
Problem Statement
The default policy makes /tmp read-write but leaves /var/tmp unwritable. With TMPDIR unset, SQLite on Linux chooses its temporary directory from SQLITE_TMPDIR, TMPDIR, /var/tmp, /usr/tmp and /tmp, in that order. Its check that a directory is writable doesn't account for Landlock, so it picks /var/tmp and then fails to open a file there with SQLITE_CANTOPEN (code 14).
Any workload that uses SQLite temporary files, or that otherwise writes to /var/tmp, fails the same way.
Impact / Why This Matters
Codex 0.172 stops at startup:
Error: failed to initialize sqlite state runtime under /sandbox/.codex: failed to
migrate state DB at /sandbox/.codex/state_5.sqlite: while executing migration 23:
error returned from database: (code: 14) unable to open database file
The cause isn't visible to the user: the error names the database under the writable home directory, not /var/tmp. The workaround is to export TMPDIR and SQLITE_TMPDIR pointing at a writable directory in every image or startup command, or to add /var/tmp to a custom policy.
Acceptance Criteria
Under the default policy, a workload that uses SQLite temporary files with TMPDIR unset works, for example Codex 0.172 starting in a sandbox.
The default policy page documents the behavior.
Reproduction Steps
Create a sandbox with the default image and policy:
Activity