Skip to content

Windows: blocked by policy on legitimate PowerShell file creation despite Unrestricted Access #54543

Open

Description

@esera87

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

ChatGPT for Windows 26.1013.31256 (Codex & OWL)

What subscription do you have?

ChatGPT Pro (200)

What platform is your computer?

No response

What issue are you seeing?

Windows ChatGPT Codex: blocked by policy on legitimate PowerShell file creation despite Unrestricted Access

Description

I'm experiencing an unexpected security policy rejection while using Codex inside the official ChatGPT Windows desktop application.

Codex was implementing OAuth 2.0 authentication for Google Drive and Microsoft OneDrive in a legitimate C++ desktop application designed to back up and restore game save files.

During development, Codex attempted to create a C++ source file using PowerShell and System.IO.File.WriteAllText.

The command was rejected before the PowerShell process could start:

exec_command failed:
CreateProcess ... rejected: blocked by policy

No explanation was provided regarding which security policy or rule caused the rejection.

The Codex session was running with Unrestricted Access, and the user had explicitly authorized the operation.

Environment

Property | Value -- | -- Application | ChatGPT for Windows Engine | Codex & OWL Application version | 26.1013.31256 Release date | October 15, 2026 Issue observed | October 16, 2026 Operating system | Windows Codex access mode | Unrestricted Access Effective sandbox mode | danger-full-access Approval policy | never Execution tool | exec_command Shell | PowerShell Writing method | System.IO.File.WriteAllText Command length | 11,617 characters Target file | src/cloud_login.cpp

The effective Codex session configuration was reported as:

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

The local configuration file contained a different workspace setting, but the active session explicitly reported unrestricted access.

No matching local policy, rules or hook configuration was identified during the diagnostic investigation.

The specific rule responsible for the rejection remains unknown.

Successful Alternative

After diagnostics, Codex continued development using its regular apply_patch functionality.

This produced the following results:

  • src/cloud_login.cpp was created successfully.

  • OAuth 2.0 browser authentication and PKCE were implemented.

  • Local loopback callbacks were added.

  • Google Drive and OneDrive integration work continued.

  • The modified C++ code compiled successfully.

  • Additional automated authentication tests were initiated.

  • The existing working executable remained unchanged.

These results suggest that the original rejection was specific to the command execution request or its representation, rather than a general prohibition on OAuth functionality or C++ file creation.

They do not establish which specific policy condition caused the rejection.

Expected Behavior

A legitimate source-file creation request should execute normally when the environment permits it.

If a security policy rejects a command, Codex should provide actionable diagnostic information, including where feasible:

  • The policy category or rule responsible for the rejection.

  • Whether the rejection concerns the executable, command structure, command contents or destination.

  • Whether the rejection originates from the Codex environment or an external operating-system restriction.

  • Whether a supported alternative operation is permitted.

Codex should not automatically interpret one rejected command as a prohibition on all further development of the same feature unless that broader restriction is explicitly established.

Possible Cause

This may be a false positive in command screening, potentially related to the large PowerShell here-string, the embedded source code or another characteristic of the execution request.

The error occurred one day after the release of ChatGPT for Windows version 26.1013.31256.

A regression in this release is possible, but has not been established.

The available diagnostics do not demonstrate that Google OAuth, Microsoft OAuth, the Windows sandbox or Windows filesystem permissions caused the rejection.

Security Considerations

The development task was legitimate and explicitly authorized.

The application uses standard desktop OAuth mechanisms, including PKCE and local loopback callbacks.

No security protections were disabled to resolve this issue.

No attempt was made to bypass a confirmed security prohibition. Development continued through a separately available, standard Codex file-editing tool after verifying that this functionality was permitted and operational.

Requested Improvements

  1. Investigate possible false positives involving long PowerShell commands executed through exec_command.

  2. Review the interaction between Unrestricted Access and additional command-screening policies.

  3. Provide more descriptive diagnostic information instead of the generic blocked by policy message.

  4. Ensure Codex distinguishes a rejected command from a general prohibition on implementing a legitimate feature.

  5. Improve recovery guidance when a command is rejected but ordinary file-editing tools remain available.

Summary

A legitimate C++ source-file creation command was rejected with blocked by policy despite Unrestricted Access.

Other PowerShell operations, ordinary file writes, builds and tests succeeded.

The same planned functionality was subsequently created and compiled using apply_patch.

The exact cause of the original rejection remains unidentified.

Please investigate whether the Windows Codex command-screening system generated a false positive and consider improving the diagnostic information provided to users.

What steps can reproduce the bug?

Steps to reproduce

  1. Open Codex in the ChatGPT Windows application (version 26.1013.31256, powered by Codex & OWL).
  2. Start a C++ development project with Unrestricted Access enabled.
  3. Ask Codex to implement OAuth 2.0 desktop authentication for Google Drive and Microsoft OneDrive, using PKCE and a local loopback HTTP callback.
  4. Have Codex create src/cloud_login.cpp using PowerShell, a multiline here-string and System.IO.File.WriteAllText.
  5. The original command contained 11,617 characters.
  6. Observe that the process is rejected before PowerShell starts.

Error message

exec_command failed:
CreateProcess ... rejected: blocked by policy

Original command structure

$taskSource = @'
#include "cloud_login.hpp"

// C++ OAuth 2.0 implementation
// Browser authentication, PKCE, local loopback callback
'@

[System.IO.File]::WriteAllText(
    'C:\Path\To\Project\src\cloud_login.cpp',
    $taskSource,
    [System.Text.UTF8Encoding]::new($false)
)

This is a simplified representation, not a confirmed minimal reproduction.

Diagnostics

  • Effective sandbox mode: danger-full-access
  • Approval policy: never
  • Repeating the original command resulted in the same rejection.
  • Other PowerShell commands executed successfully.
  • Harmless PowerShell file-writing tests succeeded.
  • File creation using apply_patch succeeded.
  • Existing builds and automated tests succeeded.
  • The same planned functionality was subsequently implemented using apply_patch and compiled successfully.

The rejection therefore appears to be specific to the original command rather than a general restriction on file creation or OAuth development.

The exact triggering policy remains unknown.

No session ID, token usage or context-window measurements are available for this report.

What is the expected behavior?

Codex should allow legitimate source-file creation when the active environment permits it.

If a command is rejected by a security policy, Codex should provide actionable diagnostic information instead of only displaying blocked by policy.

Ideally, the error should identify:

  • The policy category or rule responsible for the rejection.
  • Whether the problem concerns the executable, command content, command length, destination path or another restriction.
  • Whether a supported alternative operation is available.

A single rejected command should not automatically prevent Codex from continuing legitimate development using other permitted tools.

Unrestricted Access should not be interpreted as disabling all security protections, but unexplained rejections should provide enough information for developers to diagnose them.

Additional information

Application information

  • Application: ChatGPT for Windows (Codex tab)
  • Powered by: Codex & OWL
  • Version: 26.1013.31256
  • Release date: October 15, 2026
  • Issue date: October 16, 2026
  • Subscription: ChatGPT Pro
  • Access mode: Unrestricted Access

Additional observations

The issue occurred one day after the Windows application release. A regression is possible, but this has not been confirmed.

The original command was rejected before process creation. The C++ code itself was not executed.

Subsequent diagnostics confirmed that PowerShell, ordinary file writes, compilation, automated tests and apply_patch were operational.

Codex initially treated the rejection as preventing alternative file-writing methods. After an explicit diagnostic investigation, it successfully continued using the standard apply_patch tool.

The OAuth implementation then compiled successfully, and further automated tests were initiated.

No matching local policy, hook or rules file was identified.

Why this matters

The generic blocked by policy message makes it difficult to distinguish legitimate security enforcement from possible false positives or tool-execution bugs.

This may unnecessarily interrupt development even when other permitted tools are available.

Please investigate the original command-screening rejection and consider improving diagnostic feedback for Windows developers.

Attachments

Screenshots of the original rejection, diagnostic findings and successful subsequent compilation can be provided.

No security protections were disabled, and no credentials or access tokens are included in this report.

Activity

  1. added
    app
    on Oct 16, 2026
  2. added
    bug
    windows-os
    sandbox
    tool-calls
    on Oct 16, 2026
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

    appbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions