Skip to content

Windows desktop: compound local browser-test command rejected before execution without policy rationale #51791

Open

Description

@connorchristensen90

Observed problem

A source-free local browser acceptance test cannot be started through exec_command. The same bounded invocation was rejected twice before process creation with:

exec_command failed: CreateProcess
Rejected(... rejected: blocked by policy)

The response does not identify the rule, component or supported remediation. The test has not run; this is not a browser-launch error or a failure at a third-party website.

Installed environment

  • Windows desktop package: OpenAI.Codex 26.1002.7124.0.
  • Codex executable resolved on PATH: codex-cli 0.128.0-alpha.1. This is an installed executable observation, not attestation of the rejecting app-server build.
  • Active task reports danger-full-access with approval policy never.
  • No user rules directory or project-local .codex directory was found at the inspected locations.
  • Read-only diagnostic queries recovered the rejection but no named enforcement rule. No security settings were changed.

Bounded operation

The PowerShell command was intended to create a uniquely named temporary test directory, restrict that new directory to the current user, launch an existing Node/Playwright test against an invented loopback PDF, and remove the empty parent afterward. It does not attach to a personal browser profile, navigate an external source system, use credentials, or read clinical/customer content.

The command combines environment-variable cleanup, Get-ChildItem -Force for an empty-directory check, and non-recursive Remove-Item for the newly allocated parent. No Remove-Item command was passed -Force. The entire invocation was rejected before any of these operations ran. The original command remains private; no raw logs, local paths or session identifiers are included here.

Static diagnostic candidate, not confirmed cause

In upstream source tagged rust-v0.128.0-alpha.1 (commit 8148b7b), parse_powershell_invocation uses shlex_split, while has_force_delete_cmdlet checks token segments for a delete cmdlet and a -Force token. Because ordinary newline boundaries may be consumed during tokenization, a -Force option belonging to a directory listing may be associated with a separate Remove-Item command.

Source:
https://github.com/openai/codex/blob/8148b7b1f8660e464661743587f754471ae60868/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs

This is a static hypothesis, not a confirmed runtime diagnosis. No full-policy side-effect-free evaluator or winning decision was exposed. The source tag has not been attested as the build that rejected the operation.

Requested resolution

Please identify the blocking component/rule and provide a supported remediation or side-effect-free diagnostic. If the operation is intentionally restricted, please expose an actionable rationale. If command tokenization causes the refusal, please investigate preserving command/parameter ownership when evaluating multiline PowerShell.

We have not changed policy, disabled protection, moved the operation to another executor, or repackaged the rejected action to get around enforcement. We are requesting a supported fix, not a bypass.

Related similar diagnostic gap: #50979. A shared root cause is not established.

Follow-up: running executable and static PowerShell parse (2026-10-07)

The currently running Codex executables resolve to the same binary; their file bytes differ from the older PATH-resolved CLI. Invoking that running executable with only --version reports codex-cli 0.162.0-alpha.2. The 0.128.0-alpha.1 observation above remains true for the PATH copy, but must not be used to identify the current desktop runtime. No application or PATH configuration was changed.

The corresponding upstream tag rust-v0.162.0-alpha.2 resolves to commit 74e804deeb1241d5fe699b31fb319f7d46454c42. Its Windows classifier still uses shlex_split followed by the force-delete segment check:
https://github.com/openai/codex/blob/74e804deeb1241d5fe699b31fb319f7d46454c42/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs

Separately, the original rejected script was recovered locally and passed as DATA to PowerShell's Parser.ParseInput; the script was NOT executed. Results:

  • Parser errors: 0.
  • Three Remove-Item command ASTs: none has a Force parameter.
  • The two environment-variable cleanup commands each have only ErrorAction as a named parameter.
  • The temporary-directory cleanup has only LiteralPath as a named parameter.
  • The single Force parameter belongs to Get-ChildItem, with LiteralPath, for an empty-directory check.

This verifies actual parameter ownership and strengthens the token-boundary false-positive hypothesis. It does not prove which enforcement component evaluated the rejected invocation, reproduce the compiled full-policy decision, or attest a historical runtime binary.

Please check whether the force-delete predicate is combining the listing's flag with a separate cleanup command after newline tokenization, and expose the winning rule or a supported diagnostic. No further rejected-script execution, repackaging, policy changes, alternate executor, new test run, raw logs, user paths or confidential payloads are included in this follow-up.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    tool-calls
    on Oct 7, 2026
  2. connorchristensen90 commented on Oct 17, 2026

    @connorchristensen90
    Author

    Follow-up: specific supported next step requested (2026-10-17)

    This remains blocking. On October 16, a separate attempt to start a bounded, locally owned, read-only sandbox collector was also rejected by the execution tool as blocked by policy before process creation. No collector process, source-page read or report generation started. The intended operation was two controlled page reads followed by a protected local review.

    This newer occurrence is not the original compound PowerShell test. We do not know whether they share a cause; the earlier tokenization explanation remains only a hypothesis. The version observations above are dated October 7, not a newly verified description of the current runtime.

    Could a maintainer please provide a specific fix or actionable next step:

    1. Which enforcement component/rule rejected the launch, and how can we obtain its decision/reason safely without executing the blocked collector?
    2. Is there a fixed desktop build, documented configuration correction, or supported approval/review path? Please identify the exact action and how to confirm that it resolves the restriction without disabling protections.
    3. If this is intentional or belongs to another team, what is the supported workflow or escalation destination? In-app feedback was also submitted, but we do not have independently verified ticket correlation. Please provide a private channel for any necessary reference or sanitized diagnostics.
    4. If this issue is a duplicate, please identify the canonical issue and its applicable remediation, rather than only possible matches.

    We have not retried the collector for this follow-up, changed permissions or security settings, or repackaged the blocked launch through another executor. We are requesting supported resolution, not a bypass. No credentials, session identifiers, private paths, source-system URLs, customer/resident information, raw logs or source payloads are included.

  3. EIDOSDATA commented on Oct 20, 2026

    @EIDOSDATA

    Additional evidence for the newline/option-ownership candidate in this issue (also related to #54533).

    Observed rejection

    Two preserved multiline PowerShell request forms to start local Python Host tests were rejected by exec_command before process creation with CreateProcess ... rejected: blocked by policy. The tests did not start. The recorded execution settings were approval_policy=never and sandbox_mode=danger-full-access.

    The desktop backend reports codex-cli 0.163.0-alpha.10.2; application startup logs from the rejection sessions identify the same backend path and version. The desktop package is OpenAI.Codex 26.1013.4894.0. The winning runtime predicate and evaluated argv were not exposed.

    Parameter ownership and data-only reproduction

    In both original scripts, line 1 is Remove-Item -LiteralPath Env:PYTHONHOME -ErrorAction SilentlyContinue, with no -Force. Separate environment assignments follow. Line 5 creates a temporary directory using New-Item -ItemType Directory -Force; this is the only command that owns -Force.

    Both unchanged original script strings were parsed as data using PowerShell Parser.ParseInput: zero parse errors, five assignment statements per script, and Force assigned only to New-Item. Neither script was executed during this investigation.

    A bounded Python translation of the matching public fallback, checked against the locked shlex 1.3.0 source for the input syntax involved, produces a force-delete match for both original strings:

    Check Original request A Original request B
    Input newline count 7 8
    Newlines retained in shlex tokens 0 0
    Actual PowerShell Remove-Item has Force false false
    Modeled force-delete predicate true true

    In the model, newline tokenization places the remove-item atom and the other command's -force atom in the same segment. The Python model matches the expected outcomes for three unmodified upstream test inputs: actual forced deletion is flagged, non-forced deletion is not, and the existing separate-command benign-Force control is not. The compiled Rust tests were not run.

    This is a source-model reproduction, not execution of the compiled Rust guard or proof of the actual rejecting runtime branch.

    Relevant source and diagnostic limits

    • Windows classifier at the matching backend tag: parse_powershell_invocation uses shlex_split; has_force_delete_cmdlet then scans for delete/Force atoms in a shared segment.
    • PowerShell literal parser and core fallback: static source inspection indicates that the original environment assignments are outside the literal parser's supported forms, supporting the whole-invocation Generic fallback path. This parser-path inference has not been validated by running the compiled Rust parser.
    • Stable 0.163.0 has the same Windows classifier. The inspected 0.164.0-alpha.7 includes Avoid false URL-launch detections in literal PowerShell commands #54076, but static inspection of its unchanged literal parser indicates these assignments remain unsupported. That PR therefore does not establish a fix for these requests.
    • The rules-only execpolicy checker supplies no heuristics fallback, so it cannot establish the effective built-in policy decision for this case.

    Please confirm the rejecting predicate, add compiled regression coverage for newline-separated environment cleanup plus New-Item -Force, and preserve command/parameter ownership while retaining actual forced-delete safeguards. An actionable matched-condition diagnostic or a supported side-effect-free effective-policy evaluator would also help.

    No security setting, installed binary, or safety rule was changed. The denied Host launch was not retried during this investigation or moved to another executor. Original evidence remains preserved locally. This public report excludes account names, personal/local paths, repository identifiers, credentials, raw device identities, private backups, session identifiers, and raw logs.

  4. connorchristensen90 commented on Oct 25, 2026

    @connorchristensen90
    Author

    Follow-up: actionable collector-launch resolution requested (2026-10-24)

    Following up on our October 17 comment. The October 16 read-only sandbox collector launch remains on hold after the execution tool returned blocked by policy before process creation. We have not retried it, so we are not claiming a newly reproduced failure on the current release.

    Thank you for the additional PowerShell analysis above. It is a useful lead, but the source-model reproduction does not establish the enforcing condition for our separate October 16 collector invocation or identify a confirmed fix.

    Could a maintainer provide one concrete next step:

    1. Confirmed fix: the exact desktop/backend build, linked fix, or narrowly scoped documented configuration correction applicable to this rejection, plus how to verify it without starting the collector.
    2. Non-executing diagnostic: a supported way to obtain the actual rejecting component, matched condition and effective decision for the preserved request. A rule-file-only check would not establish an unspecified built-in/tool-side decision.
    3. Review/escalation: the responsible team or private support route and the minimum sanitized metadata needed to correlate our existing in-app feedback. If this needs a separate issue, please identify the correct destination and whether the PowerShell hypothesis is relevant.

    The offline connection is prepared, but we will not treat that as native-session/containment qualification or authorization to override the hold. No reports, collector launches, policy/permission changes, alternate executors or repeated acceptance checks were performed for this follow-up.

    Please do not require a clinical-data upload or live report reproduction. This comment contains no credentials, resident information, private source URLs/paths, session identifiers or raw logs.

  5. connorchristensen90 commented on Oct 26, 2026

    @connorchristensen90
    Author

    New evidence: the collector rejection is not the delete/-Force example (2026-10-26)

    We inspected the preserved October 16 collector request as data, without executing or rewriting it. This is the separate collector invocation described in our October 17 and October 24 comments, not the original compound PowerShell example.

    • PowerShell Parser.ParseInput reports zero parse errors. The invocation contains no delete command and no -Force parameter. There is also no execution-policy override, encoded-command argument or Invoke-Expression.
    • The relevant operation is Start-Process with a hidden window. The recorded tool result is still only CreateProcess ... Rejected ... blocked by policy, with a reported wall time of 0.0 seconds. It exposes neither a rule name nor a matched condition; no Windows access-denied code is present.
    • Consequently, the specific delete/-Force ownership hypothesis above does not explain this preserved collector invocation. This does not invalidate the other contributor's separate reproduction or establish which rule actually rejected ours.

    Additional read-only diagnostics:

    • The October 16 desktop startup log reports local app-server version 0.163.0-alpha.10.2. The currently running local executable reports 0.164.0-alpha.11.1. These are dated provenance observations, not proof of the enforcing component or a fix; we have not retried the collector on the current build.
    • Current codex doctor --json reports a successful desktop app-server handshake and no locally visible recent Codex security enforcement. It does not identify the historical denial.
    • Doctor also gives a generic Microsoft Defender/exclusions warning. Retained Defender, AppLocker and Code Integrity logs show no corresponding blocked-event entry in a two-minute window on either side of the failure. This is absence of correlated evidence, not proof that every Windows policy is excluded. We have not added exclusions or changed protections.

    Could the owning team provide a supported, non-executing way to obtain the enforcing component, matched condition and decision for this preserved request, or a private channel to correlate its existing tool-call reference? If this collector occurrence belongs in a different issue, please identify that destination. A rule-file-only allow result would not explain an unspecified built-in or tool-side denial.

    No collector launch, report generation, policy/permission change, alternate executor or live source access was performed. This update excludes raw commands/logs, private paths, credentials, session identifiers and resident information.

    Specific URL/Start-Process rule candidate (additional source inspection, October 26)

    We can now identify a concrete candidate distinct from force deletion:

    1. In the Windows classifier at the historical local app-server tag, is_dangerous_powershell_words returns true for has_url together with a Start-Process token/substr match. The URL check accepts HTTP/HTTPS without binding the URL to the executable operand versus a child-program argument.
    2. Data-only AST inspection of our preserved request found one Start-Process and one literal HTTPS URL. That URL is the value of --entry-url in the array referenced by -ArgumentList, not the explicit -FilePath expression. Six assignments and a conditional are outside the literal parser's accepted node list, supporting the opaque whole-invocation fallback. We did not execute the script or compiled parser.
    3. The preceding saved turn context confirms approval_policy=never and sandbox_mode=danger-full-access. In the policy fallback, a dangerous unmatched command under Never becomes Forbidden. A Windows match is classified as Other, whose rendered reason is blocked by policy.
    4. The orchestrator returns Rejected before execution, and unified_exec wraps that as CreateProcess. This accounts for the observed error shape without requiring a Windows CreateProcess API failure.

    The current public tag retains this URL/Start-Process branch, with changed token-kind handling. This is not a new reproduction on the installed runtime.

    Please confirm whether this heuristic was the deciding rule and provide the supported remedy/review path for a local program receiving an HTTPS argument. This is source-backed diagnosis, not a captured winning predicate: the effective overlays, evaluated argv and enforcing component are still unexposed. We have not changed approval/security settings, hidden or moved the URL, rewritten the launch, invoked another executor or retried the collector.

  6. connorchristensen90 commented on Oct 26, 2026

    @connorchristensen90
    Author

    Following up with an explicit constraint: we need a supported remedy that keeps Full access unchanged (danger-full-access / approval_policy=never), rather than switching to Ask for approval.

    Our source-backed findings identify the Windows URL/Start-Process heuristic as a candidate, not a confirmed runtime decision. The URL is a local program's argument, not its executable target. PR #54076 retains conservative treatment of script state/wrappers, so we cannot treat it as a verified fix for this invocation.

    Could the owning team please:

    1. Confirm the enforcing component and deciding rule, using a supported non-executing diagnostic if needed.
    2. Identify a corrected desktop/app-server build or documented remedy compatible with unchanged Full access.
    3. If no such remedy is supported today, say so explicitly and identify the responsible team or tracking issue.

    We are not requesting a safeguard bypass, blanket allow rule, alternate executor, or automatic retry. Collection remains on hold; no collector or report was run for this follow-up. This comment contains no credentials, private paths, raw logs, or resident information.

  7. connorchristensen90 commented on Oct 27, 2026

    @connorchristensen90
    Author

    Post-update evidence: supported Full-access fix still needed (2026-10-27)

    We applied the desktop app's pending update and restarted normally. These are newly verified version/source observations, not a new collector attempt:

    • Desktop app: 26.1023.50603, build 22391, production distribution. The configured updater now reports up_to_date.
    • Running desktop app-server executable: codex-cli 0.165.0-alpha.1.2, verified using only --version on the observed running executable.
    • Before the restart: app 26.1021.31345, build 21828; running backend 0.164.0-alpha.11.1.
    • Full access remains unchanged: danger-full-access with approval_policy=never.

    Read-only comparison of the public source at those two backend tags found windows_dangerous_commands.rs text-identical. The updated tag still contains the URL plus Start-Process classifier, and its policy fallback still returns Forbidden for a heuristic dangerous-command match under Never.

    This supports our existing candidate diagnosis; it does not identify the original winning runtime rule, establish binary/source equivalence, or prove a newly reproduced failure. The October 16 collector invocation remains unexecuted since the recorded rejection. As detailed in our earlier evidence, its HTTPS value is a child program's argument, not the executable operand; that invocation has no delete command or -Force parameter.

    Please provide a concrete next step that keeps Full access unchanged:

    1. Confirm whether this heuristic was the deciding rule, or provide a supported non-executing diagnostic that identifies the actual enforcing component and condition.
    2. Identify the exact fixed desktop/backend build or documented supported remedy applicable to this request, with a way to verify applicability before launching it.
    3. If there is no supported fix compatible with unchanged Full access, please say so explicitly and route this to the responsible team or canonical issue.

    We are not requesting disabled safeguards, blanket allow rules, an alternate executor, command repackaging, or automatic retries. No collector, report, source-system access, permission change, or repeated product test was performed. This update excludes credentials, resident information, private paths/URLs, raw commands/logs and session identifiers.

  8. connorchristensen90 commented on Oct 27, 2026

    @connorchristensen90
    Author

    Invented classification reproduction supplied; specific Full-access fix requested (2026-10-27)

    Not executed or compiled. This blocks our first complete end-to-end collection test. Please identify the exact supported desktop/backend fix or documented next step that preserves Full access, with a way to confirm applicability before a collector launch.

    I prepared an entirely invented, classification-only example package to narrow
    the Start-Process/URL question from my previous update. It contains four cases:

    1. Start-Process with a URL as FilePath (positive safeguard control).
    2. Start-Process with an invented local executable and no URL (negative control
      for this particular predicate, not overall permission).
    3. The same local executable with a URL only in ArgumentList.
    4. Case 3 expressed with variables and a conditional.

    The test proposal passes these strings to the Windows classifier. It never
    launches them. The executable path is invented and the URL is example.invalid.
    It includes no original command, private paths, credentials or application data.

    Previously verified environment: desktop 26.1023.50603/build 22391, running
    backend 0.165.0-alpha.1.2, Full access unchanged, recorded approvals Never.
    No new launch, runtime failure, compilation or test result is being claimed.
    The original deciding rule remains unconfirmed. The stateful example is a
    reduced hypothesis, not an exact reconstruction of the original invocation.

    At the inspected tag, the Windows predicate checks has_url together with
    Start-Process words/substrings. The execution-policy fallback forbids a matched
    dangerous command under Never. Relevant source:
    https://github.com/openai/codex/blob/rust-v0.165.0-alpha.1.2/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs#L104-L122
    https://github.com/openai/codex/blob/rust-v0.165.0-alpha.1.2/codex-rs/core/src/exec_policy.rs#L805-L816

    Could the responsible maintainer:

    • Confirm the parser path and deciding predicate for these invented cases using
      classification-only analysis, and whether that explains the historical denial?
    • Clarify whether the local-target/child-URL cases are intentionally forbidden
      or an argument-ownership false positive? A local program can consume the URL;
      I am not asking for a blanket local-executable exemption.
    • Identify a supported fix/build or non-executing diagnostic with Full access
      unchanged, or explicitly confirm if no such remedy is supported?

    Please preserve the direct URL-launch safeguard. This is a diagnostic proposal,
    not an authorization to weaken policy or a claim that the issue is reproduced.

    The complete prepared material is included inline below, so no external attachment or private repository access is needed. Publication labels are updated; command inputs and test logic are unchanged.

    README and limitations
    Codex issue #51791: invented-data classification reproduction proposal
    Prepared: 2026-10-27
    Status: SHARED FOR REVIEW. NOT RUN. No reproduction result is claimed.
    
    Purpose
    -------
    Give maintainers a small, nonprivate example that separates a URL used as a
    launch target from a URL passed as an argument to a local executable. Ask them
    to confirm the intended policy and the actual deciding rule before proposing a
    fix. This is not an alternate launcher or a way to bypass a denied operation.
    
    Contents
    --------
    classifier-cases.json: Four invented command inputs and unmeasured outcomes.
    proposed-tests.rs.txt: Uncompiled, unexecuted classifier-only test proposal.
    The issue-comment summary and maintainer questions appear above these materials.
    
    The JSON commands are text data, not instructions to execute. The Rust proposal
    calls classification functions only; it does not spawn PowerShell, create a
    process, read application files, contact a URL or modify permissions. There is
    no .ps1 file, executable, launcher, build project or dependency installation.
    Do not convert these files into a shell runner or invoke any command string.
    Publishing this material does not authorize us to execute any command or collector.
    
    Previously verified environment (not rechecked for this draft)
    -----------------------------------------------------------
    Windows Codex desktop: 26.1023.50603, build 22391, prod.
    Observed running app-server version: codex-cli 0.165.0-alpha.1.2.
    Prior app: 26.1021.31345, build 21828.
    Prior running backend: 0.164.0-alpha.11.1.
    Full access remains unchanged; the recorded approval policy is Never.
    No new settings inspection or settings change was performed for this draft.
    
    Known evidence versus hypotheses
    --------------------------------
    1. A historical process-creation attempt was rejected before application launch
       with the generic text "blocked by policy". Its command is not included here.
    2. The later denied invocation had a local executable target, a child-program
       HTTPS argument, variable assignments and a conditional. It did not have a
       delete command or a -Force flag. The original issue also discussed a different
       delete/-Force example; these are not interchangeable observations.
    3. Prior inspection of the published backend tags found the Windows guard source
       unchanged across the two backend versions above. At the current tag, the
       relevant predicate combines has_url with Start-Process tokens/substrings.
    4. The published execution-policy fallback returns Forbidden for a matched
       dangerous command when approvals are Never. That conditional source behavior
       does not identify the winning rule in the historical invocation.
    5. The supplied child-argument cases may exercise this predicate. Their complete
       parsing and classification paths have NOT been measured. The same applies to
       the real runtime decision. Neither a reproduced failure nor a remedy is proved.
    
    Case matrix
    -----------
    01 direct_url_target: positive safeguard control, URL is the launch target.
    02 local_target_no_url: negative control for this particular URL predicate.
    03 local_target_url_argument: local FilePath, URL only in ArgumentList.
    04 stateful_local_target_url_argument: same distinction with variables/conditional.
    
    All paths, program names and inputs are invented. https://example.invalid/input
    is a placeholder, not a service to contact. No executable at the invented path
    is supplied or needed for classification-only analysis. The stateful case is a
    reduced hypothesis, not a verbatim or equivalent reconstruction of the original.
    No clinical text, resident identifiers, authenticated URL, credential, cookie,
    private path, private log or original command is included.
    
    Proposed maintainer analysis (not performed)
    ------------------------------------------
    Inspect the four command strings as data in the pinned source version. The
    Rust text proposes a test inside the existing Windows-guard tests module. It
    checks the two controls and records the other classifications without asserting
    that the child-argument cases must be allowed. It separately illustrates the
    predicate's treatment of already-lowered words; that is not proof the parser
    chooses that path. No test/build command is supplied or executed here.
    
    For each case, record: parser path (independent literal/opaque/other), selected
    predicate, classifier result, applicable execution-policy result under Never,
    and any overriding rule/component. Keep unmeasured fields null. A pure
    classifier result is not the desktop's final authorization decision.
    
    Maintainers should determine whether refusing a local program with a URL
    argument is intentional, or whether argument ownership is being conflated.
    A local executable can itself consume or launch that URL; local FilePath alone
    does not establish safety. Preserve the direct-URL safeguard. Do not add a
    blanket exemption or assert a new allow decision without the policy owner's
    decision. After that decision, the two diagnostic cases can become regression
    assertions with the agreed expected behavior.
    
    Requested outcome
    -----------------
    An exact supported fix/build with Full access unchanged, or a supported
    non-executing diagnostic identifying the deciding rule, or a clear statement
    that this configuration intentionally cannot permit the operation. Do not
    request or apply an approval-policy change, custom allow rule or alternate
    executor. The historical launch hold is unchanged.
    
    Public references reused from the completed inspection
    -----------------------------------------------------
    Issue: https://github.com/openai/codex/issues/51791
    Latest posted evidence (not this draft):
    https://github.com/openai/codex/issues/51791#issuecomment-6450977006
    Current Windows predicate:
    https://github.com/openai/codex/blob/rust-v0.165.0-alpha.1.2/codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs#L104-L122
    Parser dispatch, same file: lines 22-42. Existing tests: lines 493-539.
    Current approval-policy fallback:
    https://github.com/openai/codex/blob/rust-v0.165.0-alpha.1.2/codex-rs/core/src/exec_policy.rs#L805-L816
    
    No surrounding repository, workbook, clinical case checkpoint, private runtime
    directory or logs are included.
    
    Four invented classifier inputs (JSON)
    {
      "schema_version": 1,
      "issue_url": "https://github.com/openai/codex/issues/51791",
      "status": "shared_for_review_not_run",
      "source_tag": "rust-v0.165.0-alpha.1.2",
      "inputs": "entirely_invented",
      "execution_permitted_by_this_package": false,
      "authorization_context": {
        "full_access": "unchanged",
        "recorded_approval_policy": "never",
        "settings_rechecked_for_this_draft": false
      },
      "cases": [
        {
          "id": "direct_url_target",
          "purpose": "Positive control: preserve the direct URL-launch safeguard.",
          "command": [
            "powershell",
            "-NoProfile",
            "-Command",
            "Start-Process -FilePath 'https://example.invalid/input' -WindowStyle Hidden"
          ],
          "classifier_expectation_from_source": true,
          "expectation_basis": "Existing direct URL-launch guard and tests; this exact input is unexecuted.",
          "observed_classifier_result": null,
          "observed_parser_path": null,
          "observed_runtime_decision": null,
          "observed_winning_rule": null
        },
        {
          "id": "local_target_no_url",
          "purpose": "Negative control for the URL predicate, not proof of global permission.",
          "command": [
            "powershell",
            "-NoProfile",
            "-Command",
            "Start-Process -FilePath 'C:\\SyntheticDiagnostic\\local-reader.exe' -ArgumentList 'local-only' -WindowStyle Hidden"
          ],
          "classifier_expectation_from_source": false,
          "expectation_basis": "No URL or force-delete trigger; this exact input is unexecuted.",
          "observed_classifier_result": null,
          "observed_parser_path": null,
          "observed_runtime_decision": null,
          "observed_winning_rule": null
        },
        {
          "id": "local_target_url_argument",
          "purpose": "Isolate URL in a local executable's child argument rather than FilePath.",
          "command": [
            "powershell",
            "-NoProfile",
            "-Command",
            "Start-Process -FilePath 'C:\\SyntheticDiagnostic\\local-reader.exe' -ArgumentList 'https://example.invalid/input' -WindowStyle Hidden"
          ],
          "classifier_expectation_from_source": null,
          "hypothesis": "The URL/Start-Process predicate may match despite the local FilePath. Record actual parser/classifier behavior before asserting an outcome.",
          "intended_policy": "maintainer_decision_required",
          "observed_classifier_result": null,
          "observed_parser_path": null,
          "observed_runtime_decision": null,
          "observed_winning_rule": null
        },
        {
          "id": "stateful_local_target_url_argument",
          "purpose": "Reduced variable/conditional form; not an exact reconstruction of the denied invocation.",
          "command": [
            "powershell",
            "-NoProfile",
            "-Command",
            "$program = 'C:\\SyntheticDiagnostic\\local-reader.exe'; $entry = 'https://example.invalid/input'; $enabled = $true; if ($enabled) { Start-Process -FilePath $program -ArgumentList $entry -WindowStyle Hidden }"
          ],
          "classifier_expectation_from_source": null,
          "hypothesis": "Stateful syntax may use the opaque path and match the URL/Start-Process predicate. Neither path nor decision has been measured.",
          "intended_policy": "maintainer_decision_required",
          "observed_classifier_result": null,
          "observed_parser_path": null,
          "observed_runtime_decision": null,
          "observed_winning_rule": null
        }
      ]
    }
    Proposed classifier-only tests (uncompiled and unexecuted)
    // PROPOSAL ONLY. NOT COMPILED, RUN, OR APPLIED TO CODEX.
    // Proposed insertion into the existing `mod tests` in:
    // codex-rs/shell-command/src/command_safety/windows_dangerous_commands.rs
    // Source tag: rust-v0.165.0-alpha.1.2.
    // Reuses that module's `vec_str` helper and `is_dangerous_command_windows` import.
    // All commands below are data. No subprocess, network call or filesystem I/O.
    
    #[test]
    fn issue_51791_invented_command_classification_matrix() {
        let cases: [(&str, &str, Option<bool>); 4] = [
            (
                "direct_url_target",
                r#"Start-Process -FilePath 'https://example.invalid/input' -WindowStyle Hidden"#,
                Some(true),
            ),
            (
                "local_target_no_url",
                r#"Start-Process -FilePath 'C:\SyntheticDiagnostic\local-reader.exe' -ArgumentList 'local-only' -WindowStyle Hidden"#,
                Some(false),
            ),
            (
                "local_target_url_argument",
                r#"Start-Process -FilePath 'C:\SyntheticDiagnostic\local-reader.exe' -ArgumentList 'https://example.invalid/input' -WindowStyle Hidden"#,
                None,
            ),
            (
                "stateful_local_target_url_argument",
                r#"$program = 'C:\SyntheticDiagnostic\local-reader.exe'; $entry = 'https://example.invalid/input'; $enabled = $true; if ($enabled) { Start-Process -FilePath $program -ArgumentList $entry -WindowStyle Hidden }"#,
                None,
            ),
        ];
    
        for (id, script, control_expectation) in cases {
            let command = vec_str(&["powershell", "-NoProfile", "-Command", script]);
            let classified = is_dangerous_command_windows(&command);
            println!("issue_51791 case={id} windows_guard_match={classified}");
            if let Some(expected) = control_expectation {
                assert_eq!(classified, expected, "control case={id}");
            }
            // Diagnostic cases deliberately have no prescribed allow/deny outcome.
            // Maintainers must define intended policy before adding those assertions.
        }
    }
    
    #[test]
    fn issue_51791_lowered_words_current_predicate_characterization() {
        let words = vec_str(&[
            "Start-Process",
            "-FilePath",
            r#"C:\SyntheticDiagnostic\local-reader.exe"#,
            "-ArgumentList",
            "https://example.invalid/input",
            "-WindowStyle",
            "Hidden",
        ]);
    
        // Characterize the pinned source predicate, not desired product behavior.
        // Supplying lowered words directly does NOT prove the parser emits them.
        assert!(super::is_dangerous_powershell_literal_words(&words));
        assert!(super::is_dangerous_powershell_words(&words));
    }
    
    // Review notes:
    // - These tests were written against inspected public signatures, not compiled.
    // - No desktop/tool rejection or actual winning policy is captured by this code.
    // - A false guard result is not overall authorization or proof of safe behavior.
    // - A true guard result reaches Forbidden under Never only if the cited fallback
    //   applies; other policy rules/components must be traced by maintainers.
    // - Do not weaken the direct URL safeguard or treat every local executable as safe.
    // - Do not invoke any script string, create a real helper executable, or use an
    //   alternate executor to test around an existing denial.
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