codex - 💡(How to fix) Fix Windows sandbox applies DENY ACLs to .git directories in writable_roots, breaking git commits [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18918Fetched 2026-04-22 07:50:50
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×2mentioned ×1subscribed ×1

Root Cause

Root Cause

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.122.0

What subscription do you have?

PRO

Which model were you using?

gpt-5.4

What platform is your computer?

Windows 11 PRO

What terminal emulator and version are you using (if applicable)?

Gitbash/Powershell

What issue are you seeing?

Summary

After updating to the version released ~2026-04-20, Codex applies DENY ACEs to .git directories inside any path listed in writable_roots, permanently breaking git commit (and any operation requiring .git/index.lock) for the sandboxed process.

Root Cause

PR #18443 changed sandbox ACL setup to expand USERPROFILE into its direct children rather than granting the root. For users whose repos live under a USERPROFILE child (e.g. C:\Users\me\OneDrive...), those repos are now in scope for sandbox ACL grants. The sandbox applies DENY ACEs to the repo's .git directory — presumably to protect git history — but those DENY ACEs are not cleaned up and persist after Codex exits, reapplied on every startup.

Observed Behavior

fatal: Unable to create '.../.git/index.lock': Permission denied

icacls .git shows explicit DENY ACEs for the sandbox SID:

.git S-1-5-21-<sandbox-domain>-<id>:(DENY)(W,D,Rc,DC) S-1-5-21-<sandbox-domain>-<id>:(OI)(CI)(IO)(DENY)(W,D,Rc,GW,DC)

  • The DENY SID is the Codex sandbox identity (different domain from the local machine SID)
  • Removing the ACEs manually with icacls /remove:d works temporarily
  • Codex reapplies the DENY ACEs on next startup
  • The user's own account (vasan) retains full control and is unaffected — only the sandboxed process is blocked

Environment

  • OS: Windows 11 Pro
  • Codex version: updated ~2026-04-20 (post-PR #18443)
  • sandbox_mode = "workspace-write", [windows] sandbox = "elevated"
  • Repo path: under C:\Users<user>\OneDrive... (OneDrive is a direct USERPROFILE child, so it falls into the expanded roots after #18443)

Expected Behavior

.git directories inside writable_roots should be excluded from DENY ACE grants, consistent with how .ssh is excluded. Git operations must work from within the sandbox.

Suggested Fix

In codex-windows-sandbox, add .git to the same exclusion list used for .ssh, .tsh, .brev. Apply the same pattern PR #18493 uses for SSH config scanning — just statically exclude .git at any depth within a writable root, since the sandbox has no legitimate reason to DENY-lock version control internals.

// alongside .ssh, .tsh, .brev exclusions: ".git",

What steps can reproduce the bug?

create .git under onedrive and have codex commit to it -- was working flawlessly till this upgrade.

What is the expected behavior?

"• I found the root cause: ACL on .git has an explicit DENY write entry for the Codex sandbox SID, so this session cannot create index.lock (staging/commit blocked). I’ll try removing that deny ACE and then finish commit/issue closeout." -- per codex itself

Additional information

No response

extent analysis

TL;DR

Excluding .git from DENY ACE grants in the Codex sandbox configuration may resolve the issue with git operations.

Guidance

  • The issue is likely caused by the Codex sandbox applying DENY ACEs to .git directories, which can be resolved by adding .git to the exclusion list used for .ssh, .tsh, and .brev.
  • To verify, check the ACLs on the .git directory using icacls and look for explicit DENY ACEs for the Codex sandbox SID.
  • Removing the DENY ACEs manually with icacls /remove:d may provide a temporary workaround, but the issue will persist until the underlying configuration is updated.
  • The suggested fix involves updating the codex-windows-sandbox configuration to statically exclude .git at any depth within a writable root.

Example

No code snippet is provided as the issue is related to configuration and ACL settings.

Notes

The issue is specific to the Codex version updated around 2026-04-20 (post-PR #18443) and may not apply to earlier versions. The suggested fix assumes that the codex-windows-sandbox configuration can be updated to exclude .git directories.

Recommendation

Apply the suggested fix by adding .git to the exclusion list used for .ssh, .tsh, and .brev in the codex-windows-sandbox configuration, as this is the most direct way to resolve the issue with git operations.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING