macOS: basic Git writes remain blocked despite explicit authorization; permission controls provide no usable resolution
What happened?
Codex can edit ordinary files in my project, but cannot perform basic local Git operations—even after I explicitly authorize them and attempt to resolve the permission problem.
Initially, git init -b main failed. I had to initialize the repository myself in my terminal. Codex could then read the repository status, but git add still failed:
fatal: Unable to create '/path/to/project/.git/index.lock': Operation not permitted
Repeated retries after permission changes produced the same error.
Environment
- macOS, Apple Silicon
- Codex Desktop
- Paid subscription
Checks already performed
- The execution user owns the project and
.gitdirectories. - Owner write permissions are present.
- No additional ACL or immutable flag was found.
- No existing
index.lockfile was found. - Git correctly recognizes the repository.
- macOS Full Disk Access is enabled.
- Ordinary project files remain writable.
- The agent reports that its effective session permissions still mark
.gitas read-only and do not allow sandbox escalation for the operation.
I understand that macOS Full Disk Access and Codex sandbox permissions are separate. The problem is that the product does not provide a clear, effective way to resolve this mismatch within the workflow.
Expected behavior
Explicitly authorized local staging and commits should have a working, narrowly scoped permission or approval path.
If a restriction prevents these operations, the application should clearly identify the effective restriction, where it comes from, and which setting can actually change it. It should not leave the user and agent repeating failed commands and ineffective permission changes.
Impact and paid-product feedback
This is not an obscure edge case. Staging and committing local changes are basic operations for a coding assistant.
Previous Codex sessions handled these operations for me. I cannot establish a specific version regression, but my experience is that a previously routine workflow has become substantially more frustrating and less useful.
I have already spent far too much time authorizing the same action, troubleshooting permissions, and doing work manually that I expected a paid coding agent to handle.
If updates keep making ordinary workflows harder, and the eventual answer is that I must personally perform every blocked step, why should I continue paying for Codex?
Security controls need to be understandable and operable. A coding agent that can edit a project but cannot complete explicitly authorized basic version-control work, with no usable resolution path, is failing at a core part of its job.
Please investigate both the Git write restriction and the gap between user-facing permission settings and the permissions actually delivered to the agent.
Related reports
- #15505
- #22553
These appear related; I am not claiming that this case has the same confirmed root cause.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #53929
Powered by Codex Action
I reviewed #53929. It is related, but linking it does not resolve the problem reported here, and it is still open with no comments providing a workaround.
There is a material difference:
- #53929 concerns Windows, where approving execution outside the sandbox makes Git operations succeed, but approval prompts recur.
- This report concerns macOS Desktop sessions where Git writes are blocked and the effective permissions reported to the agent explicitly disallow sandbox escalation. In that state, there is no usable approval path for the user to take.
Both produce an index.lock permission error, but that alone does not establish the same root cause or make the Windows approval workaround usable here.
Please provide an actionable answer for the macOS Desktop workflow:
- Which exact setting controls the effective
.gitwrite restriction and whether escalation is available? - Where can a user change it in the Desktop app, and does the change require a new session or reopening the repository?
- How can the user verify that the requested permission actually reached the running session?
- If the app cannot provide that approval path, is this a confirmed limitation or bug, and where is the fix being tracked?
I am asking for narrowly scoped authorization to stage and commit local changes in my own repository. No push, deletion, or history rewriting is involved.
This has already interrupted real work and required repeated manual intervention. A duplicate suggestion without a working resolution leaves the paid product just as unusable for this workflow. If this is consolidated into another issue, please identify where the macOS-specific lack of an approval path is being tracked; simply pointing to an unresolved Windows report does not answer it.
Update — October 19: the approval path itself is now failing, so retrying does not unblock this workflow.
The task was to commit an already-staged local baseline and create an isolated worktree for a spreadsheet preparation task. No push, deletion, or history rewriting was requested.
Observed sequence:
- A normal
git commitfailed withfatal: Unable to create '/path/to/project/.git/index.lock': Operation not permitted. - In this session, the agent does have an escalation mechanism and submitted the same command with
sandbox_permissions: "require_escalated"and a narrowly scopedgit commitapproval request. - The tool immediately returned
aborted by user after 0.3s. - The conversation then showed:
That approval request is no longer active. Please retry the action if you still want ChatGPT to continue with it. - I explicitly asked the agent to continue. It submitted the approval request again, which returned
aborted by user after 0.4s, followed by the same expired-approval message.
The tool's cancellation label is an observation, not a confirmed diagnosis of who or what cancelled the request. From the user side, the repeated outcome is an unusable approval loop. There is no successful execution or commit.
This updates the earlier report: escalation is exposed in the current session, but it still does not provide a usable resolution. Please investigate the approval request lifecycle, immediate cancellation/expiration, and the mismatch between user intent to continue and the reported cancellation. The available evidence does not establish whether this is a UI, orchestration, or permissions-backend fault.
This has again stopped actual work. I am paying for an agent to complete routine tasks, yet basic local version control repeatedly turns into permission troubleshooting and manual intervention. An approval control that expires before it can resolve the action is not an actionable workaround. Please provide a concrete fix or a tracked investigation of this failure, rather than another retry instruction or a link to an unresolved issue.
Also hitting this, where it never happened before, so must be in one of the latest updates of the client.
Codex is giving "git write is restricted" even though full access is enabled.
macOS app version 26.1023.50603 User-authorized development tasks are being interrupted by session restrictions, without a usable approval or recovery flow. Observed problems
- Git staging and commits are blocked. Read-only Git commands work, but git add fails with “Operation not permitted” when creating its index lock. Consequently, the agent cannot commit changes despite explicit user authorization.
- Local preview-server startup is blocked. Attempting to start the visual review server failed with a socket-bind permission error. Once the user started the server manually, the in-app browser could access it. This suggests the restriction concerns starting the listener, rather than viewing the resulting page.
- The browser rejects direct local-file previews. Opening the generated review directly was also rejected, preventing that fallback when server startup failed.
- There is no available escalation path. The session configuration disables sandbox permission escalation, leaving the agent unable to request approval for these otherwise authorized operations.
Sometimes it works sometimes it doesn't. I'm so confused with codex permissions and auto-approve 🤯
codex-cli 0.166.0
I've experienced same session denying git commit even in Ask for approve mode, then after restart (no config changes) the same resumed session was fine with committing the file in Auto approve mode. 🤷🏼
This needs to be fixed ASAP. Codex cannot perform any local operations on my mac. This critical bug sitting for 2 weeks is unacceptable.
I had this permissions bug for a week, then it was fixed and now it's back again after the 26.1117.41037 update