Skip to content

Windows desktop Full access: forced test-file cleanup denied with opaque blocked by policy and no review path #45403

Open

Description

@LiuYangArt

Summary

On Windows, the desktop permission menu offers Full access under “How should ChatGPT actions be approved?”, described as “Unrestricted access to the internet and any file on your computer”. However, an explicitly authorized cleanup of agent-created test files using PowerShell Remove-Item -LiteralPath ... -Force is rejected before execution with only blocked by policy, and no approval/review option.

The dangerous-command safeguard appears intentional. This report concerns the misleading permission-mode expectation, opaque rejection, and absence of an actionable recovery path in the error. It does not request removing safeguards.

Environment

  • Windows, PowerShell 7, desktop app
  • Bundled executable reports codex-cli 0.153.4; desktop app version not collected
  • Selected UI mode: Full access
  • Effective session settings: approval_policy = never, sandbox_mode = danger-full-access
  • Inspected user execution rules contained allow rules, no explicit forbid rule

Observed behavior

The agent created two 8 GiB files for an application copy-cancellation test. Cleanup was authorized. Both a guarded cleanup command and a subsequent command naming only those two files were rejected before process creation. The narrower command had this shape (paths anonymized):

Remove-Item -LiteralPath 'F:/project/artifacts/test/source/test.bin','F:/project/artifacts/test/destination/test.bin' -Force

Tool error ended with rejected: blocked by policy. No matching rule, explanation of Full access limitations, or review action was supplied. Files remained on disk.

Minimal reproduction proposal

Use a disposable file in a test workspace, select Full access, and request cleanup using Remove-Item -LiteralPath <test-file> -Force.

The original cleanup rejection was observed. This smaller reproduction is proposed from the matching source/tests and has not been rerun; no alternate deletion mechanism was used to bypass the rejection.

Source evidence for the bundled version

  1. has_force_delete_cmdlet classifies a delete cmdlet plus -Force in the same command segment as dangerous, with an explicit test for Remove-Item test -Force:
    https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs
  2. PowerShell dangerous matches map to DangerousCommandMatch::Other:
    https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/shell-command/src/command_safety/is_dangerous_command.rs
  3. A dangerous match with AskForApproval::Never returns Decision::Forbidden; the Other rejection reason is only blocked by policy:
    https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/core/src/exec_policy.rs

This explains how full filesystem access and disabled approval prompts can still produce a hard rejection. It is not apparent from the UI wording.

Expected behavior

  • Clarify in Full access help that some command safety checks can still deny actions outright.
  • Report the actual matched rule and why the current approval mode cannot request review.
  • Give an actionable, supported route to a user-reviewed decision where policy permits, instead of an unexplained dead end.
  • Clarify whether users should select Ask for approval or Approve for me to recover from this specific condition.

Related reports

Related: #43905 (same CLI version, Full access blocked) and #10827 (earlier never/full-access behavior). This report adds the Windows PowerShell cleanup trigger, exact desktop menu wording, and matching version-specific source chain.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    on Sep 14, 2026
  2. kazusoarer commented on Sep 15, 2026

    @kazusoarer

    Confirmed with an executed small-file comparison in the VS Code extension, adding evidence beyond the proposed small reproduction in the original report.

    • Extension: openai.chatgpt-26.5908.31748-win32-x64.
    • Actual parent executable: extension-bundled codex-cli 0.154.0-alpha.6.1 (not the separate npm CLI on PATH).
    • Windows / PowerShell 7, sandbox_mode = "danger-full-access", approval_policy = "never".
    • Explicit user authorization to remove identified agent-generated test artifacts.

    In the active workspace, the agent submitted the following diagnostic through exec_command (only the relative filename is anonymized here):

    $probePath = Join-Path (Get-Location).Path 'data\work\deletion-diagnostic.txt'
    if (Test-Path -LiteralPath $probePath) { throw 'Probe already exists' }
    Set-Content -LiteralPath $probePath -Value 'Temporary deletion diagnostic; no user data' -Encoding UTF8
    Remove-Item -LiteralPath $probePath -ErrorAction Stop
    if (Test-Path -LiteralPath $probePath) { throw 'Probe was not removed' }

    This succeeded. A second request adding -Force to the removal line was rejected before process creation with CreateProcess ... rejected: blocked by policy. It involved no recursive removal, user originals, network access, or protected system files. The second request was rejected before creating its diagnostic file. Runtime settings and hooks were unchanged during the comparison.

    The matching published version contains the same source chain:

    Operational impact: the unexplained rejection was initially misattributed to local managed hooks, causing repeated investigation while disposable artifacts remained. Ordinary, individually scoped deletion subsequently completed cleanup; no alternate-language deletion or disabled protection was used.

    Please track the misleading permissions expectation and missing actionable diagnostic as a runtime usability/reliability defect. In particular, identify the matched safety condition and explain that never means no approval prompt, rather than unconditional permission. Please document a supported user-review path where policy permits and add regression coverage for this small reproduction. This report does not request globally removing destructive-command protection. No private files or session logs are attached.

  3. iharc-jordan commented on Sep 15, 2026

    @iharc-jordan

    Additional confirmed occurrence on Windows with bundled codex-cli 0.154.0-alpha.6.2 (observed September 14–15, 2026).

    The user explicitly authorized deletion of four task-created directories under the Windows temporary directory. Read-only inspection confirmed the exact absolute paths and that the directory roots were not links/reparse points. Both a guarded path-validation script and a command enumerating literal paths were rejected before PowerShell started. Ordinary read-only commands continued to work.

    Sanitized command shape (not a separately executed minimal reproduction):

    Remove-Item -LiteralPath 'C:\Users\<user>\AppData\Local\Temp\<task-directory>' -Recurse -Force

    The tool returned a CreateProcess rejection ending in:

    rejected: blocked by policy
    

    The effective session was approval_policy=never, sandbox_policy=danger-full-access, with reviewer user. Although the user config specified approval_policy="on-request", the desktop log recorded an explicit task-start request with requestApprovalPolicy=never and requestPermissionProfile=:danger-full-access; later turns retained never. Neither inspected user rules nor the legacy policy file contained a prompt or forbidden rule. We did not change settings or test an alternative deletion route during diagnosis.

    Read-only inspection of the source tag matching the installed executable confirms the same code path described in this issue:

    This source chain matches the observed command, effective policy, and error; the runtime error itself did not identify the matched predicate. No isolated fresh-task reproduction or successful approval-mode control was performed here.

    Please expose the matched command-safety reason and explain that Full access can turn an otherwise reviewable command into a hard denial through never. An actionable, supported way to request a user-reviewed decision would avoid repeatedly asking the user for chat authorization that cannot affect this policy branch.

    No private paths, file contents, credentials, or raw session logs are included.

  4. kamkie commented on Sep 17, 2026

    @kamkie

    Additional Windows Desktop occurrence observed September 16–17, 2026, with two diagnostic details that may help separate this from a custom execution-rule denial.

    Observed environment and failure

    • The affected session's own metadata records Codex Desktop, 0.154.0-alpha.6.2. This was distinguished from the separately installed CLI on PATH.
    • The installed Windows app package checked during investigation was 26.908.9136.0.
    • The UI showed Full access. Runtime records around the rejection showed approval_policy=Never and sandbox_policy=DangerFullAccess.
    • Authorized cleanup of task-created temporary baseline artifacts was rejected before PowerShell started. The submitted script checked that computed absolute target paths remained inside the task's temporary directory, then used this deletion shape:
    Remove-Item -LiteralPath $resolvedTarget -Recurse -Force

    The tool returned a CreateProcess rejection ending in rejected: blocked by policy. The artifacts remained. No changed-flag retry, alternative deletion API, or approval-setting change was performed.

    Additional diagnostic evidence

    1. A non-executing codex execpolicy check of the original command against the inspected user rule file returned {"matchedRules":[]}. This excludes a match in that inspected file; it does not claim to exclude every possible policy layer or reproduce the full runtime decision.
    2. Read-only inspection of the exact session-version source confirms the same chain already discussed here: PowerShell delete-plus-Force classification, dangerous commands denied under Never, and the generic Other rejection message.

    The command, effective settings and source support the forced-deletion classifier as the explanation. The runtime rejection itself still did not name the matched predicate, so this remains a source-backed diagnosis rather than a directly logged classifier decision.

    Mitigation and its limits

    We prepared and tested changes to our instruction source to avoid unnecessary -Force in fresh cleanup commands and to finish available, permitted read-only investigation after a rejection. Those instruction changes have not been installed into live configuration. Command-generation-only probes on Codex and Claude selected ordinary cleanup without Force and rejected changing flags to evade an existing denial. These probes executed no deletion and do not establish a successful cleanup or approval-mode recovery. The blocked artifacts remain.

    The product-level gap is unchanged: Full access plus Never can make an otherwise reviewable command a hard denial, while the error gives no actionable reason. Please identify the matched command-safety condition, explain how the active approval mode affects it, and expose a supported user-review path where policy allows. Avoiding gratuitous Force is useful agent guidance, but cannot replace a diagnostic that explains why an authorized command was rejected.

    No local paths, private repository identifiers, credentials, raw logs or screenshots are attached.

  5. nassie256 commented on Sep 17, 2026

    @nassie256

    Additional observed case on 2026-09-17: explicitly authorized cleanup of 10 node_modules directories is rejected before PowerShell starts, with no actionable explanation.

    Environment:

    • Windows desktop package: OpenAI.Codex 26.911.7940.0 (verified via Get-AppxPackage, not the About dialog).
    • Windows NT 10.0.26200.0 x64; PowerShell 7.6.6.
    • Effective session settings: sandbox_mode=danger-full-access; approval_policy=never; unrestricted filesystem profile. The visible permission menu was not inspected.
    • Projectless task; targets were under a personal OneDrive folder, outside the task working directory. Private paths and project names are omitted.

    Observed sequence:

    1. Read-only metadata inventory identified the 10 largest node_modules directories, totaling approximately 4.15 GB.
    2. The user explicitly requested deletion of those exact 10 directories.
    3. Preflight resolved each absolute target, verified containment within the intended OneDrive root, confirmed the leaf name was node_modules and that each target was a directory. LinkType/Target were null for all 10.
    4. A PowerShell loop using Remove-Item -LiteralPath $targetPath -Recurse -Force -ErrorAction Stop was rejected before process creation.
    5. The user explicitly reconfirmed permission. A retry performed the same path checks inline and rejected unexpected directory/link types before the same deletion operation. It was again rejected before execution.

    Error excerpt (command text omitted to redact private paths):

    exec_command failed: CreateProcess { message: "Rejected(... rejected: blocked by policy)" }
    Wall time 0.0 seconds
    

    Neither recursive deletion attempt executed. Earlier in the same task, three explicitly named single files were successfully deleted using Remove-Item -LiteralPath without -Recurse or -Force. This is an observation, not a controlled comparison proving which flag caused the rejection. No alternative deletion mechanism or policy modification was used.

    The opaque error also led to misleading assistant guidance: it called the denial an automatic approval review and suggested an execution-environment restriction change, then admitted it could not identify the blocking setting or a supported resolution. The tool error itself did not identify the denying component.

    Expected: allow the narrowly scoped operation where policy permits; otherwise identify the matched safety rule, explain the interaction with the effective approval mode, and provide a supported next step. Repeated natural-language confirmation currently leaves the user in a dead end. This report does not request bypassing safety checks.

    This adds a newer desktop package and a real directory-cleanup case to the existing issue. Root cause and a standalone deterministic reproduction remain unverified. No file contents, credentials, raw session logs, or personal paths are included.

  6. Northern-Summer commented on Sep 21, 2026

    @Northern-Summer

    Reproduced on September 21, 2026, with Codex Desktop for Windows. Adding this occurrence here rather than opening a duplicate.

    Environment:

    • Desktop package: 26.915.4065.0
    • Desktop-bundled executable: codex-cli 0.155.0-alpha.9.2 (checked directly, not the separate CLI on PATH)
    • Windows 11, build 10.0.26200
    • PowerShell 7.6.6
    • Effective task settings: sandbox_mode = "danger-full-access", approval policy never

    The user explicitly requested cleanup of identified temporary browser profiles and generated audit intermediates. A submitted cleanup command had this structure; only the path is anonymized:

    $p = 'C:/Users/<user>/AppData/Local/Temp/playwright_chromiumdev_profile-<id>'
    if (Test-Path -LiteralPath $p) {
        $b = (Get-ChildItem -LiteralPath $p -Recurse -File -Force -ErrorAction Stop |
            Measure-Object Length -Sum).Sum
        Remove-Item -LiteralPath $p -Recurse -Force -ErrorAction Stop
        [pscustomobject]@{
            deleted_bytes = $b
            exists = (Test-Path -LiteralPath $p)
        } | ConvertTo-Json
    } else {
        'already_absent'
    }

    exec_command rejected it before process creation:

    CreateProcess { message: "Rejected(... rejected: blocked by policy)" }
    

    Read-only calls still worked, and a subsequent existence check confirmed that the target remained. This is the shape of an observed failed request, not a separately executed minimal reproduction. It does not establish that all deletion commands are blocked.

    There was initially a custom PreToolUse hook, which complicated diagnosis. During troubleshooting, its registration was removed. A subsequent call read back "hooks": {}. After the user reported restarting the desktop app, the same cleanup form was rejected again. This does not prove which internal predicate matched, but it means that attributing the persistent failure solely to that custom hook or assuming a stale hook cache was not justified. Those configuration changes did not resolve cleanup and should not be presented as a supported workaround.

    The operational problem is the missing diagnostic and review path. The error did not identify the matched command-safety condition or explain how never affected the decision. Repeated chat authorization did not change the outcome. Investigation consequently focused on local hooks and configuration rather than the permission-mode interaction described above in this issue.

    Please include a stable reason identifier, the effective approval mode, and the supported recovery action in this error. If a command is reviewable in another permission mode, the desktop should make that route explicit. Filesystem access and permission to run a safety-classified command should also be distinguished in the UI.

    No private paths, file contents, credentials, or raw session logs are attached. The source mapping discussed earlier in this issue has not been independently checked against 0.155.0-alpha.9.2 for this report, and no successful cleanup or approval-mode control is claimed.

  7. kholcombe1999 commented on Sep 21, 2026

    @kholcombe1999

    Another Windows desktop occurrence on September 21, 2026. During user-authorized cleanup, two agent-created Expo export directories (about 955 MiB each) remained inside a managed ticket worktree. The agent verified the resolved absolute targets were within the intended workspace. A guarded PowerShell script ending in Remove-Item -LiteralPath $resolved -Recurse -Force was rejected before PowerShell ran with CreateProcess ... rejected: blocked by policy. A second request naming only one exact directory with Remove-Item -LiteralPath '<exact path>' -Recurse -Force received the same rejection. Effective settings were sandbox_mode = danger-full-access, approval_policy = never, reviewer user. Local path and project details are omitted.

    Resolution in this task: After checking both targets again, confirming neither root nor its contents contained reparse points, and finding no process still using them, the agent used Remove-Item -LiteralPath $resolved -Recurse -ErrorAction Stop (without -Force). That command succeeded for both directories; a follow-up existence check returned false for each. This is a narrower command, not a different deletion API or a disabled safeguard. The initial generic denial still did not identify -Force as the trigger or offer an approval path. Please expose the matched safety reason and document the supported remedy.

  8. bernardo215 commented on Sep 23, 2026

    @bernardo215

    Another Windows Codex desktop occurrence during user-authorized cleanup of task-created local QA state. Full access was selected; the local config showed approval_policy = "never", sandbox_mode = "danger-full-access", and approvals_reviewer = "user".

    Two exact-scoped cleanup requests combining a disposable test-database drop with removal of its matching filestore were rejected before PowerShell started with only blocked by policy. Two attempts to remove one ignored anonymous test-cookie file were rejected the same way. All four requests contained PowerShell Remove-Item ... -Force; the filestore requests also used -Recurse. None requested escalated sandbox permissions. No approval or override control was exposed.

    This appears consistent with the -Force command-safety path documented in this issue, but the opaque error does not prove the matching rule. We did not retry through another deletion method after the rejection. The disposable database and filestore remain, and the task cannot complete its required clean-install/cleanup gate or release its shared local staging lock.

    Please expose the matched safety reason and a supported exact-action recovery path. This report is anonymized; it contains no local paths, credentials, Production data, or raw session logs.

  9. Hugo-Polloli commented on Sep 23, 2026

    @Hugo-Polloli

    I encountered this on September 23 with Windows Codex Desktop and its running codex-cli 0.155.0-alpha.16.3 executable. I can add a successful approval-mode comparison to the reports above.

    I explicitly authorized deletion of two disposable harness rehearsal/test-output directories. The agent verified their exact absolute paths and checked that neither tree contained reparse points. Under Full Access, this command was rejected before process creation with only rejected: blocked by policy (paths anonymized):

    Remove-Item -LiteralPath 'C:\<test-output>\rehearsal-a','C:\<test-output>\rehearsal-b' -Recurse -Force -ErrorAction Stop

    The effective task settings were approval_policy=never, sandbox_policy=danger-full-access, reviewer user. The inspected user rules directory was empty and the current project had no .codex configuration. My user config requested on-request / auto_review, but the task's Full Access selection overrode those defaults. The same effective Full Access settings were present before my recent WSL-to-Windows migration, so this was not a newly introduced approval setting from that migration. A full Windows reboot did not resolve the rejection.

    I then selected Approve for me and left it selected. On the subsequent turn, the effective environment changed to workspace-write with auto_review. After revalidating the targets, the agent submitted the same deletion command, retaining both -Recurse and -Force, through the supported require_escalated approval path. It succeeded with exit code 0; subsequent existence checks confirmed both directories were gone. No allow rule, alternate deletion API, or modified executable was used.

    This was an operational comparison, not an isolated minimal reproduction: both the permission mode and the explicit escalation request changed. It nevertheless confirms a working review path for the previously rejected operation on the same installation.

    The source tag matching my running executable contains the explicit PowerShell force-deletion test, the Never -> Forbidden / OnRequest -> Prompt branch, and the generic rejection message. The runtime error itself still did not identify the matching predicate.

    I prefer Full Access for everyday work; switching my entire workflow to automatic review is a workaround, not the desired resolution. Please make the Full Access limitation explicit and expose the matched safety reason plus a supported per-action review route where policy permits. The opaque error sent troubleshooting toward local configuration and even a reboot unnecessarily.

  10. kazek5p-git commented on Sep 23, 2026

    @kazek5p-git

    Dodaję wynik kontrolowanego porównania Codex CLI 0.155.1 i 0.156.1, wykonanego 23 września 2026. Nowa informacja względem pierwotnego zgłoszenia: odmowę można odtworzyć również przy symulacji -WhatIf, bez rzeczywistego usuwania.

    Środowisko i metoda

    • Windows x64, Microsoft Windows NT 10.0.26220.0, PowerShell 7.6.6.
    • Klient 0.155.1 z lokalnej instalacji oraz osobno pobrany pakiet npm @openai/[email protected].
    • Rzeczywiste procesy codex exec --ephemeral --json, każdy z nowym, oddzielnym CODEX_HOME i katalogiem roboczym.
    • Lokalna atrapa Responses API na 127.0.0.1 przekazywała ustalone wywołanie exec_command. Nie korzystano z kont modeli, tokenów, istniejącej historii ani prawdziwego modelu; gpt-5.4 było wyłącznie identyfikatorem konfiguracji atrapy.
    • Atrapa nie generowała decyzji o zgodzie. Nie dodawano reguł zezwalających i nie używano opcji pomijania kontroli uprawnień.

    Jednakowa konfiguracja wejściowa profili:

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

    Każda próba używała nowego folderu z pojedynczym plikiem kontrolnym. Obecność pliku i jego SHA-256 sprawdzano przed i po próbie.

    Wyniki

    Poniższe ścieżki są zanonimizowanymi przykładami, nie ścieżkami danych użytkownika:

    Wywołanie narzędzia 0.155.1 0.156.1
    Write-Output 'PROBA_ODCZYTU_OK' wykonane, kod narzędzia 0 wykonane, kod narzędzia 0
    Remove-Item -LiteralPath 'C:\work\policy-probe\fixture' -Recurse -WhatIf wykonana symulacja, kod narzędzia 0 wykonana symulacja, kod narzędzia 0
    Ta sama symulacja z dodanym -Force blocked by policy, przed uruchomieniem PowerShella blocked by policy, przed uruchomieniem PowerShella

    Przed obydwoma wariantami symulacji stosowano ten sam warunek, sprawdzający, że Remove-Item jest wbudowanym cmdletem, a nie funkcją użytkownika. Pełny kształt wariantu odrzuconego, z zastąpioną ścieżką:

    $ErrorActionPreference = 'Stop'
    $definition = Get-Command Remove-Item -ErrorAction Stop
    if ($definition.CommandType -ne 'Cmdlet' -or
        $definition.ModuleName -ne 'Microsoft.PowerShell.Management') {
        throw 'Nieprawidłowe polecenie symulacji.'
    }
    Remove-Item -LiteralPath 'C:\work\policy-probe\fixture' -Recurse -Force -WhatIf

    Oba klienty zwróciły błąd narzędzia zaczynający się od:

    exec_command failed: CreateProcess { message: "Rejected(...
    

    i kończący się na:

    rejected: blocked by policy
    

    Wszystkie sześć plików kontrolnych pozostało nienaruszonych. W ramach tego porównania nie wykonywano rzeczywistego usuwania ani alternatywnych metod kasowania.

    Ważne: cały codex exec kończył się kodem 0 także po odmowie narzędzia, ponieważ atrapa następnie kończyła odpowiedź. Wyniki oceniano na podstawie tool_output, nie kodu zakończenia całego klienta.

    Ograniczenia i pytanie

    0.156.1 nie usunęła tej odtworzonej odmowy. Dodanie -Force było czynnikiem rozróżniającym w tych konkretnych symulacjach. Nie oznacza to, że każde użycie tego przełącznika jest blokowane.

    Oba klienty działały na tym samym Windowsie, więc porównanie nie rozstrzyga między wspólną logiką klientów, polityką nadrzędną i współdzielonym komponentem wykonawczym. Zapisane ustawienia profilu nie zastępują pełnego śladu wewnętrznej decyzji.

    Czy odrzucenie takiej symulacji -WhatIf jest zamierzone? Proszę o wskazanie warstwy/reguły podejmującej decyzję oraz wspieranej ścieżki rozstrzygnięcia przy zachowaniu zabezpieczeń. Nie proszę o ich wyłączenie. Nie dołączam danych użytkownika, prywatnych ścieżek, poświadczeń ani pełnych zapisów sesji.

  11. liu2791316409-jpg commented on Sep 26, 2026

    @liu2791316409-jpg

    Additional confirmed minimal reproduction on 2026-09-26 (Windows Codex Desktop), adding an executed single-file case to the original report's proposed small-file test.

    • Desktop app: 26.924.2738.0.
    • The affected session metadata reports Codex 0.158.0-alpha.2.1 (Codex Desktop originator).
    • Effective settings: sandbox_mode=danger-full-access, approval_policy=never.
    • Projectless workspace on the local drive. A read-only check confirmed the probe path did not exist. New-Item -ItemType File then successfully created a 0-byte file under that workspace's work/ directory.
    • A separate exec_command call attempted only:
    Remove-Item -LiteralPath 'C:\<workspace>\work\delete-policy-probe.tmp' -Force -ErrorAction Stop
    • The tool returned at wall time 0.0 seconds: exec_command failed: CreateProcess ... rejected: blocked by policy. A subsequent read-only check confirmed the file remained.
    • No recursive operation, multi-path batch, user original, or path outside the workspace was involved. Inspected local user/project rule and hook locations did not contain a matching custom restriction; codex doctor reported unrestricted filesystem access. No alternate deletion method or retry of this target was attempted.

    This confirms the symptom persists in the affected 0.158.0-alpha.2.1 session and that a single disposable file is enough to reproduce this command-form rejection. It does not establish that every deletion form is blocked or identify the exact matched predicate. Please expose the specific reason and a supported review or cleanup path for an explicitly authorized, verified file. Personal paths, raw session logs, and account details are omitted.

    Follow-up: narrower deletion succeeded

    After the user explicitly authorized trying another deletion form, I rechecked the same 0-byte file: exact path within the workspace, regular file, no link/reparse point. A separate command using Remove-Item -LiteralPath 'C:\<workspace>\work\delete-policy-probe.tmp' -ErrorAction Stop without -Force completed with exit code 0. Test-Path then returned False.

    This controlled comparison narrows the observed failure to the command form containing -Force in this session; it does not prove every -Force deletion is rejected or establish the hidden policy reason. No broader deletion scope, alternate API, or security-setting change was used. The diagnostic file has been cleaned up.

  12. 10 remaining items

  13. nuclearspike commented on Oct 23, 2026

    @nuclearspike

    Additional reproduction on Windows desktop 26.1016.6573.0, bundled/running codex-cli 0.163.0-alpha.11, Windows 11 ARM64 build 26200 (2026-10-23).

    Active agent instructions report sandbox_mode=danger-full-access, approval_policy=never. The user explicitly authorized deletion of completed build caches repeatedly. Two exact absolute task-owned directories (~3.40 GB combined) were verified inactive, with no reparse ancestors/descendants; logs/TRX/source fingerprints/build output hashes were retained separately and transfer-verified. No active test/build processes remained.

    The direct command was rejected before PowerShell ran (paths sanitized):

    Remove-Item -LiteralPath 'C:\BuildTests\completed-run\nuget-cache','C:\BuildTests\completed-run\artifacts' -Recurse -Force -ErrorAction Stop

    Error: exec_command failed: CreateProcess { message: "Rejected(... rejected: blocked by policy)" }.

    This is an actual forced-delete invocation, not the cross-command -Force false positive in other reports. User-level default.rules contained only allow rules, and no matching deletion rule. codex doctor --json reported configuration loading OK and 'no locally visible recent Codex security enforcement was found'. Doctor explicitly does not inspect active thread overrides; its invocation-default sandbox values should not be mistaken for the active task settings.

    Version-specific source inspection explains the matching path:

    Runtime diagnostics did not name the winning predicate, so this is a matching version-specific source diagnosis rather than a traced internal decision. No alternative deletion executor, force-flag concealment, rule override, or policy bypass was attempted.

    Please provide an actionable rejection naming the forced-delete safeguard and never interaction, clarify Full Access UI wording, and provide a supported bounded authorization/lifecycle-cleanup mechanism so agent-created disposable build caches can be cleaned without repeatedly asking the user to delete them manually. A desktop update is reported available, but no verified fix for this behavior was identified. No private paths, account identifiers, credentials, raw conversation, or full diagnostic logs are included here.

  14. nuclearspike commented on Oct 23, 2026

    @nuclearspike

    Follow-up on the 0.163.0-alpha.11 reproduction above: a genuinely narrower cleanup succeeded through the same exec_command tool and PowerShell executor, with the same Full Access/never settings, using Remove-Item -LiteralPath <same two exact directories> -Recurse -ErrorAction Stop without -Force. Read-only checks found zero hidden/read-only/system entries, zero reparse ancestors/descendants, and no active references. No attributes, policy rules, approval settings, or executors were changed. Both directories are now absent and retained evidence hashes still match; ~3.40 GB logical data was removed.

    This provides a practical non-forced cleanup path for ordinary build intermediates and strengthens the force-flag diagnosis. Please make the rejection explain the specific safeguard and suggest normal non-forced deletion when appropriate, instead of the generic policy message that caused repeated unnecessary user intervention.

  15. xue-ding-e commented on Oct 24, 2026

    @xue-ding-e

    Additional observed case on 2026-10-25, with a verified bundled/running codex-cli 0.164.0-alpha.11.1, Windows x64 (10.0.26300.0), PowerShell.

    The user explicitly authorized cleanup of specific local directories. Read-only checks verified the targets and identified active build outputs to preserve. The guarded PowerShell cleanup used Remove-Item -LiteralPath <verified-directory> -Recurse -Force -ErrorAction Stop. It was rejected before process creation with CreateProcess ... rejected: blocked by policy, while the effective turn configuration was danger-full-access / never / reviewer user. No action-specific reason or review option was returned. This is an observed cleanup failure, not a newly executed minimal reproduction.

    Additional recovery evidence:

    • Changing user config.toml to approval_policy="on-request" and approvals_reviewer="user" did not change the existing chat's effective policy. Read-only inspection still showed the selected Full access profile (:danger-full-access) and that chat's never policy. This alone is not evidence of a propagation bug: an explicit chat selection can override defaults.
    • After the active environment actually changed to a restricted/workspace-write profile with approvals available and reviewer auto_review, the agent requested scoped require_escalated execution.
    • Fresh process and Cargo-lock checks preserved the still-building target. The authorized guarded cleanup then succeeded through the same exec_command tool and PowerShell executor. Subsequent checks confirmed the selected directories absent and protected directories retained.
    • No binary patch, blanket allow rule, or alternative-language deletion was used.

    The matching published source tag contains the dangerous-command fallback mapping Never to Forbidden and OnRequest to Prompt. This is source correlation, not a captured runtime trace identifying the winning predicate.

    Please clarify the Full access UI/help and make the rejection actionable: name the forced-delete safety condition, explain its interaction with never, and offer the supported bounded review path. Also make clear when a chat's selected permission profile overrides edited file defaults. An explicitly authorized maintenance task should not require users to reverse-engineer this interaction or repeatedly restate authorization.

    Private paths, project names, file contents, account/session identifiers, credentials, and raw logs are omitted.

  16. luquibu commented on Oct 26, 2026

    @luquibu

    Additional confirmed occurrence through T3 Code on Windows, with a successful recovery after changing the permission mode.

    Environment:

    • Windows x64, build 10.0.26200.
    • Affected Codex runtime: 0.164.0, verified from session metadata.
    • T3 Code server reported 0.1.2 during diagnosis. Desktop build was not independently collected.
    • Affected models: GPT-6 Astra and GPT-6.1 Sol.

    Across two conversations, we found 11 rejected tool calls containing forced PowerShell deletion. Five included -WhatIf. The requests failed before PowerShell started with CreateProcess ... rejected: blocked by policy.

    Effective settings at every rejection were:

    approval_policy = never
    approvals_reviewer = user
    sandbox_policy = danger-full-access
    

    The agents described these as automatic-review rejections, but the recorded reviewer was user. That explanation was unsupported by the effective settings.

    Recovery verified on October 26, 2026:

    1. The user changed one affected T3 thread from Full access to Auto-accept edits.
    2. The subsequent turn recorded on-request, reviewer user, and workspace-write.
    3. T3 displayed command approval requests. The user approved them.
    4. A guarded cleanup script retaining Remove-Item -Recurse -Force and Remove-Item -Force completed with exit code 0.
    5. The cleanup receipt and a separate existence check confirmed that all three targets were absent.

    This was a successful recovery of the original task, not an identical-command A/B test. Both approval policy and sandbox mode changed.

    The behavior matches the 0.164.0 execution policy, where dangerous commands are forbidden under Never and request approval under OnRequest.

    Please make the rejection identify the command-safety condition and explain the supported approval path. The generic error led the agents to misdiagnose the cause and leave authorized cleanup unfinished.

    Private paths, repository names, session IDs, and raw logs are omitted.

    Prepared with OpenAI Codex, GPT-6 Astra, during T3 Code triage.

  17. bog-margo commented on Oct 27, 2026

    @bog-margo

    Additional confirmed Windows desktop occurrence on 2026-10-27, posted at the owner's explicit request.

    Verified environment

    • Installed Windows package: OpenAI.Codex 26.1021.3705.0.
    • Effective task settings: sandbox_mode=danger-full-access, approval_policy=never, reviewer user.
    • The active bundled CLI version was not established; a separately installed CLI is not presented as the rejecting runtime.

    Observed failure
    The owner explicitly requested removal of four agent-created temporary test directories inside the current workspace, then explicitly requested deletion again after the first denial. Read-only checks confirmed their exact absolute paths, workspace containment, directory type, and absence of reparse points on the directory roots.

    Both a guarded cleanup script and a standalone literal-path command were rejected before PowerShell started. Sanitized command shape:

    Remove-Item -LiteralPath '<workspace>\work\test-temp-a','<workspace>\work\test-temp-b','<workspace>\work\test-temp-c','<workspace>\work\test-temp-d' -Recurse -Force

    The only explanation was CreateProcess ... rejected: blocked by policy. No actionable rule identifier or approval path was exposed. The directories remain.

    User rules contained 132 allow rules and no prompt/forbidden rules. A non-executing codex execpolicy check returned {"matchedRules":[]}. Inspected AGENTS.md files contained no prohibition on this cleanup. These checks do not establish the hidden winning predicate.

    The published forced-delete heuristic and dangerous-command Never -> Forbidden branch are consistent with this failure, but no runtime classifier trace was available. The assistant initially misattributed the rejection to Auto-review; that explanation was corrected.

    Please expose the actual matched condition and the approval-policy conflict, clarify this limitation in Full Access, and provide a supported exact-action approval route. Repeated textual authorization currently leaves an opaque dead end and wastes substantial diagnostic time.

    No private paths, project contents, credentials, account/session identifiers, or raw logs are included. No alternate deletion executor or changed safety setting was used to complete the denied cleanup.

  18. HaggisSupper commented on Oct 29, 2026

    @HaggisSupper

    Additional Windows desktop evidence with bundled codex-cli 0.165.0-alpha.1.2.

    An explicitly authorized temporary-file cleanup containing PowerShell Remove-Item ... -Force was rejected before process creation with CreateProcess ... rejected: blocked by policy. The affected task's saved settings and runtime diagnostic tags recorded approval_policy=never and DangerFullAccess.

    Read-only investigation:

    • Recovered the original command and evaluated its shell argv with codex execpolicy check. Both the separate PATH CLI (0.165.0) and desktop-bundled CLI returned {"matchedRules":[]} against the inspected user rule file. The PATH CLI's --resolve-host-executables variant also found no match. These static checks do not reproduce the complete runtime safety decision.
    • The inspected user rule file contained allow rules only. No project configuration override was found along the diagnostic task's ancestor path. Documented local Windows managed-policy files were absent.
    • The bundled executable's supported app-server --print-startup-config diagnostic succeeded and reported configRequirements.requirements=null. This fresh startup diagnostic does not reconstruct all historical policy inputs of the existing desktop process.
    • A current, non-mutating runtime probe using Remove-Item -LiteralPath <nonexistent-workspace-file> -Force -WhatIf -ErrorAction Stop was rejected before PowerShell started with the same generic message. No probe file was created or deleted.

    The published source matching the bundled version supports the explanation: the Windows classifier treats a delete cmdlet combined with -Force as dangerous; the runtime fallback maps that classification to Forbidden under Never and Prompt under OnRequest; the Other rejection category renders only blocked by policy.

    This is a source-backed diagnosis corroborated by the non-mutating probe, not a directly logged classifier decision from the original denial. No evidence established an automatic-reviewer rejection. Cleanup did not execute; no alternate deletion mechanism, allow rule, or security-setting change was used. An approval-mode recovery was not tested.

    Expected behavior / suggested acceptance criteria:

    1. Identify the matched command-safety category with a stable reason identifier.
    2. Explain that Never prevents the approval required for this command even with Full Access.
    3. Offer a supported task-scoped review route where policy permits, rather than leaving the user with an unexplained hard denial.
    4. Include regression coverage for the non-mutating -Force -WhatIf case and distinguish static rule-check output from full runtime authorization.

    Impact: authorized remote cleanup remains blocked, and the opaque error sends investigation toward unrelated rules or configuration. This report requests actionable diagnostics and review, not removal of safeguards. No private paths, account details, thread identifiers, file contents, or raw logs are included.

  19. sylviema2002 commented on Oct 30, 2026

    @sylviema2002

    Additional Windows desktop occurrence on 2026-10-30, reported at the affected user's explicit request. Personal paths and account details are omitted.

    • Effective task settings: sandbox_mode=danger-full-access, approval_policy=never, unrestricted filesystem profile.
    • Read-only PowerShell checks succeeded. A stale installer directory (~858 MB; newest file from August) and four old updater executable files in the user's Temp directory were confirmed. No running process referenced those targets.
    • A guarded PowerShell cleanup using Remove-Item -Recurse -Force was rejected before process creation. A second, narrower command deleting only one literal-path Temp file using Remove-Item -LiteralPath '<user Temp>\\<old updater>' -Force -ErrorAction Stop was also rejected before process creation with exec_command failed: CreateProcess ... rejected: blocked by policy. No files were deleted.
    • Inspected local user config and likely local rules/requirements locations did not reveal an explicit forbid rule. This does not rule out built-in or remote policy. App package version could not be verified in this environment.
    • The user previously tried an approval-capable/workspace-write mode, but that session's available approval categories did not include sandbox approval, so it could not authorize this cleanup either.

    Could a maintainer confirm whether this specific forced-delete rejection is the expected Windows dangerous-command classifier + Never -> Forbidden behavior, rather than another policy layer? What is the supported user-reviewed path in the desktop app to authorize a bounded, exact-path cleanup without disabling safety checks? Please expose the matched condition in the tool error.

  20. kuziapkgpt1-hash commented on Nov 5, 2026

    @kuziapkgpt1-hash

    Confirmed a similar Windows cleanup case: Full Access with approvals set to never returned CreateProcess rejected: blocked by policy for user-authorized Remove-Item -Recurse -Force. After the user switched to the approval mode, separately approved commands ran: one Unity test project and four APKs were removed. Two other batches started but stopped on DirectoryNotFoundException for deeply nested Unity build paths; some folders remain. This supports the approval-mode recovery for those commands, not a complete cleanup or proof of the exact rejecting rule. The remaining long-path error is a separate Windows filesystem issue.

  21. IM-DaXiong commented on Nov 8, 2026

    @IM-DaXiong

    Windows cleanup report — 2026-11-08

    Adding a user-authorized report and asking for the supported recovery path.

    • Windows desktop package: OpenAI.Codex 26.1103.4239.0 (read from Get-AppxPackage).
    • Effective permissions supplied to this chat: sandbox_mode = danger-full-access, approval_policy = never.
    • The owner explicitly authorized deleting obsolete local Rust build caches. Separate read-only inventory identified the exact directories, ages, and directory links; current build artifacts, source, user data, and model files were excluded.
    • The most recent request targeted only the recorded old cache directories using native PowerShell Remove-Item -LiteralPath <exact-cache-directory> -Recurse -Force -ErrorAction Stop, with containment and reparse-point guards in the submitted script.
    • exec_command rejected process creation immediately: CreateProcess ... rejected: blocked by policy. The guards inside that rejected command did not execute, and this request deleted nothing. No matched rule, reviewer verdict, or approval control was returned.

    The published Windows forced-delete classifier and the dangerous-command Never -> Forbidden branch appear consistent with the observation, but we have no runtime trace establishing the actual matched rule. Calling the error an Auto-review verdict would therefore overstate what is known.

    Could maintainers confirm:

    1. Is switching the desktop chat to the interactive Ask for approval / on-request mode the intended supported remedy for this Full access / never conflict, and should it apply to an existing chat on this package version?
    2. Can the refusal identify the matched condition and provide an exact-action approval route, rather than the generic blocked by policy message?

    No private paths, repository identity, credentials, user files, raw logs, or chat transcript are attached. No alternative deletion executor or permission-setting change was used after rejection. Submitted with AI assistance at the owner's explicit request.

  22. mapmap5214 commented on Nov 9, 2026

    @mapmap5214

    Additional Windows desktop occurrence on 2026-11-09, submitted at the affected user's explicit request.

    Environment and failure

    • Windows 10, OS build 19045.
    • Locally installed codex.exe reports 0.167.0-alpha.3.2. The desktop package version and the exact build of every executor component were not independently collected.
    • Full access was selected. Saved chat context and desktop logs recorded approval_policy=never, sandbox_mode=danger-full-access, reviewer user.
    • The user explicitly authorized recursive cleanup of four agent-created development/test directories inside the workspace, including renewed authorization after the first rejection.
    • Separate read-only checks verified the resolved absolute paths, workspace containment, and absence of directory reparse points, including inside the trees. Total file size was about 1.24 GB.
    • Guarded PowerShell cleanup requests containing Remove-Item -LiteralPath ... -Recurse -Force were rejected before process creation, ending in rejected: blocked by policy. No matching condition, actionable rationale, or review route was returned.

    Observed recovery
    The user then changed the chat to Approve for me. The supplied execution context changed to workspace-write with reviewer auto_review. After fresh read-only checks, native PowerShell cleanup naming the same four exact targets succeeded with exit code 0. All four directories were confirmed absent, while the release archives' hashes remained unchanged.

    This was the same cleanup operation and target set, but not a byte-for-byte identical command A/B test: the successful request used a direct literal-path deletion rather than the earlier guarded loop. No separate reviewer verdict was returned to the agent. Therefore this confirms a recovery in this case, not that the mode change alone explains every rejection.

    Version-tagged source consistent with the behavior
    The published rust-v0.167.0-alpha.3.2 source still:

    1. Classifies a PowerShell delete cmdlet combined with -Force as dangerous, including an explicit Remove-Item ... -Recurse -Force test:
      https://github.com/openai/codex/blob/rust-v0.167.0-alpha.3.2/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs
    2. Maps the Windows classification to DangerousCommandMatch::Other:
      https://github.com/openai/codex/blob/rust-v0.167.0-alpha.3.2/codex-rs/shell-command/src/command_safety/is_dangerous_command.rs
    3. Maps a dangerous command with Never to Forbidden, and renders the Other category as only blocked by policy:
      https://github.com/openai/codex/blob/rust-v0.167.0-alpha.3.2/codex-rs/core/src/exec_policy.rs

    This is source-backed consistency, not a runtime trace proving the original classifier branch.

    Requested improvement
    Please expose the actual command-safety category and explain the conflict with non-interactive approvals, clarify the Full access wording, and provide a supported exact-action review path where policy permits. Switching to Approve for me resolved this user's cleanup, but the original generic error did not make that path discoverable.

    The report does not request removal of safeguards. No private paths, project identity/content, credentials, account or chat identifiers, raw logs, or transcript are included. No alternate deletion executor was used to bypass the denial.

  23. ScottBeeson commented on Nov 12, 2026

    @ScottBeeson

    Additional Windows desktop occurrence, posted at the affected user's explicit request.

    Observed environment

    • Tool: functions.exec → tools.exec_command, launching the bundled PowerShell.
    • Effective turn settings: sandbox_mode=danger-full-access, approval_policy=never, filesystem permission profile disabled/unrestricted.
    • The rejected executable path identified runtime package OpenAI.CodexPrimaryRuntime.v26-1104-2876-0_26.1104.2876.0_x64. This is the runtime package observed in the error, not a verified desktop About or Codex CLI version.

    Authorized task and separate checks
    The user explicitly asked to retry deleting two unnecessary, agent-created test directories and capture why deletion was blocked. Separate read-only commands verified:

    • One directory contained generated test binaries: 46 files / 11,431,743 bytes.
    • The other contained an isolated synthetic test fixture and its WebView2 cache: 143 files / 9,212,559 bytes, with no run history.
    • Both absolute paths were inside the project artifact directory; no reparse points were found.
    • The test host was not running, and no active source references to these directories were found.

    Complete submitted PowerShell command, with only the private project path replaced and line breaks added
    This is the observed compound command, not an independently tested minimal reproduction:

    $ErrorActionPreference = 'Stop'
    $cleanupRoot = 'C:\REPOS\ExampleProject\artifacts\native-integration'
    $cleanupTargets = @(
        'C:\REPOS\ExampleProject\artifacts\native-integration\native-check-build',
        'C:\REPOS\ExampleProject\artifacts\native-integration\ui-local-01'
    )
    foreach ($cleanupTarget in $cleanupTargets) {
        $resolvedCleanup = (Resolve-Path -LiteralPath $cleanupTarget).Path
        if ([IO.Path]::GetDirectoryName($resolvedCleanup) -ne $cleanupRoot) {
            throw 'Cleanup target outside verified directory'
        }
        $cleanupEntries = @(Get-Item -LiteralPath $resolvedCleanup) + @(Get-ChildItem -LiteralPath $resolvedCleanup -Recurse -Force)
        if ($cleanupEntries | Where-Object { $_.Attributes -band [IO.FileAttributes]::ReparsePoint }) {
            throw 'Cleanup target contains a reparse point'
        }
        try {
            Remove-Item -LiteralPath $resolvedCleanup -Recurse -Force -ErrorAction Stop
            [pscustomobject]@{Path=$resolvedCleanup;Deleted=!(Test-Path -LiteralPath $resolvedCleanup);Error=$null} | ConvertTo-Json -Compress
        } catch {
            [pscustomobject]@{Path=$resolvedCleanup;Deleted=$false;Message=$_.Exception.Message;ExceptionType=$_.Exception.GetType().FullName;ErrorId=$_.FullyQualifiedErrorId;Category=$_.CategoryInfo.ToString();Details=$_.ErrorDetails.Message} | ConvertTo-Json -Compress
            throw
        }
    }

    Result
    The tool failed immediately, before PowerShell execution:

    exec_command failed: CreateProcess { message: "Rejected(... rejected: blocked by policy)" }
    

    That block is an excerpt, not the full response. The returned error itself contained the literal marker …814 chars truncated… inside the echoed command. No untruncated underlying error, matched rule, policy identifier, or supported recovery action was exposed. Therefore the PowerShell catch block could not collect any Windows exception.

    Subsequent read-only inspection confirmed both directories remained, with identical file counts and byte totals. No alternative executor or deletion mechanism was used.

    The assistant initially called this an “automatic approval review” rejection. That attribution was unsupported by the returned error and should not be treated as a diagnosis. The command shape and settings match this issue, but the exact runtime decision path for this occurrence has not been established.

    Please expose the specific denial reason/rule and a supported way to complete bounded, explicitly authorized cleanup. Please also make the complete rejection diagnostic retrievable: truncating the only error leaves both user and agent unable to inspect it. Private project names, tenant/account identifiers, credentials, and raw session transcripts are omitted.

  24. ScottBeeson commented on Nov 12, 2026

    @ScottBeeson

    Follow-up to our earlier report: both temporary directories have now been successfully deleted, with their absence verified. Posting this update at the user's request.

    Observed sequence, using the same exec_command tool and PowerShell executor:

    1. Renamed both directories to temp-native-check-build and temp-ui-local-01 within the original artifact directory. File counts and byte totals were unchanged.
    2. Retried a short command naming only those two absolute paths with Remove-Item -LiteralPath ... -Recurse -Force -ErrorAction Stop. It was again rejected before process creation with blocked by policy. This shorter error was not truncated, but still supplied no specific rule or rationale. Temp-prefixed names alone did not resolve the failure.
    3. Moved both directories out of artifacts into the repository's temp directory, as requested by the user. Verified source paths were absent and destination file counts/byte totals were unchanged.
    4. On the user's next deletion request, checked resolved containment and absence of reparse points, then ran the following command without -Force (only the private project path is anonymized):
    Remove-Item -LiteralPath 'C:\REPOS\ExampleProject\temp\temp-native-check-build','C:\REPOS\ExampleProject\temp\temp-ui-local-01' -Recurse -ErrorAction Stop

    It returned exit code 0. Separate Test-Path -LiteralPath checks verified both directories were absent.

    Effective turn settings remained sandbox_mode=danger-full-access and approval_policy=never. No permission-mode change, alternate executor, or security-policy change was used.

    Evidence limit: both the directory location and the removal flags changed between the final rejected and successful attempts. This was not a controlled single-variable comparison, so it does not independently establish whether omitting -Force, moving the directories, or another factor caused success. It is consistent with the force-delete classifier evidence discussed in this issue, but the actual denial still exposed no matched rule.

    The cleanup is complete for this occurrence. The remaining product concern is the opaque denial: a specific reason and supported narrower alternative would have avoided repeated retries and user intervention.

  25. ScottBeeson commented on Nov 12, 2026

    @ScottBeeson

    Controlled follow-up to the earlier comparison: the user requested a test at the original directory names and original location under artifacts. This removes the location confound from that comparison.

    1. Confirmed both original paths were absent, then recreated them with one clearly marked EPHEMERAL-REMOVABLE-TEST.txt file each (111 bytes per file). These were new disposable fixtures, not restored user data.
    2. Checked resolved containment and absence of reparse points.
    3. Submitted this command (private project name anonymized):
      Remove-Item -LiteralPath 'C:\REPOS\ExampleProject\artifacts\native-integration\native-check-build','C:\REPOS\ExampleProject\artifacts\native-integration\ui-local-01' -Recurse -Force -ErrorAction Stop
      Result: prelaunch exec_command failed: CreateProcess ... rejected: blocked by policy.
    4. Separate read-only checks confirmed both fixtures remained unchanged.
    5. Submitted the identical command with only -Force removed:
      Remove-Item -LiteralPath 'C:\REPOS\ExampleProject\artifacts\native-integration\native-check-build','C:\REPOS\ExampleProject\artifacts\native-integration\ui-local-01' -Recurse -ErrorAction Stop
      Result: exit code 0. Separate checks verified both directories were absent.

    The tool, PowerShell executor, paths, fixture contents, and effective danger-full-access / approval_policy=never settings were unchanged between attempts. No alternate executor or permission change was used.

    This controlled test isolates -Force as the rejection trigger for this command, not the artifacts folder or original directory names. It supports the classifier behavior described in this issue. The error still did not expose the matched internal rule or explain that the narrower deletion could succeed. All test fixtures were cleaned up.

  26. henriSandovalSilva commented on Nov 20, 2026

    @henriSandovalSilva

    I ran into this during routine cleanup on Windows. With Full access and approval_policy = never, Codex tried to remove a directory of test artifacts using Remove-Item -LiteralPath with -Recurse -Force. The tool returned "blocked by policy" before PowerShell started.

    The practical cost was the diagnosis. Codex suggested changing my approval settings or deleting the folder myself in Explorer. In the same session, it later checked the path separately and ran the deletion without -Force. That succeeded, and we verified the directory was gone. Both the flag and the command structure changed between attempts.

    Could the tool say which part of the command triggered the decision and what the agent can do next? If forced deletion is what triggered it, a hint that ordinary deletion may be sufficient would have saved several rounds of troubleshooting.

  27. dominikkociecki commented on Nov 26, 2026

    @dominikkociecki

    Additional Windows Desktop occurrences, posted at the owner's request after reviewing local tool-call records from the past month.

    We confirmed five cleanup rejections in four separate conversations:

    • November 23: removal of document-generation intermediates was rejected twice, first in a guarded script and then as a standalone literal-target command.
    • November 24 (local time): cleanup of temporary document-review artifacts was rejected.
    • November 24: cleanup of temporary verification artifacts was rejected.
    • November 26: cleanup of two task-created temporary directories was rejected in a command that also contained final tests.

    All five used PowerShell Remove-Item with -LiteralPath, -Recurse and -Force. The recorded effective turn settings were approval_policy=never and sandbox_policy=danger-full-access. The tool returned a CreateProcess rejection ending in "blocked by policy", before the rejected PowerShell command started. Checks embedded in those commands therefore did not run; we do not present them as completed preflight validation. The November 26 error also truncated the echoed command.

    The latest occurrence invoked PowerShell from runtime package 26.1123.915.0; the earlier selected occurrences invoked it from 26.1119.907.0. These are package identifiers, not independently verified CLI engine versions at the moment of rejection.

    The impact is recurring unfinished cleanup and extra user intervention. Some assistant messages called the failure an automatic-review rejection, but the returned error does not establish that attribution or identify the matched rule.

    This matches the symptom discussed here, but we cannot establish that every occurrence has the same internal cause, or that it was introduced by the latest update. No cleanup or permission change was attempted during this investigation.

    Please provide the matched safety condition and an actionable, scoped approval route. Is switching the affected chat to an approval-enabled mode the supported recovery for this case?

    No filenames, directory names, locations, project names, account/session identifiers, file contents or raw logs are included.

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