OpenAI Codex · tool · fg-0505

git commit fails inside Codex's workspace-write sandbox because .git is read-only

If you see git commit, git checkout, or git stash fail with a permission error inside Codex, the cause and the fix for OpenAI Codex are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
git commit, git checkout, or git stash fail with a permission error inside CodexGit writes worked on Linux before a Codex update and fail now
Cause
workspace-write keeps .git, a worktree's resolved gitdir, .agents, .codex, and .aws read-only even inside writable roots. Linux was brought in line with macOS, so git metadata writes that once worked there are now blocked.
Fix
Let Codex edit files and run git yourself, approve an escalation for the git command, or use danger-full-access only in an isolated environment.
Apply
codex --sandbox workspace-write --ask-for-approval on-request # approve the escalated git command when asked
Affected
Codex CLI workspace-write sandbox on macOS and Linux, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun