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
This is related to #7071 , see also my comment there.
There are read-only exceptions to a writable root (WritableRoot.read_only_subpaths, see protocol.rs). Currently this is hard-coded with: .git (or gitdir equivalent), .codex and .agents.
It would be nice to make this configurable, especially adding a config to make .git/gitdir writable. Otherwise the agent cannot do any git operations without escalation. It's very annoying to keep approving those operations and make it harder for agents to work autonomously.
The rules system works sometime, but the current pattern matching capability does not deal with shell wrapper very well.
I understand the security concern, but it is less applicable to Codex CLI. In most cases, the project directory is a local git copy of a remote repo. The remote repo has its own security policy to guard against dangerous operations (e.g. protected main, no force push, etc.).
Making this configurable under workspace_write would be the best solution.
Additional information
No response
Reacted by Sam Deane, acevif, SeongHoon Ryu, Jevin, mohit, Sari Sakse Dalum, Rhett Garber, distbit, lukts30, Marius Elvert and 4 more
It's not just that it is massively annoying to have to keep approving these operations (although it is!).
It is also a large security risk, since it trains the user to mindlessly approve. I just accidentally approved an operation on ~/.cache because it was interleaved with some other git changes and I was having to approve every one.
I'm using the Graphite CLI, which requires access to the .git directory. Since Codex doesn't currently allow that, I always have to use full-access mode. That feels unnecessarily risky.
Activity
github-actions commentedon Feb 19, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-]Allow writable `.git`/`gitdir` in CLI[/-][+]Allow writable `.git`/`gitdir`[/+]samdeane commentedon Feb 25, 2026
+1 on this change.
It's not just that it is massively annoying to have to keep approving these operations (although it is!).
It is also a large security risk, since it trains the user to mindlessly approve. I just accidentally approved an operation on ~/.cache because it was interleaved with some other git changes and I was having to approve every one.
ryush00 commentedon Mar 18, 2026
I'm using the Graphite CLI, which requires access to the
.gitdirectory. Since Codex doesn't currently allow that, I always have to use full-access mode. That feels unnecessarily risky.gyf1214 commentedon Mar 18, 2026
If you bother build from source (take ~2hrs, I have to do this anyway since the pre-built release does not work on my env)
I have a fork that simply bypass these "read-only exceptions" to a writable root: https://github.com/gyf1214/codex
Interestingly I use codex itself to periodically sync with latest release and do build for me.
Anyway, I really think this should be a configurable feature in the official release.