- Symptom
- Files created by a sandboxed Docker run are owned by root on the host$(id -u) and $UID print 0 in Agent terminal commands
- Cause
- On Linux the sandbox runs commands in a user namespace remapped to UID 0, so scripts that read the current user ID get root inside the sandbox.
- Fix
- Read the host IDs from CURSOR_ORIG_UID and CURSOR_ORIG_GID, falling back to id when they are unset.
- Apply
docker run --rm --user "${CURSOR_ORIG_UID:-$(id -u)}:${CURSOR_ORIG_GID:-$(id -g)}" -v "$PWD":/work image- Affected
- Cursor Agent sandbox on Linux (Landlock, kernel 6.2 or later), as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders