Skip to content

Windows desktop: unexplained policy rejection of temporary-file junction verification under full access #56271

Open

Description

@azlinrahim

App version

Installed Windows package: 26.1016.8622.0 (queried locally; not read from About). Exact incident-time app version is not independently established.

Subscription

Not collected.

Platform

Microsoft Windows 11 Pro, 10.0.26300, x64.

Unexplained pre-execution policy rejection of a temporary-file verification command under full access

Summary

Codex Desktop rejected an agent-issued PowerShell command before execution with CreateProcess ... rejected: blocked by policy. The command was intended to verify a user-authorized directory migration using one uniquely named temporary file, then delete that file. The active turn recorded approval_policy = "never" and sandbox_policy.type = "danger-full-access". The rejection supplied no rule identifier, risk classification, or actionable explanation.

This report concerns the unexplained rejection and missing diagnostic information. It does not assume that full access overrides every product-level safety policy, or that a particular reviewer caused the denial.

Environment and incident identifiers

  • Platform: Windows, Codex Desktop.
  • Incident: 2026-10-23 05:11:56.883 Asia/Kuala_Lumpur, equivalent to 2026-10-22 21:11:56.883 UTC.
  • Thread: 01a16416-6ffe-7ea0-8afd-00cc43c7599c.
  • Tool call: call_e333dd43106244c0b9d0b6e1f04ab7ed.
  • Tool route: functions.exec invoking tools.exec_command.
  • Working directory: D:\repos\workspace\codex\cima-fullstack.
  • Current installed desktop package when preparing this report: OpenAI.Codex 26.1016.8622.0. This is a current observation, not proof of the version at the incident.
  • Session-start CLI metadata: 0.163.0-alpha.11; the app restarted/updated during the conversation, so this does not establish the executing binary version at the incident.
  • Shell executable in rejection: C:\Users\<user>\.cache\codex-runtimes\codex-primary-runtime\dependencies\native\powershell\pwsh.exe.

User intent and filesystem state

The user authorized migrating task files from C:\Users\<user>\Documents\Codex to D:\data\codex, preserving compatibility for existing references. After completing the external finalization script, the user explicitly requested verification and a report of reclaimed space.

At verification time, the old C: directory was a junction to D:. A verified independent rollback copy existed on D:. Read-only inspection confirmed the junction, configuration paths and identical hashes for a file accessed through both paths. The Discord MCP server also passed a read-only startup check from D:.

Observed sequence / reproduction candidate

  1. Use a local chat with the effective settings shown below.
  2. Have a C: directory junction pointing to a writable D: directory, as above.
  3. Ask the agent to verify a previously authorized migration.
  4. The agent submits the command in blocked-command.txt, via the orchestration recorded in tool-call.txt.
  5. The execution tool immediately returns the rejection in rejection.txt, reporting Wall time 0.0 seconds.

This is an observed incident, not a newly reproduced minimal test. The blocked command has not been re-executed for this report. A later check evaluated its text against local rules only; it did not run PowerShell.

Exact blocked command

The full command and original rejection are included below (Windows username redacted). The command:

  • Generates a GUID-based .migration-verification-<GUID>.tmp filename.
  • Writes through the old C: path, reads through D:, then checks the reverse direction.
  • Uses finally to remove only that generated file with Remove-Item -LiteralPath $d -Force (no recursive deletion).
  • Also performs read-only process inspection and a file-hash comparison.

The wrapper would subsequently invoke the read-only list_channels MCP tool, but execution stopped at the rejected shell call.

Expected behavior

Either execute the authorized bounded test when policy permits it, or reject it with an identifiable policy category and a reason explaining why this command is disallowed and what supported remediation is available. Do not expose credentials in diagnostics.

Actual behavior

The request was rejected before PowerShell execution. The error contains only the generic policy denial and an escaped command preview. The rejection preview was already truncated by the tool (763 chars truncated); this report preserves it as received and supplies the full command separately.

No temporary test file was created by this rejected call.

Permission evidence

The saved turn context immediately preceding the call (21:11:34.799 UTC) records:

{"approval_policy":"never","sandbox_policy":{"type":"danger-full-access"}}

Relevant user configuration observed during investigation:

approval_policy = "never"
approvals_reviewer = "user"
sandbox_mode = "danger-full-access"

[windows]
sandbox = "unelevated"

The Windows fallback setting is included for completeness; the recorded active turn was full access. Desktop log excerpts show resolved approval policy never and reviewer user for this thread. Some resume log entries also contain derived UI defaults; those are not treated as overriding the effective turn context.

The local default.rules file contained 13 allow rules and no prompt or forbid rules. A read-only evaluation of the exact blocked command against that file returned:

{"matchedRules":[]}

This rules out a match in that specific local rule file. It does not rule out built-in, managed, hosted, or other execution-policy checks.

Investigation findings and limits

  • No evidence that this was a Windows ACL denial: the failure was a pre-execution policy rejection, not a PowerShell filesystem error.
  • No matching local command rule was found.
  • No reviewer decision or policy rule identifying this denial was found in the inspected desktop logs.
  • Earlier assistant replies called this an "automatic approval review" rejection. That attribution was not established and is corrected here.
  • A command-safety classifier reacting to deletion or compound PowerShell syntax is only a hypothesis, not a confirmed cause.
  • An earlier cleanup command in this chat also received a generic policy rejection, but it had a broader deletion scope and is not the primary reproduction in this package.
  • No permission settings, allowlists or security controls were modified during the investigation.

Impact

An authorized migration verification could not complete its additional live write/delete probe through the agent. The migration itself completed through an external script, and read-only checks passed. The opaque rejection led to uncertainty about the app's configured permissions and unnecessary troubleshooting.

Requested investigation

Please correlate the thread, call ID and UTC timestamp to identify the rejecting layer and rule. Explain why the command was blocked under the recorded permissions, assess whether this is an overly broad rejection, and provide actionable rejection diagnostics in the tool result/UI.

blocked-command.txt
$name='.migration-verification-'+[guid]::NewGuid().ToString('N')+'.tmp'; $c=Join-Path 'C:\Users\<user>\Documents\Codex' $name; $d=Join-Path 'D:\data\codex' $name; $value=[guid]::NewGuid().ToString(); try { [IO.File]::WriteAllText($c,$value); if([IO.File]::ReadAllText($d) -cne $value){throw 'C-to-D write check failed'}; [IO.File]::WriteAllText($d,$value+'-D'); if([IO.File]::ReadAllText($c) -cne ($value+'-D')){throw 'D-to-C read check failed'}; 'PASS: bidirectional file access through the junction.' } finally { if(Test-Path -LiteralPath $d){Remove-Item -LiteralPath $d -Force} }; Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'node.exe' -and $_.CommandLine -like '*maestroapacs-mcp*server.mjs*' } | Select-Object ProcessId,CommandLine | Format-List; $rel='2026-09-15\d\outputs\maestroapacs-mcp\server.mjs'; $paths=@((Join-Path 'C:\Users\<user>\Documents\Codex' $rel),(Join-Path 'D:\data\codex' $rel)); $hashes=@($paths | ForEach-Object {(Get-FileHash -LiteralPath $_ -Algorithm SHA256).Hash} | Select-Object -Unique); if($hashes.Count -ne 1){throw 'Old and new paths differ'}; 'PASS: existing server file reads identically through both paths.'
rejection.txt
Script failed
Wall time 0.0 seconds
Output:

Script error:
exec_command failed: CreateProcess { message: "Rejected(\"`\\\"C:\\\\\\\\Users\\\\\\\\<user>\\\\\\\\.cache\\\\\\\\codex-runtimes\\\\\\\\codex-primary-runtime\\\\\\\\dependencies\\\\\\\\native\\\\\\\\powershell\\\\\\\\pwsh.exe\\\" -Command '$name='\\\"'.migration-verification-'+[guid]::NewGuid().ToString('N')+'.tmp'; \\\"'$c=Join-Path '\\\"'C:\\\\\\\\Users\\\\\\\\<user>\\\\\\\\Documents\\\\\\\\Codex' \\\"'$name; $d=Join-Path '\\\"'D:\\\\\\\\data\\\\…763 chars truncated…s'; \\\"'$paths=@((Join-Path '\\\"'C:\\\\\\\\Users\\\\\\\\<user>\\\\\\\\Documents\\\\\\\\Codex' \\\"'$rel),(Join-Path '\\\"'D:\\\\\\\\data\\\\\\\\codex' \\\"'$rel)); $hashes=@($paths | ForEach-Object {(Get-FileHash -LiteralPath $_ -Algorithm SHA256).Hash} | Select-Object -Unique); if($hashes.Count -ne 1){throw '\\\"'Old and new paths differ'}; 'PASS: existing server file reads identically through both paths.'\\\"` rejected: blocked by policy\")" }
incident-context.json
{
  "eventTimestampUtc": "2026-10-22T21:11:56.883Z",
  "callId": "call_e333dd43106244c0b9d0b6e1f04ab7ed",
  "threadId": "01a16416-6ffe-7ea0-8afd-00cc43c7599c",
  "contextTimestamp": "2026-10-22T21:11:34.799Z",
  "approvalPolicy": "never",
  "sandboxPolicy": {
    "type": "danger-full-access"
  },
  "cwd": "D:\\repos\\workspace\\codex\\cima-fullstack",
  "sessionStartCliVersion": "0.163.0-alpha.11",
  "currentAppVersion": "26.1016.8622.0"
}
permission-settings.txt
config.toml:4: approval_policy = "never"
config.toml:5: approvals_reviewer = "user"
config.toml:6: sandbox_mode = "danger-full-access"
config.toml:41: [windows]
config.toml:42: sandbox = "unelevated"
desktop-permission-excerpts.log
codex-desktop-311335c2-1281-4e69-a525-103bb3c61f8f-40236-t0-i1-210155-0.log:1555
2026-10-22T21:03:09.162Z info [electron-message-handler] Reasoning summary turn-start config resolved conversationId=01a16416-6ffe-7ea0-8afd-00cc43c7599c reasoningSummaryOverride=detailed rendererWebContentsId=1 rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=1 rendererWindowVisible=true requestApprovalPolicy=null requestApprovalsReviewer=null requestPermissionProfile=null requestRuntimeWorkspaceRootCount=0 requestSandboxPolicyType=null requestSandboxWritableRootCount=0 resolvedApprovalPolicy=never resolvedApprovalsReviewer=user summary=detailed useAppServerPermissionDefault=true

codex-desktop-18d369cd-4d39-458a-a4ad-4c26136d7ac8-52080-t0-i1-210854-0.log:1619
2026-10-22T21:11:21.278Z info [electron-message-handler] maybe_resume_success activePermissionProfileChanged=true activePermissionProfileSource=default approvalPolicyChanged=true approvalPolicySource=default approvalsReviewerChanged=false approvalsReviewerSource=default assignedStreamRole=owner connectedEnvironmentIds=undefined conversationId=01a16416-6ffe-7ea0-8afd-00cc43c7599c derivedActivePermissionProfile=null derivedApprovalPolicy=on-request derivedApprovalsReviewer=user derivedSandboxPolicy={"type":"workspaceWrite","networkAccess":false,"writableRootCount":1,"excludeTmpdirEnvVar":false,"excludeSlashTmp":false} documentVisibilityState=visible environmentIds=["local"] hasCurrentPermissions=false hasExplicitPermissions=false hasLatestThreadSettings=false hasLatestTurnParams=false latestTurnId=01a1656c-c43a-7582-8dbc-519b344507e7 latestTurnStatus=completed markedStreaming=true rendererWebContentsId=1 rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=1 rendererWindowVisible=true requestApprovalPolicy=null requestApprovalsReviewer=null requestPermissionProfile=null requestSandboxMode=null responseActivePermissionProfile=:danger-full-access responseApprovalPolicy=never responseApprovalsReviewer=user responseSandboxPolicy={"type":"dangerFullAccess","networkAccess":null,"writableRootCount":0,"excludeTmpdirEnvVar":null,"excludeSlashTmp":null} routePath=/index.html sandboxPolicyChanged=true sandboxPolicySource=default shouldSendApprovalsReviewer=false shouldSendPermissions=false threadId=01a16416-6ffe-7ea0-8afd-00cc43c7599c turnCount=5 vmEvent=thread_resumed vmProduct=unknown

codex-desktop-18d369cd-4d39-458a-a4ad-4c26136d7ac8-52080-t0-i1-210854-0.log:1670
2026-10-22T21:11:33.921Z info [electron-message-handler] Reasoning summary turn-start config resolved conversationId=01a16416-6ffe-7ea0-8afd-00cc43c7599c reasoningSummaryOverride=detailed rendererWebContentsId=1 rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=1 rendererWindowVisible=true requestApprovalPolicy=null requestApprovalsReviewer=null requestPermissionProfile=null requestRuntimeWorkspaceRootCount=0 requestSandboxPolicyType=null requestSandboxWritableRootCount=0 resolvedApprovalPolicy=never resolvedApprovalsReviewer=user summary=detailed useAppServerPermissionDefault=true

codex-desktop-18d369cd-4d39-458a-a4ad-4c26136d7ac8-52080-t0-i1-210854-0.log:3000
2026-10-22T21:14:26.114Z info [electron-message-handler] Reasoning summary turn-start config resolved conversationId=01a16416-6ffe-7ea0-8afd-00cc43c7599c reasoningSummaryOverride=detailed rendererWebContentsId=1 rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=1 rendererWindowVisible=true requestApprovalPolicy=null requestApprovalsReviewer=null requestPermissionProfile=null requestRuntimeWorkspaceRootCount=0 requestSandboxPolicyType=null requestSandboxWritableRootCount=0 resolvedApprovalPolicy=never resolvedApprovalsReviewer=user summary=detailed useAppServerPermissionDefault=true

codex-desktop-18d369cd-4d39-458a-a4ad-4c26136d7ac8-52080-t0-i1-210854-0.log:3766
2026-10-22T21:23:53.159Z info [electron-message-handler] Reasoning summary turn-start config resolved conversationId=01a16416-6ffe-7ea0-8afd-00cc43c7599c reasoningSummaryOverride=detailed rendererWebContentsId=1 rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=1 rendererWindowVisible=true requestApprovalPolicy=null requestApprovalsReviewer=null requestPermissionProfile=null requestRuntimeWorkspaceRootCount=0 requestSandboxPolicyType=null requestSandboxWritableRootCount=0 resolvedApprovalPolicy=never resolvedApprovalsReviewer=user summary=detailed useAppServerPermissionDefault=true

codex-desktop-18d369cd-4d39-458a-a4ad-4c26136d7ac8-52080-t0-i1-210854-0.log:5298
2026-10-22T21:29:30.843Z info [electron-message-handler] Reasoning summary turn-start config resolved conversationId=01a16416-6ffe-7ea0-8afd-00cc43c7599c reasoningSummaryOverride=detailed rendererWebContentsId=1 rendererWindowAppearance=primary rendererWindowFocused=true rendererWindowId=1 rendererWindowVisible=true requestApprovalPolicy=null requestApprovalsReviewer=null requestPermissionProfile=null requestRuntimeWorkspaceRootCount=0 requestSandboxPolicyType=null requestSandboxWritableRootCount=0 resolvedApprovalPolicy=never resolvedApprovalsReviewer=user summary=detailed useAppServerPermissionDefault=true
exact-command-local-rule-check.json
{
  "matchedRules": []
}

Related reports

Similar symptoms: #51644, #54746, #55165. This report supplies a separate desktop incident with the full command text, effective turn permissions, exact call ID and UTC timestamp. A shared root cause has not been confirmed.

Only selected diagnostic excerpts are included. No credentials, full configuration, or full chat transcript are included. Windows username is redacted; diagnostic correlation IDs are retained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions