Skip to content

Windows PowerShell execpolicy blocks benign CLI start subcommand with --server URL #45793

Closed as not planned

Description

@JustinAlloi

Environment

  • Codex CLI 0.154.0 on Windows NT 10.0.26200, PowerShell 7.6.6
  • approval_policy = "never", sandbox_mode = "danger-full-access"
  • Failure observed September 15, 2026 (America/New_York)

Problem

Codex rejects a harmless PowerShell command before pwsh.exe starts when a URL and the word start appear as separate arguments. It appears to mistake a CLI subcommand named start for PowerShell's URL-launch alias. The error is only rejected: blocked by policy; it does not identify the heuristic or matched tokens. This is not a user .rules deny rule or a sandbox restriction.

Minimal output-only reproducer observed in the affected Codex session:

Write-Output start http://127.0.0.1:8080

This was rejected before PowerShell ran. Changing either start or the URL let the output-only command run. Write-Output cannot launch a URL.

Real-world command that was rejected:

& .venv/Scripts/soft-ue-cli.exe --server http://127.0.0.1:8080 pie-session start --mode viewport --timeout 120

The URL is an argument to a local CLI; start is a separate subcommand argument. Removing the optional --server URL let the CLI auto-discover the same local bridge and start PIE. No project source or configuration was changed.

Expected behavior

Only classify an actual PowerShell start/Start-Process/Invoke-Item URL launch as dangerous. A URL passed to an unrelated local executable, or printed by Write-Output, should not be rejected. Genuine URL-launch commands should remain protected.

Likely cause and diagnostics

The Windows command-safety classifier computes has_url over the entire flattened PowerShell token list and separately tests whether any token is exactly start. Those tokens need not belong to the same invocation. This appears to be another manifestation of the broad-token false positive reported in #40060, but here start is a benign CLI subcommand rather than a Start-Process cmdlet.

Please constrain the URL-launch match to the actual invocation and report the heuristic/branch and matched arguments in the rejection error or diagnostic log. Regression coverage should include Write-Output start http://127.0.0.1:8080 and a local CLI with --server http://127.0.0.1:8080 ... start, while retaining a dangerous Start-Process https://example.com case.

Relevant failed tool call IDs: exec-17ed8c12-1488-4336-bda8-5adeb3c5a550 and exec-a9541df3-3b28-43cd-b02a-e7bd4b9c5d92. No private logs are attached.

Activity

  1. added
    bug
    CLI
    windows-os
    sandbox
    on Sep 15, 2026
  2. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

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

    CLIbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions