Skip to content

Windows native sandbox: Git HTTPS remote operations fail/crash inside Codex but work in normal PowerShell #31073

Open

Description

@yorten

Summary

Git HTTPS remote operations fail inside Codex native Windows sandbox, even though the same Git commands work in normal Windows PowerShell.

Local Git commands inside Codex work correctly, including status, diff, add, commit, and branch operations. The failure is specific to remote HTTPS operations such as git ls-remote, git fetch, git pull, and git push.

Environment

  • OS: Windows 11
  • Codex: native Windows app
  • Git: Git for Windows 2.48.1.windows.1
  • Git path: C:\Program Files\Git\cmd\git.exe
  • Git HTTPS helper: C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe
  • GitHub CLI: C:\Program Files\GitHub CLI\gh.exe
  • Remote protocol: HTTPS
  • Codex config:
sandbox_mode = "workspace-write"
approval_policy = "on-request"

[sandbox_workspace_write]
network_access = true

[windows]
sandbox = "elevated"


Also tested:

[windows]
sandbox = "unelevated"
What works

From normal Windows PowerShell:

git ls-remote https://github.com/<owner>/<repo>.git HEAD
git push

Both work.

Inside Codex:

git status
git diff
git add
git commit

These local Git commands work.

Inside Codex, Python HTTPS also works against:

https://github.com/
https://api.github.com/

GitHub CLI can access the private repo inside Codex when proxy variables are cleared:

& "C:\Program Files\GitHub CLI\gh.exe" repo view <owner>/<repo> --json nameWithOwner,visibility

Public GitHub HTTPS works inside Codex when credential helpers are disabled:

git -c credential.helper= -c credential.https://github.com.helper= ls-remote https://github.com/git/git.git HEAD

Authenticated Git HTTPS also works inside Codex if the GitHub CLI token is passed directly to Git via an extraheader and credential helpers are bypassed.

What fails

In elevated sandbox mode:

Codex runs as codexsandboxonline.
git ls-remote and git push over HTTPS fail.
Windows shows a git-remote-https.exe - Application Error dialog: memory could not be read.
Schannel mode fails with:
schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS
curl HTTPS also fails with the same Schannel SEC_E_NO_CREDENTIALS error.

In unelevated sandbox mode:

Codex runs as my normal Windows user.
The Codex shell starts with proxy variables pointing to 127.0.0.1:9:
HTTP_PROXY=http://127.0.0.1:9
HTTPS_PROXY=http://127.0.0.1:9
ALL_PROXY=http://127.0.0.1:9
GIT_HTTP_PROXY=http://127.0.0.1:9
GIT_HTTPS_PROXY=http://127.0.0.1:9
Clearing those variables removes the 127.0.0.1:9 failure.
GitHub CLI then works.
But normal Git HTTPS using the configured credential-helper handoff still fails/crashes.
Git credential configuration

General helper:

credential.helper = manager

GitHub-specific helper in global config:

credential.https://github.com.helper =
credential.https://github.com.helper = !'C:\Program Files\GitHub CLI\gh.exe' auth git-credential
Important diagnostic result

This does not appear to be a general GitHub network failure.

Inside Codex, after clearing proxy variables and bypassing credential helpers:

public GitHub HTTPS works
authenticated private Git HTTPS works when GitHub CLI token is passed directly through Git extraheader
GitHub CLI can access the private repo

The failure appears tied to native Windows Codex sandboxing plus Git for Windows / GitHub CLI / Git Credential Manager credential-helper handoff.

Expected behavior

When network_access = true is enabled in workspace-write mode, Codex should allow normal Git remote operations over HTTPS:

git fetch
git pull
git push
git ls-remote

These should work inside Codex the same way they work in normal Windows PowerShell.

Impact

Codex can edit files and make local commits, but it cannot reliably push/fetch/pull from GitHub over HTTPS in native Windows sandbox mode. The current clean workaround is to let Codex commit locally and manually push from normal Windows PowerShell.

Request

Please investigate:

Why unelevated Codex sessions inject 127.0.0.1:9 proxy variables even with network_access = true.
Why elevated Codex sandboxing causes Schannel/GCM failures with SEC_E_NO_CREDENTIALS.
Why normal Git HTTPS credential-helper handoff can crash git-remote-https.exe inside Codex, while normal PowerShell Git works.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    connectivity
    auth
    on Jul 4, 2026
  2. enouchi-dev commented on Jul 14, 2026

    @enouchi-dev

    OpenAI feedback ID:
    019f57c9-fc6a-7b13-a049-0ba379e1e404

    Additional diagnostic evidence

    OpenAI feedback ID:
    019f57c9-fc6a-7b13-a049-0ba379e1e404

    I reproduced this in a fresh repository created from a verified Git bundle inside a Codex-owned writable workspace.

    Recovery workspace:
    C:\Users\Enouc\Documents\Codex\2026-07-14\c-users-enouc-documents-codex-2026-2\guided-investor-app-dev-recovery

    Commit:
    6ab66a97237fb089d7bb9cb29bb2f4e98026eea2

    The following all passed inside Codex:

    • application file write/read/delete
    • git add and reset
    • repository config write/read/unset
    • Git ref create/read/delete
    • git fsck --full
    • clean working tree
    • correct GitHub HTTPS remote

    The following still fail:

    • git fetch origin
    • git push --dry-run origin develop

    Exact error:
    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e)

    Git Credential Manager diagnostics also reported:

    • Networking: FAIL with SEC_E_NO_CREDENTIALS
    • GitHub API: FAIL with SEC_E_NO_CREDENTIALS
    • Microsoft authentication: access denied at
      C:\Users\Enouc\AppData\Local.IdentityService

    Normal authenticated PowerShell can access the same GitHub repository successfully.

    This appears isolated to Codex access to Windows credentials / Git Credential Manager, rather than repository corruption, workspace permissions, or Git metadata permissions.

  3. enouchi-dev commented on Jul 16, 2026

    @enouchi-dev

    Post-update retest on ChatGPT/Codex Desktop version 26.707.19148
    (released July 15, 2026):

    • Local repo read access works
    • git status works
    • git log works
    • working tree is clean
    • git fetch origin still fails with SEC_E_NO_CREDENTIALS
    • git push --dry-run origin develop still fails with SEC_E_NO_CREDENTIALS
    • Normal authenticated PowerShell remains the working fallback
    • No source changes were made

    This confirms the July 15 desktop update did not resolve the Windows Git credential-access failure.

  4. enouchi-dev commented on Jul 17, 2026

    @enouchi-dev

    Retest on ChatGPT/Codex Desktop version 26.715.21425
    (released July 16, 2026), using the correct active repository:

    C:\Users\Enouc\Documents\Codex\2026-07-14\c-users-enouc-documents-codex-2026-2\guided-investor-app-dev-recovery

    Local commands pass:

    • git status
    • git log -1 --oneline

    Remote commands still fail:

    • git fetch origin
    • git push --dry-run origin develop

    Exact error:
    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e)
    No credentials are available in the security package

    The July 16 update did not resolve the Codex-side GitHub HTTPS credential failure.

    VS Code integrated PowerShell remains the working fallback.
    No source changes were made.

  5. enouchi-dev commented on Jul 19, 2026

    @enouchi-dev

    Update after latest Codex release — reproduced in a fresh Codex chat

    I retested this in a fresh Codex chat after installing the latest update.

    The initial folder was not a Git repository, so the test was run in:

    C:\Dev\guided-investor-app

    Repository state:

    Branch: develop
    HEAD: 90c5c42
    Remote: https://github.com/brightmarkworks/investment-app-prototype.git
    Local branch: 43 commits ahead of origin/develop
    Untracked files were present

    Both network commands still failed with the same credential error:

    git fetch origin
    fatal: unable to access 'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e)
    git push --dry-run origin develop
    fatal: unable to access 'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e)

    This confirms the issue still reproduces in a fresh Codex chat after the latest update. The failure affects both fetch and push authentication to GitHub from the Codex environment.

    Please keep the issue open.

  6. enouchi-dev commented on Jul 20, 2026

    @enouchi-dev

    Update after ChatGPT/Codex version 26.715.52143 — issue still reproduces

    I retested in a fresh Codex chat after updating to version 26.715.52143.

    Repository:
    C:\Dev\guided-investor-app

    Branch:
    develop

    Local HEAD:
    90c5c42

    In Codex:

    git fetch origin
    error: cannot open '.git/FETCH_HEAD': Permission denied
    git push --dry-run origin develop
    fatal: unable to access 'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e)

    I then ran the same commands in VS Code integrated PowerShell using the same repository.

    git fetch origin succeeded and updated the remote-tracking reference:

    f05fb64..c142bcc develop -> origin/develop

    git push --dry-run origin develop successfully authenticated to GitHub and was rejected only because the local branch was behind the remote:

    [rejected] develop -> develop (non-fast-forward)

    No GitHub sign-in prompt appeared in VS Code.

    This confirms that GitHub credentials and repository write access work from VS Code, while Codex still fails to access credentials and cannot write .git/FETCH_HEAD.

    Please keep the issue open.

  7. enouchi-dev commented on Jul 21, 2026

    @enouchi-dev

    Retested after updating to ChatGPT/Codex version 26.715.61943
    (released July 20, 2026).

    The core issue remains unresolved.

    Test environment:

    • Windows
    • Git 2.53.0.windows.2
    • Repository:
      C:\Dev\guided-investor-app
    • Branch:
      develop, 70 commits behind origin/develop
    • Existing untracked files were present
    • No real push was performed

    Results:

    1. git fetch origin — FAILED

    fatal: unable to access
    'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e)

    • No credentials are available in the security package
    1. git push --dry-run — FAILED

    Same SEC_E_NO_CREDENTIALS failure.

    1. Direct .git/FETCH_HEAD read/write probe — PASSED

    This appears improved compared with earlier tests.

    1. git add temporary-file — FAILED

    fatal: Unable to create
    'C:/Dev/guided-investor-app/.git/index.lock':
    Permission denied

    1. git restore --staged temporary-file — FAILED

    Same .git/index.lock permission failure.

    1. Direct .git/index.lock creation probe — FAILED

    Access to the path
    'C:\Dev\guided-investor-app.git\index.lock'
    is denied.

    The temporary test file was removed. Final repository status matched
    the initial state.

    Interpretation:

    The update appears to have changed one symptom because FETCH_HEAD is
    now directly writable. However, the two main blockers remain:

    • Codex still cannot access the Windows Git credential context
      for HTTPS operations.
    • Codex still cannot create .git/index.lock and therefore cannot
      stage, unstage, or commit reliably.

    The same repository continues to work from normal Windows
    PowerShell / VS Code under the same user account.

    Please clarify:

    1. Was version 26.715.61943 intended to address this issue?

    2. Has the root cause been identified?

    3. Is the remaining problem believed to involve:

      • Windows credential inheritance
      • Codex process identity
      • sandbox ACL handling
      • Git subprocess handling
      • or another component?
    4. What exact validation sequence should users run to confirm
      the intended fix?

  8. enouchi-dev commented on Jul 22, 2026

    @enouchi-dev

    Retested after updating to ChatGPT/Codex desktop version 26.715.72359
    (released July 22, 2026).

    The issue is still present.

    Test environment:

    • Windows
    • Repository:
      C:\Users\Enouc\Documents\Codex\schema-source-remediation-v0a
    • Branch:
      tech/schema-source-remediation-v0a
    • HEAD:
      f4b5c7c960a36e1c13beaf66f75c80247f9a744c
    • Initial working tree:
      clean
    • Existing untracked files:
      none
    • No real push was performed

    Results:

    1. Workspace access — PASSED

    Codex could read:

    • repository path
    • branch
    • HEAD
    • working-tree status
    1. git log — PASSED

    Latest commit:
    f4b5c7c Update grant contract governance docs

    1. git status — PASSED

    2. Remote credential test — FAILED

    Command:
    git ls-remote origin HEAD

    Error:
    fatal: unable to access
    'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e) -
    No credentials are available in the security package

    1. Temporary file creation — PASSED

    2. git add temporary file — FAILED

    3. git restore --staged temporary file — FAILED

    4. .git/index.lock creation — FAILED

    Codex still could not create or use .git/index.lock for staging operations.

    1. Cleanup — PASSED

    The temporary file was removed and the repository returned to a clean state.

    Interpretation:

    The July 22 update did not resolve the two main Windows sandbox failures:

    • Codex still cannot access the Windows Git credential context for HTTPS remote operations.
    • Codex still cannot create or use .git/index.lock, so it cannot reliably stage, unstage, or commit.

    The same repository continues to work from normal Windows PowerShell under the same user account.

    Please keep this issue open.

    Could you also confirm:

    1. Whether version 26.715.72359 was intended to include a fix for this issue.
    2. Whether the root cause has been identified.
    3. Whether the remaining failure is believed to involve:
      • Windows credential inheritance
      • Codex process identity
      • sandbox ACL handling
      • Git subprocess handling
      • or another component
    4. What exact validation sequence users should run once a fix is released.
  9. enouchi-dev commented on Jul 23, 2026

    @enouchi-dev

    Update after installing the July 23, 2026 ChatGPT desktop release.

    Environment

    ChatGPT desktop:

    • Version 26.721.30844
    • Released July 23, 2026

    Closest installed OpenAI desktop package observed:

    • OpenAI.Codex_26.721.3404.0_x64__2p2nqsd0c76g0

    Repository:

    • Windows 10
    • Local Git repository
    • HTTPS GitHub remote
    • Working tree clean
    • Workspace reads successfully

    Result

    The issue is still reproducible after the update.

    Workspace read:
    PASS

    Repository state:

    • Current branch and HEAD can be read
    • git status --short succeeds
    • Working tree remains clean

    Repository write probes:
    FAIL

    The attempted .git and source-root write/delete probes were blocked before
    PowerShell execution with:

    approval required by policy, but
    AskForApproval::Granular.sandbox_approval is false

    Git fetch:
    FAIL

    Exact error:

    error: cannot open '.git/FETCH_HEAD': Permission denied

    Git push dry run:
    FAIL

    Exact error:

    fatal: unable to access
    'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e) -
    No credentials are available in the security package

    Codex executable:
    FAIL

    Command:

    codex --version

    Exact error:

    Program 'codex.exe' failed to run: Access is denied

    Additional context

    The repository is readable, but Codex still cannot reliably:

    • write Git metadata;
    • create Git lock files;
    • update FETCH_HEAD;
    • use Windows HTTPS Git credentials;
    • execute codex.exe from the session.

    The same repository operations succeed when run manually in a normal
    PowerShell session, including branch creation, commit, merge, fetch, and push.

    Because the core write, fetch, credential, and executable-access failures
    remain, my current disposition is:

    NOT FIXED

    Possible areas to investigate:

    1. The desktop sandbox or approval policy is denying repository writes before
      PowerShell commands execute.

    2. The Codex process appears unable to write to .git, even when the repository
      working tree is otherwise accessible.

    3. Windows Schannel credentials available to normal PowerShell are not being
      inherited or exposed to the Codex session.

    4. codex.exe itself is returning Access denied inside the session.

    Related earlier issue:
    #29797

    Current primary thread:
    #31073

    Is there a diagnostic log, sandbox-policy report, or permission trace I can
    collect from the desktop app that would show why:

    • AskForApproval::Granular.sandbox_approval is false;
    • .git/FETCH_HEAD is not writable;
    • Windows Schannel credentials are unavailable; and
    • codex.exe is denied execution?
  10. enouchi-dev commented on Jul 24, 2026

    @enouchi-dev

    Update after installing the latest ChatGPT desktop build.

    Environment

    ChatGPT desktop:

    • Version 26.721.31836
    • Released July 23, 2026

    Installed Codex package observed:

    • OpenAI.Codex_26.721.3996.0_x64__2p2nqsd0c76g0

    Repository tested:
    C:\Users\Enouc\Documents\Codex\schema-source-remediation-v0a

    Final repository state:

    • Working tree clean

    Result

    The issue appears partially fixed.

    What now works

    Repository source-root write/delete:
    PASS

    Codex can now create, read, and remove ordinary files in the repository source tree.

    What still fails in the normal sandbox

    .git/index.lock create/delete:
    FAIL

    Exact error:

    New-Item : Access to the path
    '...\schema-source-remediation-v0a.git\index.lock'
    is denied.

    git fetch origin:
    FAIL

    Exact error:

    error: cannot open '.git/FETCH_HEAD': Permission denied

    git push --dry-run origin develop:
    FAIL

    Exact error:

    fatal: unable to access
    'https://github.com/brightmarkworks/investment-app-prototype.git/':
    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e) -
    No credentials are available in the security package

    What works when escalated

    .git/index.lock create/delete:
    PASS

    Observed:

    True
    False

    git fetch origin:
    PASS

    Observed:
    No error output

    git push --dry-run origin develop:
    PASS

    Observed:

    Everything up-to-date

    What remains blocked even when escalated

    codex --version:
    FAIL

    Exact error:

    Program 'codex.exe' failed to run:
    Access is denied

    Detected executable:

    C:\Program Files\WindowsApps
    OpenAI.Codex_26.721.3996.0_x64__2p2nqsd0c76g0
    app\resources\codex.exe

    Current disposition

    PARTIALLY FIXED

    Practical behavior now:

    • ordinary source-file edits work in the sandbox;
    • Git metadata writes still fail without escalation;
    • fetch still cannot write FETCH_HEAD without escalation;
    • Git HTTPS credentials are still unavailable without escalation;
    • codex.exe execution remains denied even when escalated.

    This is an improvement over the previous build, where source-root writes were also blocked, but the repository Git workflow is not yet fully usable without escalation or manual PowerShell fallback.

    Questions for maintainers

    1. Is it expected that .git metadata operations require escalation while ordinary repository writes do not?

    2. Is the Schannel credential failure caused by the sandbox not inheriting Windows Git credentials?

    3. Is there a supported way to grant persistent repository Git metadata access without approving each operation?

    4. Is the codex.exe Access denied failure expected for the WindowsApps package path, or does it indicate a separate packaging/ACL issue?

    Related earlier issue:
    #29797

    Current primary thread:
    #31073

  11. 7 remaining items

  12. enouchi-dev commented on Aug 11, 2026

    @enouchi-dev

    Update after latest ChatGPT/Codex desktop release — issue still present in my environment

    Thanks to everyone who has continued testing and sharing results here. The recent reports about approval/host-boundary routing have been especially helpful.

    I retested after updating to the current ChatGPT/Codex desktop version:

    ChatGPT/Codex Desktop: 26.803.61601
    Windows: native Windows environment
    Repository: normal local Git repository with HTTPS GitHub remote

    My practical result remains similar to earlier tests:

    ordinary repository/source access works;
    Codex can perform the application/source work;
    Git metadata operations still periodically require manual PowerShell intervention because Codex cannot reliably create the needed .git lock files;
    authenticated Git HTTPS operations from the Codex environment still fail with the Windows credential/Schannel path;
    normal account-owner PowerShell continues to work for the same repository.

    The recurring Git HTTPS error remains:

    schannel: AcquireCredentialsHandle failed:
    SEC_E_NO_CREDENTIALS (0x8009030e)
    No credentials are available in the security package

    I have also continued seeing .git metadata permission failures during normal development work, for example when Codex attempts branch creation, staging, merges, or ref/lock updates. Those operations succeed when I perform them manually from normal Windows PowerShell.

    The newer comments in this thread suggest an important distinction between:

    commands that remain under CodexSandboxOffline / CodexSandboxOnline; and
    commands that are successfully routed through an approved host boundary under the normal Windows user.

    In my environment, I have not yet seen a reliable automatic transition to a usable normal-user credential context that removes the need for the PowerShell fallback.

    I am continuing normal maintenance updates, but I am trying to avoid repeating broad blind retest cycles. If maintainers would like a specific focused test—particularly around whoami, approval routing, standalone Git commands, sandbox identity, .git lock creation, or Schannel credential acquisition—I’m happy to run it.

    Thanks again to the other users who have posted reproductions and workarounds. Those reports are helping narrow this from a general Git/network problem toward the Windows sandbox identity / approval / credential-routing boundary.

    Current disposition in my environment: still not resolved.

  13. ale-arc commented on Aug 26, 2026

    @ale-arc

    Current reproduction: credentials exist; Codex sandbox misclassifies the failure

    Reproduced on 2026-08-26 on Windows with the current Codex desktop environment and sandbox_mode = workspace-write.

    The GitHub credentials are valid: gh auth status succeeds using the existing local login, without exposing account or token details.

    Differential test against the same repository and command:

    Inside Codex sandbox:
    git ls-remote origin refs/heads/main
    fatal: ... schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e)
    
    Outside Codex sandbox / approved host execution:
    git ls-remote origin refs/heads/main
    4d312540375703a740269910e0de2acc7efd00b1  refs/heads/main
    

    An actual git fetch origin main outside the sandbox also succeeded and updated the local remote-tracking ref. The repository and credentials were not broken.

    The additional Codex failure is diagnostic: after the sandbox command failed, the agent reported that GitHub credentials were absent. That conclusion is incorrect and can cause unnecessary credential repair or re-authentication guidance. The accurate classification is a sandbox/Schannel credential-context or host-boundary routing failure, with a valid credential available to the normal Windows user.

    Expected behavior:

    1. Treat SEC_E_NO_CREDENTIALS from a sandboxed Schannel process as a sandbox transport/context failure, not proof that the user's GitHub credentials are absent.
    2. Route credentialed Git operations through the supported approved host boundary when available, or report the boundary limitation explicitly.
    3. Preserve the existing credential and avoid asking users to copy tokens, disable TLS verification, or re-authenticate without evidence that the credential itself is invalid.

    No token, secret, account identifier, private repository name, or credential material is included in this report.

  14. iblis82 commented on Aug 28, 2026

    @iblis82

    Additional controlled A/B evidence from Codex CLI on Windows.

    I can reproduce the same git-remote-https.exe native crash described in this issue, and a sandbox-on vs sandbox-off test appears to narrow the fault domain significantly.

    Environment

    • Codex CLI: 0.150.1
    • PowerShell: 7.6.5
    • Git for Windows: initially 2.54.0.windows.1, then upgraded to 2.55.0.windows.5
    • Git Credential Manager: initially 2.7.3, then upgraded to 2.9.1
    • Git credential helper: manager
    • Git SSL backend: openssl
    • HTTPS GitHub origin
    • Only one Git installation is present in PATH

    Upgrading both Git and GCM did not change the behavior.

    Host vs Codex

    Normal PowerShell:

    git ls-remote origin HEAD
    -> PASS, exit 0
    

    Git Credential Manager diagnostics from normal PowerShell:

    Environment                  PASS
    File system                  PASS
    Networking                   PASS
    Git                          PASS
    Credential storage           PASS
    Microsoft authentication     PASS
    GitHub API                   PASS
    
    7 passed, 0 skipped, 0 failed
    

    Inside a normal sandboxed Codex session:

    git ls-remote origin HEAD
    -> stdout empty
    -> stderr empty
    -> exit 128
    -> Windows displays:
       git-remote-https.exe - Application Error
       (memory could not be read)
    

    The operator independently observed the Windows crash dialog while Codex only saw the silent exit 128.

    Public GitHub HTTPS works inside Codex when credential helpers are bypassed:

    git -c credential.helper= \
        -c credential.https://github.com.helper= \
        ls-remote https://github.com/git/git.git HEAD
    
    -> PASS
    

    For the configured authenticated origin, bypassing credential helpers changes the result from a native crash to a normal authentication failure:

    git -c credential.helper= \
        -c credential.https://github.com.helper= \
        ls-remote origin HEAD
    
    -> exit 128
    -> no native crash
    -> credential acquisition unavailable, as expected
    

    This suggests that the credential/security handoff is involved in triggering the native crash.

    GCM diagnostics inside Codex

    With Git 2.55.0.windows.5 and GCM 2.9.1:

    3 passed, 0 skipped, 4 failed
    

    Sanitized failures:

    Networking:
    System.Net.Http.HttpRequestException
    "The underlying connection was closed after an unexpected receive error.
    No credentials were available in the security package."
    
    Credential storage:
    FAIL
    
    Microsoft authentication (AAD/MSA):
    System.InvalidOperationException
    Could not access a shared lock file: access denied.
    
    GitHub API:
    System.Net.Http.HttpRequestException
    "The underlying connection was closed after an unexpected receive error.
    No credentials were available in the security package."
    

    The same GCM installation reports 7/7 PASS immediately outside Codex.

    Final controlled sandbox A/B

    I then started Codex explicitly with:

    codex --sandbox danger-full-access
    

    /status confirmed:

    Permissions: Custom (danger-full-access, Approve for me)
    

    I ran exactly the same read-only command that crashes in the normal Codex environment:

    git ls-remote origin HEAD
    

    Result:

    stdout: <expected remote HEAD>
    stderr: empty
    exit code: 0
    git-remote-https.exe Application Error: NO
    

    So on the same machine, repository, remote, Git version, GCM version and Codex version:

    Normal PowerShell              -> PASS
    Normal sandboxed Codex         -> native git-remote-https crash
    Codex danger-full-access       -> PASS
    

    Additional control: elevated vs non-elevated parent shell

    One remaining variable was that the earlier normal-sandbox reproductions had been launched from an elevated PowerShell.

    I therefore opened a fresh non-elevated PowerShell, launched Codex normally, and confirmed with /status:

    Permissions: Custom (workspace with network access, Approve for me)
    

    I then ran exactly:

    git ls-remote origin HEAD
    

    Result:

    git-remote-https.exe - Application Error
    native memory-read crash reproduced
    

    The current A/B matrix is therefore:

    Elevated PowerShell + normal Codex sandbox      -> CRASH
    Non-elevated PowerShell + normal Codex sandbox  -> CRASH
    Codex --sandbox danger-full-access              -> PASS
    Normal PowerShell outside Codex                 -> PASS
    

    This rules out parent PowerShell elevation as a required condition on this machine. The failure continues to track the normal Codex Windows sandbox/security context.

    This strongly suggests that the normal Codex Windows sandbox/security context is a necessary trigger for this reproduction.

    It does not identify the precise internal crash mechanism, but it appears to rule out the repository, remote URL, general GitHub availability, parent-shell elevation, Git 2.54 specifically, and GCM 2.7 specifically as the primary cause.

    Current safe workaround remains:

    • use Codex for local edits/tests/local Git operations
    • perform authenticated Git HTTPS remote operations from normal PowerShell
    • do not use danger-full-access as the routine workaround

    Happy to provide additional sanitized diagnostics if useful.

  15. brefledev commented on Sep 6, 2026

    @brefledev

    On Codex with Git for Windows, the debugger captured 0xC0000005 in git-remote-https.exe at module offset 0xA45FC: a read from address zero. A dummy shell credential helper reproduced the crash.

    Environment:

    • Codex: 0.153.4
    • Git for Windows: 2.55.0.windows.3

    The matching Git source calls locate_in_PATH("sh"), then convert_slashes(p) without checking for NULL.

    New evidence: the Windows process environment contained separate Path and PATH entries with different values. Both omitted C:\Program Files\Git\usr\bin. Setting both spellings in Codex's persistent shell_environment_policy.set made a freshly launched Codex backend execute the dummy helper. Three HTTPS attempts deliberately used a dummy helper that supplied no credentials, so authentication failure (exit 128) was expected. All three ran without the memory crash. Differing Path and PATH entries remained; their role in the earlier environment-propagation failure is still unproven.

    Credential access is another separate failure.

    The dedicated sandbox account could not retrieve my existing GitHub credential. Approved host-account execution successfully fetched and pushed a disposable branch, verified its remote SHA, and deleted it. Fresh codex exec --approve-for-me sessions also passed authenticated fetch and a push using explicit host escalation. This is a persistent local crash mitigation plus an authenticated host workaround; the native sandbox credential problem remains open.

  16. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional reproduction from Codex Desktop on Windows (2026-09-14):

    I am seeing the same credential-context split described here.

    Host PowerShell (normal Windows user):

    • gh auth login completes successfully.
    • GitHub authentication works.
    • Git remote access works.
    • Re-authenticating twice in host PowerShell did not change the Codex behavior.

    Inside the Codex execution environment:

    • gh auth status fails and reports the GitHub token/account as invalid/unavailable.
    • Git HTTPS remote probe fails with SEC_E_NO_CREDENTIALS.
    • The authorized branch and HEAD remain correct.
    • Worktree remains CLEAN.
    • No push or repository mutation was performed after the auth failure.

    This strongly suggests that the host user's successful GitHub authentication is not being made available to the Codex Windows sandbox / credential-helper context, rather than an invalid GitHub login on the host itself.

    Operationally this leaves local Git operations usable while authenticated remote Git operations from Codex are blocked. I am currently keeping the repository state unchanged and avoiding repeated push attempts.

    I can provide whoami, proxy-environment, credential-helper configuration, and sandbox-mode diagnostics if useful.

  17. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional reproduction evidence from Windows Codex Desktop (2026-09-14):

    • Codex task identity: desktop-a18ufvq\codexsandboxoffline
    • Process env reports USERNAME=admin
    • USERPROFILE=C:\Users\admin
    • no HTTP/HTTPS/ALL/GIT proxy variables are present
    • C:\Users\admin\.codex\config.toml exists
    • sandbox_mode: not explicitly set
    • approval_policy: not explicitly set
    • [sandbox_workspace_write] network_access: not set
    • [windows] sandbox = "elevated"
    • project root C:\projects is trusted
    • gh auth status inside Codex reports the active aboozar-droid token as invalid
    • normal Windows PowerShell authentication succeeds
    • Git HTTPS probe inside Codex fails with SEC_E_NO_CREDENTIALS
    • repository branch/HEAD are correct
    • worktree is clean
    • branch is one commit ahead of origin
    • no push or repository mutation was performed after the failure

    This instance reproduces the same credential-context split: host PowerShell has valid GitHub authentication, while the elevated Codex sandbox runs as CodexSandboxOffline and cannot use the host user's GitHub/GCM credential context. No proxy injection is involved in this reproduction.

  18. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional reproduction from Windows Codex Desktop on 2026-09-14:

    After explicitly adding:

    sandbox_mode = "workspace-write"

    [sandbox_workspace_write]
    network_access = true

    [windows]
    sandbox = "elevated"

    and fully restarting Codex Desktop, a fresh task still ran as:

    desktop-a18ufvq\codexsandboxoffline

    Observed:

    • gh auth status -> FAIL, active GitHub token appears invalid/unavailable in sandbox
    • git -c credential.interactive=false ls-remote origin HEAD -> FAIL: could not resolve github.com
    • expected feature branch preserved, one commit ahead of origin
    • worktree CLEAN
    • no mutation performed

    This indicates network_access = true did not yield an online sandbox for this task. The failure is earlier than credential-helper handoff in this run because DNS itself is unavailable from CodexSandboxOffline.

    Normal host PowerShell authentication/networking remains functional.

  19. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional reproduction from Codex Desktop on Windows:

    • Switched Windows sandbox from elevated to unelevated.
    • Task identity became the real Windows user rather than CodexSandboxOffline.
    • github.com DNS resolution succeeded.
    • The Codex task injected HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, GIT_HTTP_PROXY, and GIT_HTTPS_PROXY as http://127.0.0.1:9.
    • Clearing all five proxy variables for the current PowerShell process only restored gh connectivity: gh auth status succeeded and gh api user returned the expected account.
    • Native Git HTTPS still failed even for a public repository with credential helpers disabled:
      schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e) - No credentials are available in the security package
    • Authenticated git ls-remote origin HEAD for the private repository failed with the same Schannel error.
    • Repository state remained clean; no mutation occurred.

    This isolates two separate unelevated-path issues on this setup: injected loopback-deny proxy variables, and a remaining native Git/Schannel credential-context failure after those proxies are cleared. gh itself works after the process-local proxy clear.

  20. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional reproduction / workaround confirmation on Windows Codex Desktop:

    • Codex identity in unelevated mode: host Windows user
    • injected proxy vars were cleared process-locally only
    • gh auth status: PASS for the active GitHub account
    • gh api user: PASS
    • native Git with the system default http.sslBackend=schannel: FAILS with SEC_E_NO_CREDENTIALS
    • public GitHub read also fails under Schannel, so the failure is not repository-specific or token-specific
    • Git for Windows version: 2.54.0.windows.1
    • command-scoped override -c http.sslBackend=openssl makes public GitHub ls-remote PASS
    • the same command-scoped OpenSSL override also makes authenticated private-repository ls-remote origin HEAD complete without error
    • no persistent Git/Codex/credential configuration was changed during the test

    This strongly isolates the current failure to Schannel/SSPI inside the Codex Windows execution context. A command-scoped OpenSSL override is an effective workaround in this environment.

  21. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional reproduction evidence from Codex Desktop on Windows:

    Environment after prior isolation steps:

    • Codex Desktop task running as the real Windows user in [windows] sandbox = "unelevated" mode
    • Codex-injected proxy variables were cleared process-locally
    • repository-local Git config: http.sslBackend=openssl
    • gh auth status and gh api user both succeed
    • public git ls-remote over HTTPS succeeds with OpenSSL
    • private repository git ls-remote also succeeds with OpenSSL

    However, git push --dry-run from Codex still crashes git-remote-https.exe with a Windows application error dialog:

    The instruction at <address> referenced memory at 0x0000000000000000. The memory could not be read.

    The command exits 128 with no stdout/stderr.

    Repository state is preserved:

    • branch: engineering/search-vs04d-knowledge-source-adapter-2026-09-13
    • local HEAD: cfdf191c308e90068af8ad5cdc74559a6dae56ad
    • remote branch HEAD: 6a97218b853164108873a07db2730b337e0d0552
    • local branch ahead by 1, behind 0
    • worktree clean
    • no real push occurred

    This narrows the issue further: OpenSSL bypasses the Schannel/SEC_E_NO_CREDENTIALS failure for read operations, but the native git-remote-https.exe process can still crash on the push path inside Codex Desktop. The same repository is expected to be tested next from normal host PowerShell as a control.

  22. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Additional confirmation from a current Windows Codex Desktop incident (2026-09-14):

    • Codex Desktop task in unelevated mode runs as the real Windows user.
    • Codex-injected proxy variables can be cleared process-locally.
    • gh auth status and gh api user succeed for the active GitHub account.
    • Native Git using the system schannel backend fails with SEC_E_NO_CREDENTIALS even for public GitHub.
    • Repository-local http.sslBackend=openssl makes read-only Git HTTPS operations succeed.
    • However, inside Codex, git push --dry-run still crashes git-remote-https.exe with a Windows Application Error ('memory could not be read') and exits 128 with no stdout/stderr.
    • The exact same repository and branch, from normal Windows PowerShell under the same user, with the same repository-local OpenSSL override, succeeds:
      git push --dry-run origin HEAD:refs/heads/engineering/search-vs04d-knowledge-source-adapter-2026-09-13
      output: 6a97218..cfdf191 HEAD -> engineering/search-vs04d-knowledge-source-adapter-2026-09-13
    • git -c credential.interactive=false ls-remote origin refs/heads/engineering/search-vs04d-knowledge-source-adapter-2026-09-13 also succeeds in normal PowerShell and returns the current remote SHA.

    This further isolates the remaining push failure to the Codex Windows execution environment / git-remote-https helper path rather than repository state, GitHub authentication, or the branch itself. Normal PowerShell is a working transport fallback.

  23. aboozar-droid commented on Sep 13, 2026

    @aboozar-droid

    Final reproduction / workaround confirmation from Windows Codex Desktop:

    • Codex-side git push --dry-run under the affected environment crashed git-remote-https.exe with a Windows application error and exited 128 with no stdout/stderr.
    • The same repository/branch from normal host PowerShell succeeded.
    • Host PowerShell environment:
      • authenticated GitHub CLI: PASS
      • repository-local http.sslBackend=openssl
      • git push --dry-run: PASS, fast-forward 6a97218..cfdf191
      • real git push: PASS
      • remote verification: branch advanced to cfdf191c308e90068af8ad5cdc74559a6dae56ad
    • No force push, rebase, reset, or repository repair was required.

    This confirms the repository and GitHub credentials were healthy; the failure boundary remained inside the Codex Windows Git HTTPS execution path / native helper context. Practical workaround used successfully: perform the remote Git operation from normal host PowerShell, with OpenSSL selected for this repository.

  24. dragon940111-bot commented on Oct 6, 2026

    @dragon940111-bot

    Additional data point (desktop 26.930.7945.0 / engine 0.160.1, legacy Windows runtime). In the restricted execution (workspaceWrite, networkAccess=true) against the same public URL: curl.exe → schannel: AcquireCredentialsHandle failed: SEC_E_NO_CREDENTIALS (0x8009030e), PowerShell Invoke-WebRequest → Authentication failed, see inner exception.; Node fetch and Python urllib → HTTP 200 with normal certificate validation; the same curl.exe from an unrestricted shell → 200. The command runner logs show the sandbox account running with USERPROFILE=C:\Users\Default, and in windows-sandbox-rs/src the legacy path (LogonUserW → CreateRestrictedToken → CreateProcessAsUserW) never calls LoadUserProfileW (only the service's registered-runtime code does). Consistent with Schannel having no per-user key container when the profile isn't loaded. Workaround that works for us: route HTTPS through Node/Python in the sandbox.

  25. NotoriousPyro commented on Oct 12, 2026

    @NotoriousPyro

    Additional reproduction: GitHub auth differs between Codex command contexts

    This post was partially written by Codex from an interaction I had with it to understand why it couldn't work in the workspace folder I had created for it. I had previously been using "full access" to work around this issue but now we came to a better workaround where the agent has permission to write to the workspace without full access being granted.

    I ended up asking Codex to add this to the "codex instructions" (AGENTS.md) here:
    Image

    Git commands on this machine

    • Some Git operations that change remote state, such as pushing a branch, may require the elevated command runner to access the configured credential helper. If a normal command fails to start or use that helper, retry with the elevated command runner before concluding that GitHub credentials are invalid or asking the user to run the command.

    On Windows, gh auth status succeeds in the Codex integrated terminal for this worktree. It reports the expected account, authenticated via keyring, using HTTPS with repo scope.

    The same check from Codex’s sandboxed command runner reports the token invalid. A normal runner push then fails while invoking the configured GitHub CLI credential helper:

    sh.exe: fatal error - NtCreateDirectoryObject(\BaseNamedObjects\msys-...): 0xC0000022
    waitpid for 'C:\Program Files\GitHub CLI\gh.exe' auth git-credential get failed: No child processes
    fatal: could not read Username for 'https://github.com': No such file or directory
    

    Retrying that push through Codex’s elevated command runner succeeds. In my case, it published the already committed branch codex/repo-workflow-rules.

    I also saw a Windows sandbox setup failure during installation. Clicking “Try again” made the message disappear, but I haven’t checked sandbox logs or confirmed whether it’s related.

    This seems consistent with a Windows sandbox / credential-helper interaction, though I can’t tell whether the cause is the sandbox identity, Git Bash/MSYS process creation, or their interaction.

  26. Al-Geroth commented on Oct 28, 2026

    @Al-Geroth

    Additional read-only reproduction from Codex Desktop on Windows (2026-10-28; no credentials or Git settings were changed). Git 2.56.0.windows.4, GitHub CLI 2.94.0, Codex engine 0.165.0-alpha.1.2. Effective profile: development, restricted workspace writes, network enabled, approval_policy=never; log reports Windows elevated sandbox and MXC availability: false. Sandbox process is codexsandboxonline, with USERPROFILE pointing to the normal host profile path.

    The Git credential helper IS configured: the generic credential.helper key is absent, but the GitHub-specific helper list resets helpers and then invokes gh auth git-credential (normal Git behavior). This is not a missing-helper configuration issue.

    • vaultcmd /list -> Location: <No profile>.
    • gh auth status --json hosts -> state=error, tokenSource=default; no nonempty oauth_token in hosts.yml.
    • gh api user -> HTTP 401.
    • Noninteractive git ls-remote origin HEAD -> exit 128, fatal: unable to get password from user; an earlier attempt tried /dev/tty and could not prompt.
    • GH_TOKEN, GITHUB_TOKEN, GH_CONFIG_DIR, askpass and HTTP proxy overrides are absent. GIT_CONFIG_COUNT entries affect only safe.directory.
    • Git TLS uses OpenSSL, so the failure in this run is not the Schannel SEC_E_NO_CREDENTIALS variant.

    The immediate failure boundary is Git -> configured gh credential helper -> no usable credential in this sandbox context. The CLI's “invalid token” message does not establish that the host user's underlying token was revoked: an unavailable keyring can also prevent token retrieval. Prior sessions have recorded successful Git push dry runs under a sandbox-online identity; those runs did not capture vault/token provenance, so the cause of variation remains unknown.

    Request: support authenticated Git remote operations in network-enabled, workspace-restricted Windows Codex sessions with approval_policy=never, without moving a long-lived credential into a repo or globally disabling isolation. No tokens, usernames, private repository names, machine names or host profile paths are included here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appauthbugconnectivitysandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions