codex - 💡(How to fix) Fix Windows: trusted project entry using `\\?\` path is not recognized by project trust lookup [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#19281Fetched 2026-04-24 10:39:23
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×5commented ×2unlabeled ×1

On Windows, Codex appears to treat a trusted project entry stored as an extended-length path (for example \\?\D:\desktop\imcodex) as different from the normalized path it later checks (d:\desktop\imcodex).

As a result, project-local trust-gated features are reported as disabled even though the project is already marked trusted in C:\Users\<user>\.codex\config.toml.

Root Cause

This makes trust state feel flaky on Windows and can cause confusing startup warnings for already-trusted projects, especially after trust-gating was expanded to cover project-local config, hooks, and exec policies.

Code Example

[projects.'\\?\D:\desktop\imcodex']
trust_level = "trusted"

---

Project-local config, hooks, and exec policies are disabled in the following folders until the project is trusted, but skills still load.
    1. D:\desktop\imcodex\.codex
       To load project-local config, hooks, and exec policies, add d:\desktop\imcodex as a trusted project in C:\Users\xmly\.codex\config.toml.
RAW_BUFFERClick to expand / collapse

Summary

On Windows, Codex appears to treat a trusted project entry stored as an extended-length path (for example \\?\D:\desktop\imcodex) as different from the normalized path it later checks (d:\desktop\imcodex).

As a result, project-local trust-gated features are reported as disabled even though the project is already marked trusted in C:\Users\<user>\.codex\config.toml.

Environment

  • OS: Windows
  • Observed on: April 24, 2026
  • Codex CLI: 0.124.0

Repro

  1. Have a trusted project entry like this in C:\Users\<user>\.codex\config.toml:
[projects.'\\?\D:\desktop\imcodex']
trust_level = "trusted"
  1. Start Codex app-server or a tool that launches it from D:\desktop\imcodex.

  2. Observe startup warnings similar to:

Project-local config, hooks, and exec policies are disabled in the following folders until the project is trusted, but skills still load.
    1. D:\desktop\imcodex\.codex
       To load project-local config, hooks, and exec policies, add d:\desktop\imcodex as a trusted project in C:\Users\xmly\.codex\config.toml.

Actual behavior

Codex reports the project as untrusted and asks for a second trust entry using d:\desktop\imcodex, even though the project is already trusted via the \\?\D:\desktop\imcodex entry.

Expected behavior

On Windows, trust lookup should treat equivalent path forms as the same project, including at least:

  • \\?\D:\desktop\imcodex
  • D:\desktop\imcodex
  • d:\desktop\imcodex

A previously trusted project should not require a duplicate entry just because one side uses an extended path prefix and the other does not.

Suspected area

This looks like project trust key normalization / lookup on Windows. The symptom suggests the stored config key and the runtime lookup key are no longer normalized to the same representation before comparison.

Why this matters

This makes trust state feel flaky on Windows and can cause confusing startup warnings for already-trusted projects, especially after trust-gating was expanded to cover project-local config, hooks, and exec policies.

extent analysis

TL;DR

The issue can be fixed by normalizing the path in the config.toml file to match the runtime lookup key.

Guidance

  • Verify that the issue is caused by the difference in path representation by checking the config.toml file and the runtime lookup key.
  • Update the config.toml file to use the same path representation as the runtime lookup key, for example, change \\?\D:\desktop\imcodex to D:\desktop\imcodex.
  • Check if the issue is resolved after updating the config.toml file.
  • Consider adding a feature to normalize paths in the Codex CLI to handle different path representations.

Example

[projects.'D:\desktop\imcodex']
trust_level = "trusted"

Notes

The issue seems to be specific to Windows and is caused by the difference in path representation. Normalizing the path in the config.toml file should fix the issue.

Recommendation

Apply workaround: Update the config.toml file to use the same path representation as the runtime lookup key, as this is a simpler and more straightforward solution.

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…

FAQ

Expected behavior

On Windows, trust lookup should treat equivalent path forms as the same project, including at least:

  • \\?\D:\desktop\imcodex
  • D:\desktop\imcodex
  • d:\desktop\imcodex

A previously trusted project should not require a duplicate entry just because one side uses an extended path prefix and the other does not.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING