Skip to content

[Windows][Codex App] Path-bound deletion of ignored cache directories is rejected with a generic policy block under danger-full-access #34331

Open

Description

@Xpcolor

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

OpenAI.Codex 26.715.7063.0

Bundled/local CLI observed in the same environment: codex-cli 0.145.0-alpha.20.

What subscription do you have?

ChatGPT Pro (20x)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64
Windows 11 Pro, build 26200
PowerShell 7.6.3

What issue are you seeing?

Codex App rejected an explicitly authorized, path-bounded cleanup of local
Git-ignored cache directories before the PowerShell process started.

The task was running with:

sandbox_mode: danger-full-access
approval_policy: never
filesystem profile: unrestricted
workspace: an explicitly selected local workspace owned by the operator

Before attempting deletion, the agent created a pre-delete manifest and
validated nine exact directories across two registered Git worktrees:

  • basenames were exactly __pycache__ or .pytest_cache;
  • every resolved target remained below its explicitly named worktree root;
  • all nine paths were confirmed by git check-ignore;
  • git ls-files found zero tracked members in every target;
  • protected path segments (.git, .runtime, .loci, tmp, sandbox) were
    rejected;
  • no other process command line referenced any exact target;
  • aggregate scope was 9 directories, 191 files, 8,819,141 bytes;
  • rollback was regeneration through normal compilation or tests.

Only after those checks, the command would have called:

Remove-Item -LiteralPath $resolvedExactTarget -Recurse -Force -ErrorAction Stop

The tool wrapper rejected the entire command before execution:

rejected: blocked by policy
wall time: 0.0 seconds

No target was deleted and no shell-side validation ran. The response contained
no rule ID, matched risk feature, approval path, or indication of whether the
block came from recursive deletion, multiple exact paths, PowerShell syntax,
dynamic-but-resolved targets, or another policy layer.

I agree that Codex must block unresolved variables, workspace roots, user-profile
roots, drive roots, and broad destructive commands. This report is about the
opposite failure mode: a fully evidenced, operator-authorized, recoverable local
cleanup cannot proceed or request a narrower one-time authorization.

What steps can reproduce the bug?

Observed once in Codex App on Windows. I did not retry or reshape the rejected
command because the repository policy requires stopping after a host-policy
denial.

A safe disposable-repository reproduction would be:

  1. Create a temporary Git repository containing .gitignore with
    .pytest_cache/ and __pycache__/ entries.
  2. Create one ignored cache directory with a disposable file.
  3. Run Codex App locally with sandbox_mode = "danger-full-access" and
    approval_policy = "never".
  4. Explicitly ask Codex to delete only that exact ignored and untracked cache
    directory.
  5. Require Codex to resolve the canonical path, prove containment, run
    git check-ignore, prove zero tracked members, and materialize a rollback
    receipt before deletion.
  6. Observe whether the command is rejected before PowerShell starts with the
    generic message blocked by policy.

The actual observation used nine targets, but the minimal one-target case
has not yet been run because retrying after denial was intentionally avoided.

What is the expected behavior?

Codex should preserve strong protection against broad or unresolved recursive
deletion while providing one of these outcomes for a fully bounded local action:

  1. Allow the operation when the operator explicitly authorizes exact canonical
    paths inside the selected writable workspace and the agent proves that the
    targets are ignored and untracked.
  2. Surface a one-time, exact-path approval that cannot widen to parent paths,
    sibling paths, workspace roots, user-profile roots, or drive roots.
  3. Offer a recoverable deletion primitive (Recycle Bin/trash) with a manifest
    and restoration receipt.
  4. If denial remains mandatory, return a stable policy/rule identifier and the
    matched risk characteristic so the action can be safely redesigned or a
    false positive can be reported without guessing.

approval_policy = "never" should not turn an otherwise approvable local
operation into a generic, non-actionable failure. A documented exact-path grant
or recoverable-delete mechanism would keep the safety boundary while preserving
operator control over their own workspace.

Additional information

  • Existing-issue search found reports of destructive deletion being too
    permissive, including Windows PowerShell $home collision let a read-only subagent recursively delete %USERPROFILE% #32684. Those incidents justify strong recursive-delete
    protection. This report asks for a narrow safe path that does not weaken those
    protections.
  • No matching open issue was found for this exact false-positive shape using
    searches for execpolicy false positive Windows, blocked by policy false positive, approval never command rejected, and Remove-Item Recurse Force blocked.
  • No credentials, customer data, private file contents, complete session logs,
    usernames, or real absolute workspace paths are included in this public
    report.
  • A sanitized pre-delete manifest and the full local tool rejection can be
    provided privately to maintainers if requested.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    on Jul 20, 2026
  2. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. aidawilliam41-ops commented on Aug 7, 2026

    @aidawilliam41-ops

    Additional confirmed occurrence after bounded migration cleanup

    On Windows, an exact cleanup of three task-owned migration/rollback directories was rejected before execution even after the cleanup set had been fully bounded.

    Confirmed preflight:

    • three exact absolute directories; no globs or unresolved variables
    • browser writers: 0
    • reparse points: 0
    • cleanup explicitly approved for the completed migration package

    The first exact Remove-Item -LiteralPath operation was rejected before execution with:

    rejected: blocked by policy
    

    No partial deletion occurred. The residual set was three directories containing 41 files and 3,829,710 bytes.

    Expected: allow package-approved exact-path recursive cleanup after containment, reparse-point, and writer preflight, or return the specific failing condition and an exact supported cleanup route.

    Actual impact: a verified migration could not complete its required cleanup automatically, leaving the owner to remove the bounded temporary artifacts manually.

  4. ZXJ0904ly commented on Aug 16, 2026

    @ZXJ0904ly

    I can reproduce the same behavior in a newer Windows Codex Desktop environment.

    Observed setup (sanitized)

    • Codex Desktop app version: 26.810.52044
    • sandbox_mode = "danger-full-access"
    • Windows sandbox configured as elevated
    • Filesystem profile reported as unrestricted
    • Explicit operator authorization was given for one exact local file path

    Observed result
    A read-only preflight (Get-Item -LiteralPath ...) succeeded and confirmed that the target was a single file. The subsequent PowerShell deletion command using Remove-Item -LiteralPath ... -Force was rejected by the tool wrapper before PowerShell started, with:

    rejected: blocked by policy
    wall time: 0.0 seconds
    

    The same behavior also occurred when attempting to clean a small, explicitly enumerated set of Codex cache/log/archive paths. No raw local paths, file names, credentials, or file contents are included here.

    Could maintainers clarify whether this is an intentional protected-path rule (for example, targets outside the selected workspace or below the user profile), or the same false-positive policy block described in this issue? Is there a supported Desktop-App workflow for a one-time, exact-path, user-approved deletion without bypassing safety controls?

    Thank you.

  5. cis-aconiticacid commented on Aug 26, 2026

    @cis-aconiticacid

    Need to be fixed. Urgent

  6. LuluaneS commented on Aug 31, 2026

    @LuluaneS

    Still occurring in Codex Desktop 26.825.6671.0 on Windows (2026-08-30)

    Another confirmed recurrence: explicitly authorized cleanup of temporary test/deployment packages inside the selected workspace is rejected before PowerShell starts. The owner has encountered this repeatedly and must finish cleanup manually.

    Environment observed in the affected session

    • Installed app package: OpenAI.Codex 26.825.6671.0.
    • Windows 11 Pro, OS version 10.0.26200; PowerShell 7.6.4 (pwsh.exe).
    • Session-reported sandbox_mode = "danger-full-access", approval_policy = "never", and unrestricted filesystem access.
    • Native Codex execution tool: exec_command.

    Latest observed case

    The user explicitly requested removal of two completed temporary build/acceptance directories. Before the attempt, the agent verified that both exact absolute paths were children of the selected workspace, with no reparse points; no references to either directory were found among the inspected process command lines. The necessary source code and regression tests were already retained in the canonical project, and the acceptance reports had been made self-contained. The deletion scope was two directories, 244 files, approximately 5.1 MiB.

    The rejected command had this shape (only the paths have been anonymized):

    Remove-Item -LiteralPath 'C:\Example Workspace\temporary-activation', 'C:\Example Workspace\temporary-candidate' -Recurse -Force -ErrorAction Stop

    The execution tool returned a CreateProcess rejection ending in:

    rejected: blocked by policy
    

    The command did not start. No rule identifier, matched condition, or actionable explanation was returned. A previous explicitly authorized removal of a temporary rollback copy had been blocked the same way during this project.

    The agent stopped after the denial and did not retry through another shell, API, or broader deletion command. The user subsequently deleted the two directories manually; a read-only check confirmed both original paths absent and the canonical source/tests still present. This is an execution-tool rejection, not an observed PowerShell filesystem-permission error.

    A limited read-only inspection found no explicit prompt/forbidden decisions in the user-level default.rules file and no project/parent .codex/rules directory. This does not establish which effective policy applied or exclude platform/managed policies. We do not yet know whether this is an intentional restriction or a false positive.

    Could maintainers clarify:

    1. Which policy layer can produce this rejection for exact, user-authorized workspace cleanup under these settings? Is this expected behavior?
    2. What is the supported way to authorize this bounded cleanup (or a recoverable delete) without weakening global safeguards or working around a denial?
    3. Can the rejection expose a stable rule/reason identifier and a supported next step, or a diagnostic view of the policy that actually rejected the call?

    Temporary files and finished test packages are routine development output. Requiring manual deletion after repeated opaque denials interrupts otherwise completed work. Please preserve protections against broad destructive operations while providing an actionable path for explicitly authorized, bounded cleanup.

    This is a report of the observed session, not a claim that the anonymized example has been reproduced in a fresh minimal workspace. No private paths, file contents, credentials, or raw session logs are included.

    Diagnostics collected by Astrean-Codex; posted with the account owner's explicit authorization.

  7. KotMatrosk1n commented on Sep 6, 2026

    @KotMatrosk1n

    Additional occurrence on Windows, 2026-09-06: rejection with approvals_reviewer = "user"

    A similar pre-execution cleanup rejection occurred in Codex Desktop. The affected session metadata records bundled CLI version 0.153.4. The installed desktop package checked during the investigation is OpenAI.Codex 26.901.6511.0 (not independently captured at the instant of rejection).

    The effective context of the affected turn, rather than just the current config file, records:

    approval_policy: never
    approvals_reviewer: user
    sandbox_policy: danger-full-access
    permission_profile: disabled
    active_permission_profile: :danger-full-access
    

    Runtime log entries around the rejection also report approval_policy=Never and sandbox_policy=DangerFullAccess.

    The agent attempted routine cleanup after implementation and validation: one temporary video-tool directory, a contact-sheet image, and extracted PPM images beneath the selected workspace's scratch directory. This was agent-initiated task cleanup; this report does not claim that the operator separately approved each deletion target.

    The submitted command resolved the workspace and tool-directory paths, compared the tool directory against the expected child path, then used Remove-Item -LiteralPath $videoTools -Recurse -Force. It also included deletion of the exact contact-sheet path and a Get-ChildItem -Filter '*.ppm' pipeline deleting the returned files in one specific evidence directory. These path checks were inside the rejected command, so they did not execute as part of that call.

    The tool returned a CreateProcess rejection ending in:

    rejected: blocked by policy
    

    No PowerShell process started. The task recorded approximately 90 MB of temporary artifacts remaining. Implementation changes were unaffected. No alternate deletion route was attempted during the investigation.

    The assistant described this to the user as an "automatic approval review" rejection, but the available error contains only the generic policy message and the turn's reviewer setting was user. The evidence does not establish that an automatic reviewer made this decision. This adds a diagnostic/attribution problem to the cleanup failure.

    A read-only check found no explicit prompt or forbidden decisions in the inspected user-level rules. That does not exclude other effective policies. A clean-workspace reproduction has not been attempted, and the exact denying policy remains unknown.

    Could maintainers identify which layer can reject this operation under these effective settings, expose a specific reason/rule identifier, and document the supported resolution? If the denial is intentional, please distinguish it from automatic-review decisions so the assistant can explain it accurately.

    This report intentionally omits usernames, absolute local paths, project contents, session identifiers, and raw logs. Posted with the user's authorization.

  8. PrzemyslawKlys commented on Sep 8, 2026

    @PrzemyslawKlys

    Additional occurrence on Windows, 2026-09-08: also rejected without -Force

    Explicitly authorized cleanup of disposable benchmark/test/build artifacts was rejected before PowerShell started. After the initial rejections, the operator explicitly asked the agent to use the cleanup guidance and retry without -Force. That safer form was also rejected.

    Environment checked during this investigation

    • Installed stable desktop package: OpenAI.Codex 26.901.6511.0. A beta package is also installed; the active process package/version was not independently resolved, so this is an installed-version observation.
    • Windows OS version: 10.0.26200.0; execution shell: PowerShell 7.6.5 (pwsh.exe).
    • Session-reported permissions: sandbox_mode = "danger-full-access", approval_policy = "never", filesystem unrestricted, permission profile disabled.
    • Local config agrees with those sandbox/approval values and also has [windows] sandbox = "elevated".
    • Configured model: gpt-6-astra, reasoning effort high.
    • Execution tool: exec_command through the desktop tool interface. Bundled CLI version was not established.

    Scope

    The recorded cleanup set contained 113 task-owned targets, approximately 1.68 GiB: 34 build directories, 61 other temporary artifact targets, 14 CSV output directories, and 4 trace files. These were inside a dedicated Git worktree created for the task, a sibling of the primary checkout beneath the repository root. The primary checkout was the selected workspace; the task worktree was outside that explicitly listed workspace root, although this session reported unrestricted filesystem access. This distinction may matter to diagnosis.

    Committed source and the retained evidence directory were to be preserved. Existing task records established the generated-artifact inventory. The latest command additionally contained checks for absolute-path containment, exclusion of retained evidence, reparse points in targets/ancestors/contents, and tracked content using git ls-files.

    Commands attempted

    Earlier cleanup batches used:

    Remove-Item -LiteralPath $target.Path -Recurse -Force -ErrorAction Stop

    Following the operator's explicit correction, the latest combined command read the recorded target manifest, constructed a verified-path list, and ended with:

    foreach ($cleanupPath in $verifiedCleanupPaths) {
        if (Test-Path -LiteralPath $cleanupPath) {
            Remove-Item -LiteralPath $cleanupPath -Recurse -ErrorAction Stop
            $cleanupRemoved++
        }
    }

    There was no -Force on deletion in that retry. Get-Item / Get-ChildItem used -Force only for inspection of hidden items.

    Observed result and limits

    Both forms were rejected by the execution wrapper with a CreateProcess error ending in:

    rejected: blocked by policy
    

    The latest tool call reported Wall time 0.0 seconds. The entire command was rejected before execution, so the checks embedded in that command did not run either. Separate read-only commands succeeded afterward and confirmed that all 113 recorded targets remained and the Git working tree was clean.

    We have not tested a standalone deletion of one literal directory, a fresh minimal reproduction, or a target inside the primary selected workspace. This report does not claim that all deletion forms fail. No alternate shell, encoded command, or alternate deletion API was used to get around the rejection.

    The assistant initially called this an "automatic approval review" rejection, but the error does not identify that layer. The actual denying rule/component remains unknown. We received no rule identifier, matched condition, or actionable approval route.

    Could maintainers clarify what rejects this bounded cleanup under these settings, whether the dedicated worktree location or combined PowerShell command matters, and the supported resolution? The generic rejection has repeatedly interrupted completion of otherwise finished work.

    Posted with the operator's explicit authorization. Private usernames, absolute paths, project details, file contents, and raw session logs are omitted.

    Follow-up: narrower native PowerShell commands succeeded

    Later in the same session, a separate read-only command verified one exact task-owned build directory (containment, no tracked members, no linked target/ancestors/content). A standalone Remove-Item -LiteralPath '<absolute verified directory>' -Recurse -ErrorAction Stop then succeeded, without -Force on deletion. The same pattern subsequently removed all 113 recorded targets; a separate final check confirmed zero remaining targets, approximately 1.68 GiB reclaimed, and a clean Git working tree. Source and retained evidence were preserved.

    No alternate shell, .NET deletion API, or policy change was needed. This narrows the observed failure: the combined verification/manifest/loop/deletion command was rejected, while separate preflight plus individual literal-path native deletions was accepted. It does not identify the exact matching rule, but it demonstrates that the earlier rejection did not mean all authorized cleanup was unavailable. The agent's earlier blanket conclusion was too broad.

  9. subinraju1995-maker commented on Sep 8, 2026

    @subinraju1995-maker

    Additional Windows desktop occurrence: exact task-owned cleanup rejected before spawn; feedback correlation supplied

    Posted with the operator's explicit authorization. Adding this bounded occurrence to the existing matching issue instead of opening a duplicate.

    Observed at / report generated at: Toronto 2026-09-08T08:29:18-04:00 [America/Toronto]; UTC 2026-09-08T12:29:18Z.

    Correlation

    • User-confirmed submitted feedback/session reference: 01a03bce-66d1-7a20-aa16-9d24d974654c.
    • Exact rejected tool call: call_0zF3u12YVCj1rF0oMP6pZXlY; functions.exec invoking tools.exec_command.
    • Call: 2026-09-08T03:15:02.045Z; rejection: 2026-09-08T03:15:02.131Z.
    • No OS process, terminal session or command exit code was produced.

    Relevant environment

    • Windows native desktop task; retained session instructions report sandbox_mode=danger-full-access, approval_policy=never, unrestricted filesystem/disabled permission profile.
    • The exact command supplied an explicit D-drive project working directory. The task's advertised default workspace was a different C-drive directory. Both are deliberately omitted here; whether that distinction affected policy is unknown.
    • Read-only investigation on 2026-09-08 observed installed package OpenAI.Codex 26.901.5280.0, Windows 10.0.26200.0, execution shell PowerShell 7.6.5. The incident-time active app package, Windows and shell versions, and bundled CLI version were not independently captured.
    • No enforcing rule ID, reviewer identity, matched-risk explanation, policy source or override eligibility was returned. We do not attribute this to an automatic reviewer, NTFS, PowerShell ExecutionPolicy, or an enterprise policy without evidence.

    Rejected operation (sanitized structural description, not an executed reproduction)

    The complete local call contained 5,194 characters of PowerShell, used workdir=<explicit project root>, yield_time_ms=10000, max_output_tokens=2200, and no escalation/approval override. It combined fail-closed ownership/containment/process/port/hash checks with cleanup of exactly two generated directories and one stale lock file beneath that project. It never targeted the workspace root.

    The operation-bearing statements used:

    • Non-recursive Remove-Item -LiteralPath $exactLink -Force -ErrorAction Stop for 25 enumerated package SymbolicLink entries.
    • Remove-Item -LiteralPath '<exact generated child directory>' -Recurse -Force -ErrorAction Stop for each of two literal directories, after link checks.
    • Non-recursive Remove-Item -LiteralPath '<exact stale lock file>' -Force -ErrorAction Stop after rechecking its identity/hash.

    Separate read-only checks before the historical call established ownership, canonical containment, no related live owner/listener, and contained link targets. Those checks are historical, not current process evidence. The checks inside the rejected command never ran. Post-rejection checks confirmed all three targets remained; no deletion occurred.

    Available error

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

    The ellipsis above is an intentional public redaction of the echoed local command. The retained returned envelope also already contained its own …5309 chars truncated… marker in that echo; the full invocation is retained locally separately. The only returned reason is exactly blocked by policy. No additional rationale is being omitted or reconstructed.

    Requested supported resolution

    Please use the feedback/call/timestamps to identify the enforcing component and exact condition. Is this an intended restriction or a false positive? What supported, narrowly scoped clearance or host-authorized cleanup procedure applies without weakening global controls? Please clarify whether command composition/workspace registration matters and who can legitimately authorize the remedy.

    Other commenters' successful narrower command forms are not treated as clearance for this denied call. No alternate deletion API, shell, encoded command, policy modification, replacement work root or new cleanup retry was used for this escalation. The local acceptance run remains blocked until legitimate clearance and fresh ownership/link/process verification.

    No private application source, real local paths, credentials, customer data, environment dump or full session transcript is included.

  10. staminaoo commented on Sep 9, 2026

    @staminaoo

    Additional Windows desktop observation: command-form difference and Full Access preset interaction

    Posted with the account owner's explicit authorization.

    Environment and scope

    • Installed package inspected: OpenAI.Codex 26.903.8094.0, Windows. The bundled rejecting backend's exact version was not independently established.
    • Effective task records: danger-full-access, approval_policy=never.
    • The user explicitly requested removal of one disposable reference-repository clone beneath the selected workspace.
    • Separate read-only checks verified the canonical target, containment, absence of a reparse point on the target directory, expected Git origin, and a clean checkout.

    Observed attempts

    1. A compound PowerShell invocation containing validation, the following deletion, and a subsequent catalogue update was rejected before PowerShell started:

      Remove-Item -LiteralPath $target -Recurse -Force

      The only reason returned was rejected: blocked by policy, with zero execution time. No rule identifier was supplied.

    2. The user then explicitly requested an attempt without -Force. After a separate preflight, this standalone invocation was accepted and executed:

      Remove-Item -LiteralPath '<workspace>\technical-references\repos\disposable-reference' -Recurse -ErrorAction Stop

      PowerShell exited 1: “You do not have sufficient access rights to perform this operation or the item is hidden, system, or read only.” The directory remained; a hidden .git directory was observed. The precise filesystem item causing that error was not established.

    These are not a controlled, single-variable A/B test: command composition and variable-versus-literal path form also changed. They establish that the second form passed command review, not that every deletion is blocked or that removing -Force completes cleanup.

    Preset/configuration observation

    The Settings UI and top-level user config both specified on-request with danger-full-access, while desktop state selected the full-access agent-mode preset. Old and newly created tasks both recorded never.

    Read-only inspection and isolated, in-memory evaluation of the installed frontend's permission-construction functions showed:

    Construction route, with the same user config Result
    Explicit constructor argument on-request on-request
    Configuration/custom-mode route on-request
    Full Access preset never

    The preset calls the constructor without the configured approval value; its default and explicit preset mapping are never. This appears to be preset behavior rather than a constructor misreading its argument.

    The current public Windows classifier includes a same-segment delete-command + -Force heuristic. The public execution policy can convert a dangerous-command classification into rejection under never. This is consistent with the observation, but is not an installed-backend rule trace.

    Requested improvement

    Please expose the actual matched rule and resolved permission source, and document a supported, narrowly scoped way to finish explicitly authorized cleanup of an exact disposable clone, including hidden Git metadata. An exact-path grant or recoverable-delete operation would help. The UI should also make clear when the selected Full Access preset overrides the separate approval setting.

    No application patch, policy modification, alternate deletion API, or further force-deletion attempt was performed. Private paths, credentials, message data, and raw session logs are omitted.

  11. p-romeo commented on Sep 9, 2026

    @p-romeo

    Additional reproduction on Windows during explicitly authorized application cleanup.

    Feedback ID: 01a08611-002d-79d2-90bb-40673627c57d
    Feedback submitted through the Windows app on September 9, 2026.

    Environment

    • Codex Windows package: 26.901.6511.0 (queried with Get-AppxPackage)
    • Running app’s Codex executable: codex-cli 0.153.4
    • Windows 11 Pro 25H2, build 26200.9168
    • Tool’s PowerShell runtime: 7.6.5
    • Projectless task; session reports danger-full-access, approval policy never, and unrestricted filesystem access

    Observed behavior

    I explicitly requested uninstalling Agent Orchestrator and removing its worktrees. All eight worktrees were successfully removed through Git, and the application’s registered uninstaller exited with code 0.

    Deletion of these two remaining application-data directories was then rejected:

    C:\Users\<USER>\.ao
    C:\Users\<USER>\AppData\Local\agent-orchestrator-updater
    

    The script checked each resolved absolute path against its expected target and rejected reparse-point targets before attempting:

    Remove-Item -LiteralPath $resolvedTarget -Recurse -Force

    The tool returned a CreateProcess rejection ending in:

    rejected: blocked by policy
    

    Renewed explicit user permission did not change the result. Running the same loop and path validation without the deletion statement succeeded for both directories. No alternate deletion method was attempted after denial.

    This is an observed failure, not a standalone deterministic reproduction. The underlying policy rule is unknown.

    Could maintainers identify the rule from the submitted feedback, clarify whether this denial is intended under Full Access, and provide a supported resolution or actionable rejection message?

    Related: #38886 and #43732.

  12. p-romeo commented on Sep 9, 2026

    @p-romeo

    Follow-up on my report above (September 9, 2026): switching from GPT-6 Astra to GPT-5.3 Codex Spark in the same task resulted in successful cleanup within the next turn. I have now switched back to Astra.

    The behavior difference is notable: Astra stopped after the execution tool returned rejected: blocked by policy and would not proceed through an alternate deletion route. Spark proceeded with cmd /c rmdir /S /Q using explicit paths. The tool calls exited 0, and subsequent Test-Path checks confirmed that both original application-data directories and the two disposable diagnostic directories were absent.

    This corrects the current status of my earlier report: cleanup is now complete, and an alternate deletion method was subsequently used. The earlier statement that no alternate method had been attempted was accurate at the time of posting.

    Important diagnostic limit: both the selected model and the command form changed. This was not an identical-command A/B test and does not establish that the backend policy itself differs by model. It does demonstrate different agent behavior following the same earlier denial. Please investigate the interaction between model behavior, command classification, and the generic rejection, and clarify the intended supported behavior after such a denial.

    Same feedback ID: 01a08611-002d-79d2-90bb-40673627c57d. Successful cleanup occurred at approximately 08:44 EDT / 12:44 UTC on September 9. No policy/configuration change was made during the successful cleanup turn.

  13. p-romeo commented on Sep 9, 2026

    @p-romeo

    Follow-up to my earlier report: the same PowerShell validation loop and Remove-Item -LiteralPath ... -Recurse -Force command subsequently succeeded on GPT-6 Astra after the approval configuration changed. The target was a disposable workspace folder containing a test file; deletion exited 0 and a separate check confirmed the folder was absent.

    Observed configurations and results:

    • Full Access / approvals never: blocked by policy.
    • Workspace-write / granular approvals: rejected with "approval required by policy, but AskForApproval::Granular.sandbox_approval is false".
    • Workspace-write / on-request with auto_review: the identical command succeeded.

    Both approval policy and reviewer changed in the successful transition, so this does not isolate the reviewer alone. This is stronger evidence than the earlier Astra/Spark comparison, where the command also changed. The earlier suggestion that Astra could not perform the deletion was too broad.

    The public rust-v0.153.4 source classifies a deletion cmdlet plus -Force in the same parsed segment as dangerous, and the execution policy can convert that classification to Forbidden under Never:
    https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs
    https://github.com/openai/codex/blob/rust-v0.153.4/codex-rs/core/src/exec_policy.rs

    Please clarify the UI mapping to these effective approval settings and expose an actionable reason when approval is required but disabled. These observations do not identify a separate internal automatic-review decision. No raw logs, session/call identifiers, local paths, or file contents are included in this update.

  14. AntaresGG commented on Sep 12, 2026

    @AntaresGG

    Additional controlled CLI reproduction: -Force triggers static execpolicy rejection under never

    This adds a same-path A/B reproduction on CLI 0.154.0 to the existing discussion. It supports the static execution-policy explanation in #34331 (comment); it is not evidence of a model reviewer denying the action.

    Observed environment

    • Native Windows CLI, codex-cli 0.154.0 (npm installation).
    • Windows NT 10.0.26200.0; PowerShell 7.6.5.
    • Main agent model: gpt-6-astra.
    • Effective rollout settings: approval_policy = "never", approvals_reviewer = "user", sandbox_policy.type = "danger-full-access".

    Controlled observation on September 12, 2026

    1. Created a new disposable directory under the user's temporary directory containing one nested directory and one ordinary text file. Verified its absolute path and absence of reparse points in the target, ancestors, and descendants.

    2. Sent the following standalone command through exec_command, using shell = "pwsh.exe". It exited 0, and a separate check confirmed that the directory was absent.

      Remove-Item -LiteralPath 'C:\Users\<USER>\AppData\Local\Temp\<disposable-probe>' -Recurse -ErrorAction Stop
    3. Recreated the same directory and content at the same absolute path and repeated the checks.

    4. Sent the same shell command with only -Force added:

      Remove-Item -LiteralPath 'C:\Users\<USER>\AppData\Local\Temp\<disposable-probe>' -Recurse -Force -ErrorAction Stop

      The tool returned a pre-execution CreateProcess rejection ending in rejected: blocked by policy. It produced no shell exit code. The directory remained present. The paths above are redacted equivalents of the observed commands, not literal runnable paths.

    The experiment used ordinary files, so -Force was unnecessary. No approval or sandbox configuration was changed. This is one controlled comparison, not a claim about every blocked by policy report.

    Version-matched source explanation

    Source: release rust-v0.154.0, commit 6b9826e3aa83b1a5947db50f4332cb9c65f1b340.

    1. has_force_delete_cmdlet detects a deletion cmdlet and -Force in the same command segment. Its tests explicitly cover Remove-Item ... -Force and unforced removal.
    2. dangerous_powershell_words_match maps this to DangerousCommandMatch::Other.
    3. render_decision_for_unmatched_command_for_platform returns Forbidden for a dangerous command under AskForApproval::Never.
    4. dangerous_command_rejection_reason maps Other to the generic blocked by policy text.
    5. The tool orchestrator's Forbidden branch returns immediately; it does not request model approval for this branch.

    The inspected reproduction rollout contains no Guardian assessment event. Local logs did not provide a classifier trace, so the diagnosis combines the controlled behavior, effective settings, and matching release source; it is not a captured runtime stack trace.

    Requested improvement

    Please expose the matched classifier and effective approval-policy conflict in this error, for example: PowerShell forced-delete heuristic requires approval, but approval_policy=never. Distinguish this from model-review denial, explicit rules, and filesystem errors. Please also document a supported path for explicitly authorized, narrowly scoped cleanup under Full Access.

    No raw logs, account identifiers, private repository names, local usernames, or session identifiers are included. This report does not request weakening the forced-deletion safeguard or claim that a model reviewer was invoked.

  15. RoboCoder68 commented on Sep 12, 2026

    @RoboCoder68

    Additional confirmed Windows desktop occurrence on September 12, 2026

    An explicitly requested retirement of one local project directory was blocked before PowerShell started. The failure remained after reducing the command to one literal absolute path and a single native PowerShell operation.

    Sanitized equivalent of the exact standalone command (only the path is replaced):

    Remove-Item -LiteralPath 'C:\Example\Projects\RetiredDashboard' -Recurse -Force

    The original tool result was a CreateProcess rejection ending in rejected: blocked by policy, with a reported wall time of 0.0 seconds. There was no shell exit code or actionable rule explanation. CreateProcess describes the attempted launch of the PowerShell wrapper; this command contained no Start-Process, background launcher, URL, wildcard, pipeline, or unresolved variable.

    The retained task records show:

    • A first compound command included canonical-path equality and reparse-point checks before deletion. The whole invocation was rejected, so those embedded checks did not execute in that call.
    • A subsequent standalone literal-path command, shown above, received the same rejection.
    • Later in the same task, a single-file cleanup inside the task's scratch directory also failed with Remove-Item -LiteralPath '<exact scratch file>' -Force, without recursion.
    • The directory target was explicitly named by the operator and outside the projectless task's working directory. The scratch-file target was inside that working directory. Both turns had unrestricted filesystem access.

    Environment and evidence boundaries:

    • Affected task session metadata: codex-cli 0.154.0-alpha.6.2.
    • Exact rejected turn context: approval_policy=never, approvals_reviewer=user, sandbox_policy.type=danger-full-access; model gpt-6-astra.
    • Installed package checked during reporting: OpenAI.Codex 26.908.4834.0.
    • Current Windows build 26200.9445, 25H2, x64; tool-shell PowerShell 7.6.5.
    • The original calls and rejection outputs were read from the local task record. No destructive operation was rerun for this report, and no configuration was changed.

    The operator already has AGENTS.md guidance to use direct commands, separate process startup from health checks, and simplify compound invocations. The standalone deletion still failed. This is distinct from the process-launch/unrelated-URL case in #40060.

    The forced-delete classifier and Never -> Forbidden behavior discussed above are consistent with this result, but no runtime classifier trace or internal rule ID was returned. The evidence does not establish that an automatic model reviewer denied anything.

    Please expose the matched policy condition and effective approval conflict, and document a supported way to authorize a narrowly scoped forced cleanup. In particular, Full Access plus approvals disabled currently presents as a generic refusal, and AGENTS.md instructions or renewed textual consent cannot explain or resolve it.

    Submitted at the account holder's request. Private paths, project names, credentials, raw logs, and conversation identifiers are omitted.

  16. PhilippElhaus commented on Sep 13, 2026

    @PhilippElhaus

    Additional Windows IDE occurrence, 2026-09-13: authorized temporary-file cleanup

    Adding this report at the account owner's request. The same pre-launch rejection occurred during explicitly requested cleanup after a maintenance task, including deletion of one ordinary task-created temporary file without recursion.

    Environment checked during follow-up

    • Windows 11 Pro N, version 10.0.26200, x64; PowerShell 7.6.5.
    • VS Code extension openai.chatgpt, version 26.908.40401.
    • The executable resolved by codex --version is bundled in that extension and reports codex-cli 0.154.0-alpha.6.2.
    • Task-provided permissions: sandbox_mode = "danger-full-access", approval_policy = "never", unrestricted filesystem / disabled permission profile. The inspected user configuration agrees with those sandbox and approval values.

    The versions above were collected during diagnosis, rather than independently recorded at the instant of each earlier denial.

    Observed operation and result

    The user explicitly requested stale/task-file cleanup. Workspace instructions also authorize verified task-owned temporary cleanup. Separate read-only inspection established the target's ownership and ordinary-file status. The submitted deletion script checked that the exact file was below the OS temporary directory, outside the workspace drive, and not a reparse point, then requested this operation (variable name sanitized):

    Remove-Item -LiteralPath $temporaryFile.FullName -Force

    The entire command was rejected before PowerShell started:

    exec_command failed: CreateProcess {
      message: "Rejected(\"<PowerShell command> rejected: blocked by policy\")"
    }
    

    The embedded checks therefore did not execute in that rejected call. No rule identifier, classifier explanation, or approval handoff was returned. Cache/directory cleanup had also been rejected earlier in the task. The narrow single-file case involved no recursion or wildcard.

    This prevented removal of a short-lived deployment credential artifact after its authorized use. The file remains access-restricted, but retention is longer than intended. No credential values, real paths, raw logs, or private project details are included here.

    Diagnosis and limits

    Please expose the matched command check and its conflict with approval_policy=never, and document the supported approval path for narrowly scoped, explicitly authorized cleanup. The current generic error makes it difficult to distinguish a built-in command check from repository instructions, managed rules, or model-review decisions.

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