Skip to content

Windows: unexplained "blocked by policy" prevents test-artifact cleanup despite effective Full Access #54610

Open

Description

@GrasslSchuberth

What version of the Codex App are you using (From “About Codex” dialog)?

Currently running desktop package: OpenAI.Codex_26.1007.9446.0. Version at the incident was not independently verified.

What subscription do you have?

Not recorded.

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex rejected a PowerShell command intended to remove disposable Android emulator test snapshots. The effective configuration recorded for that turn was Full Access, with manual reviewer selection and no approval prompts.

The rejection did not identify the blocking rule, policy source, or a supported resolution.

This prevents reliable unattended build/test workflows: temporary artifacts consume disk space, but necessary cleanup can be blocked without an actionable explanation.

Effective permissions recorded in the incident’s turn context

{
  "approval_policy": "never",
  "approvals_reviewer": "user",
  "sandbox_policy": { "type": "danger-full-access" },
  "permission_profile": { "type": "disabled" },
  "active_permission_profile": { "id": ":danger-full-access" }
}

Actual result

exec_command failed: CreateProcess {
  message: "Rejected(\"[PowerShell command omitted] rejected: blocked by policy\")"
}

No matched rule, policy identifier, policy source, risk rationale, or recovery instruction was present.

The assistant subsequently described the rejection as an automatic approval review denial. That attribution is not supported by the recorded settings or the error text. The underlying cause remains unknown.

What steps can reproduce the bug?

Observed once for this particular cleanup; no independent minimal reproduction has been run.

The proposed command attempted to clean the snapshots subdirectory of a project-owned Android QA emulator. It included:

  1. Resolving the emulator and snapshot directories to absolute paths.
  2. Checking them against the expected fixed target.
  3. Checking for running emulator/QEMU processes referencing that QA emulator and aborting if any were found.
  4. Measuring the snapshot files.
  5. Running Remove-Item -LiteralPath $qaSnapshots -Recurse -Force.
  6. Reporting remaining drive space.

These checks were part of the proposed command. The rejection occurred before execution, so this report does not claim that the checks ran successfully.

Incident: October 16, 2026, approximately 13:37 UTC.
Model: gpt-6.1-sol.
PowerShell package: Microsoft.PowerShell_7.6.6.0_x64.

What is the expected behavior?

  • Evaluate narrowly scoped cleanup of disposable test artifacts consistently with the effective permissions and applicable policy.
  • If an additional policy blocks an action, identify its source and provide a meaningful rationale and supported recovery or approval path.
  • Do not attribute generic execution-policy rejections to Auto-review without evidence.
  • Make limitations of Full Access visible, especially when unattended workflows cannot request approval.

Additional information

Local checks performed afterward

  • No explicit forbidden or prompt decision was found in the inspected user rules directory.
  • The project’s .codex directory contained agent configuration files, but no project config or rules file.
  • %ProgramData%\OpenAI\Codex\requirements.toml was absent.
  • These checks do not rule out built-in rules, remotely supplied requirements, or other execution-layer enforcement.

Questions for maintainers

  1. Which execution path can emit this rejection under Full Access with approval_policy = "never" and reviewer user?
  2. Is this intended enforcement or a false positive / configuration propagation bug?
  3. How should users authorize recurring, bounded build/test cleanup for unattended runs?
  4. Can rejection messages include matched rule identifiers and effective policy provenance?

Private project paths, local username, and full chat transcripts are omitted.

Activity

  1. added
    app
    on Oct 16, 2026
  2. added
    bug
    windows-os
    sandbox
    on Oct 16, 2026
  3. github-actions commented on Oct 16, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. GrasslSchuberth commented on Oct 16, 2026

    @GrasslSchuberth
    Author

    I reviewed #53512. It reports closely matching symptoms: Windows local command execution rejected before process creation with an opaque blocked by policy message despite Full Access (approval_policy = "never"), without identifying the rejecting rule or component. A shared root cause has not been established.

    This issue adds a separate observation involving recursive cleanup of project-owned Android QA emulator snapshots, with retained turn context explicitly showing approvals_reviewer = "user", danger-full-access, and a disabled permission profile. The currently running desktop package was verified as OpenAI.Codex_26.1007.9446.0; the package version at the incident was not independently verified. The practical impact is blocked cleanup during unattended builds/tests and resulting disk-space pressure.

    Keeping this issue open pending maintainer triage. If both reports are confirmed to cover the same underlying defect, this can be consolidated into #53512 and closed as a duplicate.

  5. Drlinglong commented on Oct 20, 2026

    @Drlinglong

    Additional incident (Windows desktop, 2026-10-20):

    The task environment reported:

    • approval_policy = never
    • sandbox_mode = danger-full-access
    • Filesystem sandbox disabled / unrestricted

    A user explicitly instructed Codex to retry releasing a staged copy of completed local test artifacts after the archive had been verified. Before the retry, Codex completed a full SHA-256 comparison of the staged tree against the E: archive manifest:

    • 152,355 files
    • 10,039 directories
    • 187,055,426,655 bytes
    • all hashes matched; no reparse points

    The compatibility path was a junction to the verified archive. The attempted PowerShell cleanup was rejected before PowerShell started. The available tool error was:

    exec_command failed: CreateProcess { message: "Rejected(\"[command text truncated] rejected: blocked by policy\")" }
    

    No deletion occurred and no disk space was released. The command returned no matched rule, policy identifier, policy source, rationale, or supported recovery path. This is a single observed incident, not a verified minimal reproduction. No security settings were changed.

    Please clarify which execution component rejected this operation under the reported effective settings, and how users can obtain an actionable, privacy-safe diagnostic or supported resolution. I am not asserting that every deletion must be allowed and am not requesting a safety bypass.

  6. LiuXinYueBing commented on Oct 20, 2026

    @LiuXinYueBing

    Additional Windows desktop incident (diagnosed 2026-10-20)

    Codex desktop on Windows rejects an explicitly user-authorized temporary-file cleanup before PowerShell starts, with CreateProcess ... rejected: blocked by policy, but does not identify the policy or provide an actionable review route.

    Environment verified during diagnosis

    • Currently installed Codex desktop Windows package: 26.1013.4894.0
    • Bundled CLI: 0.163.0-alpha.10.2
    • Windows 11 Home 25H2, build 26200.9711
    • Local config: approval_policy = "never", sandbox_mode = "danger-full-access"
    • [windows] sandbox = "unelevated"
    • The day's sandbox log contains both Windows sandbox selection: unelevated and Windows sandbox selection: mxc; we cannot associate either selection with the denied call.

    Observed behavior

    The user asked to preserve an old Windows installation on a secondary disk and remove only verified temporary-file contents. The intended PowerShell cleanup included checks for disk identity, resolved absolute paths, reparse points and the current TEMP/TMP, and was designed to retain the three root directories. Execution was rejected before process creation, so the checks inside that command did not run.

    Exact available error fragment: CreateProcess ... rejected: blocked by policy.
    The full command contains personal paths and is not posted publicly.

    Read-only PowerShell commands work. The user's local rules file contains 12 allow rules, no prompt/forbidden rules. No workspace .codex/config.toml exists. The inspected desktop and sandbox logs did not expose the reason for this particular rejection. These findings do not rule out other policy layers.

    Entering /approve in this desktop version shows no matching command. We do not assume CLI/IDE slash commands are supported in this desktop version.

    Expected behavior

    If this operation must be blocked, surface the applicable policy or a useful reason and the supported user-review path. If it is a false positive, provide a supported resolution. This report does not request disabling safeguards or bypassing policy.

    Status

    No successful cleanup has been claimed. No safety-policy configuration was changed to work around the rejection. It is not yet established whether this originates in the desktop client, core execution policy, or another tool execution layer.

    OpenAI Help Center support chat received the diagnostic description and recommended this official repository's bug-report route. The support bot did not create a ticket number or confirm human escalation.

    Follow-up: cause identified and supported resolution verified

    The source for the exact installed CLI tag (rust-v0.163.0-alpha.10.2) explains this behavior:

    • The Windows command classifier flags force-delete commands for approval: classifier and tests.
    • For a command classified this way, approval_policy = never maps to Decision::Forbidden; on-request maps to a prompt: policy decision.
    • The generic dangerous-command rejection is rendered as blocked by policy: message.

    Verification on the affected machine:

    1. Creating and deleting a dedicated small diagnostic file succeeded, confirming that file operations were not generally broken.
    2. A non-destructive -WhatIf command against a nonexistent diagnostic path was rejected before process creation under the old mode.
    3. The user switched the desktop permissions control from Full Access to Ask for approval. The change was saved, but the already-running turn retained its previous execution policy.
    4. After ending that turn and starting a new one, the same dry-run command was approved through the supported tool approval path and reached PowerShell. PowerShell reported that the intentionally nonexistent test path did not exist, instead of returning a policy rejection.
    5. The previously authorized, bounded temporary-file cleanup then completed through formal approval. The three root directories were retained and verified empty. No guardrails were disabled and no custom allow rules were added for the cleanup.

    The immediate workflow is now working. The remaining product issue is the opaque rejection message and the confusing interaction between Full Access, commands requiring approval, and approval_policy = never. The error should identify this conflict and point users to a supported approval mode. This incident should not be described as a confirmed Auto-review failure.

    A desktop update occurred on October 17, but the same selective rejection was already recorded on October 14, so the available evidence does not establish that the update caused it.

  7. yunttai commented on Oct 20, 2026

    @yunttai

    Additional Windows desktop reproduction (2026-10-20), with private paths omitted:

    • Bundled Codex CLI: 0.163.0-alpha.10.2.
    • Active local configuration: approval_policy = "never", sandbox_mode = "danger-full-access"; no user/project PreToolUse hook or local managed requirements file was found in the inspected locations.
    • An explicitly authorized cleanup of project-owned, obsolete Cargo build outputs used PowerShell Remove-Item -LiteralPath ... -Recurse -Force. A 17-path call and a separate single-path call both failed at exec_command CreateProcess with Rejected(... rejected: blocked by policy). PowerShell did not start; no files were deleted.
    • The single target was 151,636,480 bytes. The failed cleanup left the build volume below the harness's 4 GiB minimum.

    I checked the exact installed CLI tag's source. Its Windows dangerous-command classifier treats Remove-Item -Force as requiring approval, and the exec-policy implementation maps an unmatched dangerous command to Decision::Forbidden when approvals are Never. This explains the observed command shape and error, subject to maintainer confirmation of the effective runtime path.

    Could a maintainer confirm that this is the intended decision for this call, and make the rejection say that approval is required but disabled? Please document the supported path for bounded recurring build-cache cleanup, including whether a narrowly scoped allow rule is supported or whether users must select an approval-enabled mode and start a new turn. I am not asking for a policy bypass.

  8. whatthecodemean commented on Oct 20, 2026

    @whatthecodemean

    Clarifying the actual request: Full Access must finish the whole authorized task, including cleanup

    I want Full Access to support unattended completion of an explicitly authorized, bounded task on my own computer. That includes the final deletion of the task's obsolete files or directories. Leaving those last steps for me to perform manually is not completion.

    This is the behavior I am requesting:

    1. I authorize the complete task and its scope, including the relevant cleanup targets.
    2. Codex completes the work, coordinates any authorized child workflows, performs the necessary cleanup with appropriate target checks, and verifies the result.
    3. I do not have to keep approving individual steps, relay messages between workflows, open a separate terminal, or delete the remaining files myself.
    4. The selected permissions remain effective across subsequent turns, resume, and authorized delegation. Codex must not report the task complete while required cleanup remains blocked or handed back to me.

    Please do not reduce this request to explaining the rejection, providing a clearer error message, or recommending Custom mode. Those may help diagnosis, but they do not meet the requested automation outcome. In my experience, Custom adds repeated approvals and interruptions between workflows.

    I previously discussed on-request as a compromise when never turns an approval-required operation into a hard refusal. That compromise is not my final acceptance criterion: a workflow that still requires repeated human intervention is not the unattended Full Access workflow I am asking for.

    The current installed Windows package is 26.1013.4894.0; its bundled binary contains the version string 0.163.0-alpha.10.2. The corresponding execution-policy source has a branch where an unmatched command classified as dangerous is forbidden under never, while on-request permits an approval request. Windows classifier tests cover force-delete commands. This identifies a concrete conflict affecting the cleanup use case; it does not establish the exact cause of every historical rejection or that an update caused it.

    Please provide a first-class, user-controlled way for the complete bounded authorization to cover the required cleanup and authorized workflow coordination without further intervention. If Full Access cannot support this, make that limitation explicit and provide a mode that does; switching to another mode with repeated approval prompts is not an equivalent resolution.

    This request does not ask Codex to override Windows access controls or organization-enforced restrictions. It asks the product to make the authorized local automation contract work end to end, rather than unexpectedly stopping at essential final steps.

    Related but separate tracks: #25590 concerns Desktop permission-state drift, and #50671 concerns delegated task permissions. This comment belongs here because this issue directly covers cleanup blocked even when effective Full Access is recorded; I am not asserting that all three share a root cause.

    This clarification was posted with AI assistance at my explicit request.

    Forum discussion of this same requested outcome: Full Access should finish authorized tasks unattended, including final cleanup.

  9. Echomatter commented on Oct 23, 2026

    @Echomatter

    I’m running into this repeatedly on Windows with Codex. I explicitly authorize cleanup, but generated files still get left behind after a policy rejection.

    Two recent examples:

    • One task reported 103,664,681 bytes (about 99 MiB) of generated files it couldn’t remove.
    • Another reported 36 obsolete build objects left behind.

    The reports described these as generated build artifacts. I end up chasing leftovers and repeating permission I already gave. That makes unattended development difficult on a machine with limited storage.

    The assistant calls it “automatic approval review,” but I can’t independently confirm which layer is rejecting the command. Please make the rejection identify the actual rule and provide a supported way to approve narrowly scoped cleanup. Users shouldn’t have to guess why explicitly requested cleanup cannot proceed.

  10. xennon101 commented on Oct 29, 2026

    @xennon101

    Additional user-authorized reproduction on 29 October 2026.

    Environment

    • Windows desktop package: OpenAI.Codex 26.1027.3384.0
    • OS: Microsoft Windows NT 10.0.26200.0
    • Session-reported settings: sandbox_mode = "danger-full-access", approval_policy = "never".
    • Inspected local default.rules contains two allow rules and no deny or prompt rules. This does not rule out built-in/managed/remote policies.

    Observed action and outcome
    The user explicitly authorized cleanup of disposable local game-server-suite test artifacts. Read-only review found 35 individually listed scratch/cache/rendering files and 702 named temporary test-folder candidates. A guarded PowerShell command was submitted with exact file hashes, absolute containment checks, running-process checks, non-following link checks, and outcome recording. The command was rejected before process creation:

    exec_command failed: CreateProcess
    Rejected(... rejected: blocked by policy)
    

    Because execution never began, the checks embedded in that command did not run and no deletion occurred. Separate read-only commands and ordinary source/document writes worked.

    The local diagnostic database records the failure at 2026-10-29 22:28:23 UTC, target codex_core::tools::router. No matched rule ID, policy provenance, risk rationale, or approval/remediation instruction was found in the error or nearby policy-specific log entries.

    Limit of this reproduction
    This is a real compound cleanup command, not a reduced minimal reproduction; we have not established that a harmless single-file deletion reproduces it. We did not attempt alternate deletion mechanisms after a denial. The underlying enforcement source is unknown. Earlier assistant attribution to Auto-review was unsupported and has been corrected.

    Expected / requested
    Please identify whether this is intended additional enforcement or a defect, and expose the responsible rule/policy source plus a supported resolution or review path. Full Access should not imply that every safeguard is disabled, but the present generic error is not actionable.

    Private usernames, project paths, game details, credentials, complete command text, session transcripts and raw logs are intentionally omitted.

  11. sora3379 commented on Oct 30, 2026

    @sora3379

    Additional Windows Codex desktop occurrence, 30 October 2026 (Korea time). The user has asked for this report.

    • Installed desktop package observed afterward: OpenAI.Codex 26.1027.3384.0. Incident runtime package version was not independently verified.
    • Effective turn context: sandbox_mode = "danger-full-access", approval_policy = "never", filesystem profile unrestricted.
    • During an Android emulator investigation the assistant attempted to clean only its own disposable archive, extraction directory and temporary directory under the workspace. The proposed PowerShell script computed full paths, checked containment, and included Remove-Item -LiteralPath $target -Recurse -Force.
    • exec_command returned CreateProcess ... rejected: blocked by policy. This happened before the submitted PowerShell script ran: its embedded path checks and removal did not execute. Read-only inspection later confirmed that all three targets remained. This was one compound command, not a separately tested minimal reproduction.
    • The response did not identify a rule, policy source, reason, or supported approval path. The assistant initially attributed the rejection to an automatic approval review; that attribution was not supported by the error and has been corrected. No alternative deletion mechanism was attempted after the rejection.

    The command shape and approval_policy = "never" appear consistent with the Windows dangerous-command behavior discussed above, but no matching rule identifier was supplied; this report does not establish the exact runtime cause.

    Could maintainers confirm the actual decision path and provide an actionable supported way to approve and complete bounded, user-authorized cleanup? Please consider returning the matched reason and explaining the interaction between Full Access and unavailable approvals. An unattended workflow should be able to finish its own task-scoped cleanup without repeated opaque failures, subject to the product's safety requirements.

    Private paths, account details, file contents, tokens and full logs are intentionally omitted.

  12. xumiaosong66 commented on Nov 3, 2026

    @xumiaosong66

    Additional verified Windows occurrence — 2026-11-03

    Posted with AI assistance at the user's explicit request. This adds a permission-mode comparison and a desktop configuration/UI limitation.

    Environment

    • Desktop update API reports app version 26.1027.30824, build 22943, channel prod.
    • Installed Windows package: OpenAI.Codex 26.1027.3384.0.
    • Executor version inspected during diagnosis: 0.166.0-alpha.5.1.
    • Effective Full Access turn configuration: danger-full-access, approval_policy=never, unrestricted filesystem.

    Observed results

    1. The user explicitly authorized deletion of disposable diagnostic text files within a project-local test directory.
    2. Under Full Access, the compound PowerShell diagnostic command was rejected before execution with CreateProcess ... Rejected: blocked by policy. The ordinary, Force and manifest-loop subtests inside that rejected command did not execute; this is not a claim that each was independently rejected.
    3. The user selected Approve for me. After the effective turn settings changed to workspace-restricted execution with automatic review, the normal approval path allowed the ordinary, Force and manifest-loop deletion tests. All four diagnostic files, the manifest and empty fixture directory were verified removed.
    4. Selecting Full Access again restored approval_policy=never.
    5. The global config was set to:
      sandbox_mode = "danger-full-access"
      approval_policy = "on-request"
      approvals_reviewer = "user"
      However, the desktop's saved Full Access selection continued to produce never. No selected config profile or project permission override was found.
    6. The user's actual permissions menu shows only Ask for approval, Approve for me and Full Access. Custom (config.toml) is absent. Finding custom-option code in the installed bundle did not establish that it was available to this user.

    Source evidence and limits

    The matching tag contains the dangerous-command decision branch mapping Never to Forbidden and OnRequest to a prompt:
    https://github.com/openai/codex/blob/rust-v0.166.0-alpha.5.1/codex-rs/core/src/exec_policy.rs#L800

    It also contains a test classifying Remove-Item test -Force as Forbidden with Never and a disabled permission profile:
    https://github.com/openai/codex/blob/rust-v0.166.0-alpha.5.1/codex-rs/core/src/exec_policy_tests.rs#L2528

    This explains a concrete policy conflict consistent with the observation. The actual rejection did not expose a matched rule identifier, so we cannot independently establish the precise execution path for every historical failure. Calling the original Never-mode rejection an automatic-review denial was unsupported and has been corrected.

    Requested resolution

    The user wants Full Access to complete explicitly authorized, bounded cleanup across chats, with actual deletion verification. Repeatedly switching to another mode is a workaround, not acceptance of this requested fix.

    Please provide a supported product/configuration route that preserves broad filesystem access while handling necessary approvals, or identify a fixed release. If a command must remain blocked, return its policy source and actionable recovery instructions. This request is not for a blanket deletion allowlist, patched safety checks, or bypassing organization/OS restrictions.

    Full Access remains unresolved on this machine. The successful Approve-for-me tests do not demonstrate a fix to Full Access. Update checking returned unavailable: disabled for build flavor (prod), which does not establish whether a fixed release exists.

    Private paths, credentials, business data, screenshots and raw transcripts are omitted.

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

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions