codex icon indicating copy to clipboard operation
codex copied to clipboard

Windows Full access: temporary cleanup rejected with "blocked by policy" and no decision rationale

Open gggroma opened this issue 2 weeks ago • 4 comments

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

26.1106.6628.0 (verified installed Windows package; About dialog not independently checked)

What subscription do you have?

Signed in with ChatGPT; subscription tier not verified.

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64

What issue are you seeing?

An explicitly authorized cleanup of task-created temporary Python tooling was rejected before execution with only "blocked by policy", even though the recorded session had Full access. The error did not identify the matched rule, policy source, affected path, specific operation, or a supported approval/recovery route.

The intended action was limited to a temporary Python script and its dependency folder in one operation-owned directory, while retaining evidence and recovery snapshots. The proposed command included absolute-path validation, reparse-point checks, and a guard against deleting tooling used by running probe processes. Those checks were inside the rejected command; this report does not claim they executed as part of that attempt. Separate read-only inspection later confirmed task ownership and no reparse points.

The available error was a CreateProcess rejection ending in:

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

This is a redacted excerpt of the recorded tool error, not the complete original command. No decision rationale accompanied it.

Effective permission settings recorded for the session:

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

No project config override, local managed requirements file, or forbidden rule explaining this denial was found in the inspected locations. These checks do not rule out built-in, cloud-managed, or host/tool enforcement. The exact rejecting layer remains unknown.

The practical problem is that a routine cleanup cannot be diagnosed or completed reliably from a generic policy-denial message. The rejection alone does not establish whether the operation was unsafe, misclassified, or affected by a configuration/runtime issue.

What steps can reproduce the bug?

Feedback ID: 01a1d0d0-bd89-7ae2-98fa-dbd5953aae4c

What is the expected behavior?

Evaluate bounded, authorized temporary-artifact cleanup consistently with effective permissions and applicable policy.

When an additional policy requires denial, return enough information to diagnose it:

  • The enforcement layer and policy source.
  • The matched rule or policy identifier.
  • The specific operation or path that triggered it.
  • An actionable risk rationale.
  • A supported correction or user-review route, or an explicit statement that no override exists.

Make any limits that remain under Full access visible. The request is for an actionable diagnosis and correct enforcement, not an unrestricted safety bypass.

Additional information

Related report found during issue search: https://github.com/openai/codex/issues/54610 The symptoms are similar, but a shared root cause has not been established. This report adds the feedback/session ID above and a separate November 12 observation.

Verified during local investigation:

  • Installed desktop package: 26.1106.6628.0.
  • Primary runtime package: 26.1111.574.0.
  • Separately installed Codex CLI: 0.167.0; this does not establish the desktop-bundled CLI version.
  • Read-only commands worked.
  • The available session/tool record contained no detailed policy rationale.
  • No permission configuration changes or bypass tests were made by the agent during the investigation.

Private project paths, local usernames, credentials, infrastructure identifiers, evidence payloads, and full transcripts have been omitted.

gggroma avatar Nov 12 '26 21:11 gggroma

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

  • #59934
  • #60171
  • #61148
  • #60790
  • #60514

Powered by Codex Action

github-actions[bot] avatar Nov 12 '26 21:11 github-actions[bot]

Additional bounded-cleanup reproduction — 13 November 2026

I observed the same opaque pre-execution rejection in a separate Codex Desktop session. The requested cleanup involved six task-created JSON intermediates and their single owned run directory, after the business workflow had completed and its durable records had been verified. No private payloads or raw logs are attached.

Observed environment

  • Windows 11 Pro x64, version 10.0.26200, build 26200 (queried from Windows).
  • Running desktop package path identified OpenAI.Codex_26.1106.6628.0; the About dialog was not independently inspected.
  • Command error identified PrimaryRuntime 26-1111-574-0. The exact bundled CLI/build responsible for the decision is not established.
  • Session/configuration reported sandbox_mode = "danger-full-access", approval_policy = "never", approvals_reviewer = "user".

Observed behavior The user explicitly authorized cleanup. Both a guarded recursive PowerShell cleanup and a narrower command listing the six files individually followed by removal of the empty directory were rejected before process launch:

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

The displayed error provided no matching rule, enforcing component, detailed rationale, or review action. The original command text is redacted here; the excerpt is not a runnable reproducer.

Separate read-only checks that actually ran

  • Verified the exact run path under %CODEX_HOME%/tmp/runs/, its owner marker, and the inventory of six expected files; found no symlink or junction in the run or entries.
  • The current Windows account had FullControl on the directory; files were not marked read-only.
  • Opened each file and the directory with Windows CreateFileW, requested access DELETE, shared read/write/delete, OPEN_EXISTING, and without FILE_FLAG_DELETE_ON_CLOSE; every handle opened successfully (error 0) and was closed. Nothing was deleted by this diagnostic. This verifies the observed Windows access check, not permission from every Codex policy layer.
  • The local rules directory was empty; an accessible Codex log reported zero local rule files loaded. This does not exclude built-in or managed policy.
  • Read-only shell commands and a Python inventory/ownership check succeeded. No equivalent deletion was attempted in Python or another executor after the denial.

OpenAI’s AI support assistant requested the active Windows sandbox implementation, Windows build and a sanitized sandbox log. The local configuration says windows.sandbox = "elevated", while the session reports full access; I cannot infer which component enforced this particular rejection from that setting alone. No human investigation reference has been issued.

Could maintainers identify the enforcing layer and predicate for this bounded cleanup, and provide a supported correction/review route or an explicit explanation of the limit under Full access? The request is for actionable diagnostics and correct enforcement, not a safety bypass.

No credentials, personal account details, full local paths, customer data, raw logs or private session identifiers are included.

ParlonIA avatar Nov 13 '26 00:11 ParlonIA

Additional November 13 reproduction: effective desktop settings confirmed in the application log

The same pre-execution rejection occurred at 2026-11-13 08:32:16.168 UTC (10:32:16 Africa/Cairo). This adds evidence from the desktop host log, rather than relying only on the configuration file.

Verified environment

  • Windows version 10.0.26300, build 26300, queried from Windows.
  • Running desktop package: 26.1106.6628.0; About dialog not independently inspected.
  • PowerShell executor identified in the rejection: PrimaryRuntime 26-1111-574-0.
  • The running app-server executable reports codex-cli 0.167.0-alpha.4.1 when queried with --version. This does not establish that it is the component enforcing the denial.

Effective settings

  • Desktop host log at 08:29:10.560 UTC: resolvedApprovalPolicy=never and resolvedApprovalsReviewer=user.
  • Initial chat setup log at 08:27:47.268 UTC also records requestPermissionProfile=:danger-full-access.
  • The rejected turn context independently records approval_policy=never and sandbox_policy.type=danger-full-access.

Observed operation

  • User-authorized collection of generated, isolated cleanup verification copies.
  • An exact manifest identified 33 bounded file/directory targets, totaling 456344859 logical bytes.
  • Separate checks completed before the rejected call: root containment, file fingerprints, exclusive-read availability, and exclusion of Git repositories and reparse points. Recovery backups and verification reports were retained.
  • The deletion tool call returned a CreateProcess rejection ending in "blocked by policy", with reported execution time 0.0 seconds. A subsequent check confirmed all 33 targets still existed.
  • Tool-call correlation ID: call_4fa8c39c398e4a5c8478056f60845539.
  • Feedback/session ID for maintainers: 01a1d405-1a0d-7423-9dbc-ff5fadb74b97.

Diagnostic limits

  • No matching rule, decision ID, rationale, or supported review action was found in the inspected current-day desktop logs. The root log database was empty; the legacy log database contained older entries and no matching rejection.
  • The error alone does not prove that ordinary Auto-review made this decision. The effective reviewer was user, and the documentation says Auto-review applies to interactive approval policies, not never. The enforcing layer remains unknown.
  • No equivalent deletion was retried through another executor, delegated agent, elevation, or changed security settings.
  • Private filesystem paths, file payloads, credentials, and raw transcripts/log files are omitted.

Could maintainers correlate the timestamp and identifiers with the policy decision, identify the enforcing component and matched predicate, and provide a supported correction or review path? This is a request for actionable diagnostics, not an unrestricted bypass.

gggroma avatar Nov 13 '26 08:11 gggroma

This still occurs with codex-cli 0.167.0-alpha.4.1, approval_policy=never and sandbox_mode=danger-full-access.

The corresponding source tag provides a plausible explanation for the latest local-server rejection:

  • Windows command classification falls back to opaque classification when the script contains a pipe. It can then associate a URL elsewhere in the script with Start-Process. Our rejected command set a loopback URL in an environment variable, launched a local EXE and piped its process information to Select-Object.
  • Execution-policy handling maps a dangerous-command match to Forbidden under Never, before the ordinary unrestricted-access path.
  • A subsequent read-only PowerShell request to fetch these source files and search their text was also rejected before execution. It contained URLs and Start-Process only as search data; it would not launch a process.

These observations fit an overly broad heuristic, but we still have no internal decision trace proving which rule fired. The local rules contain allow entries only; no security settings, rules or bundled binaries were changed. This is not an attribution to approval auto-review.

Could the rejection identify the matched classifier/reason, and could the quoted-search-text and unrelated-configuration-URL cases be covered by regression tests? A full-access session currently turns these ordinary development operations into repeated manual launches.

Concrete examples

Negative example — rejected operation, reduced and anonymized:

$env:ASPNETCORE_URLS = 'http://127.0.0.1:18869'
Start-Process -FilePath 'C:\LocalPreview\Preview.exe' -WindowStyle Hidden -PassThru |
    Select-Object Id, ProcessName

The original command of this shape was rejected before execution with blocked by policy. The URL configures the local server; it is not an argument asking Start-Process to open a URL. This shortened example has not been independently reproduced.

Positive example — observed successful operation in this issue:

Invoke-RestMethod 'http://127.0.0.1:18229/api/health'

The health GET succeeded. Therefore, a loopback URL alone does not explain the rejection.

There is also a narrower source-level control: the same tag contains the test powershell_start_process_local_is_not_flagged, which expects Start-Process notepad.exe not to be flagged by this classifier. This is an upstream test assertion, not a successful launch I verified in the affected desktop session.

The suspected distinction is the combination of a URL, a launch-related token and opaque whole-script classification; even a quoted pipe can select that fallback. These are diagnostic examples, not a proven minimal A/B reproducer or a guarantee that removing one token will make a command run. The missing decision trace is still the key uncertainty.

UweKeim avatar Nov 13 '26 10:11 UweKeim