Skip to content

Windows: codex-security scan fails with "scan-manifest.json: expected a regular file inside the scan directory" #27

Closed

Description

@audreyaaf

Windows: codex-security scan fails with scan-manifest.json: expected a regular file inside the scan directory

Summary

Running codex-security scan on Windows successfully authenticates and starts scanning the repository, but fails when saving the scan results with the following error:

scan-manifest.json: expected a regular file inside the scan directory

The scan runs for several minutes before failing and leaves a partial scan output in the local Codex state directory.


Environment

  • OS: Windows 11
  • Shell: PowerShell
  • Codex Security CLI: 0.1.1
  • Node.js: v24.14.0
  • npm: 11.9.0

Steps to Reproduce

  1. Open PowerShell.
  2. Navigate to a local Git repository.
  3. Run:
codex-security scan
  1. Wait for the scan to finish.

Expected Behavior

The scan completes successfully and saves the scan results.


Actual Behavior

The scan appears to complete its analysis but fails while saving the scan results.

PS C:\...\SecureOn> codex-security scan
[00:01] Preparing scan
[00:01] Authentication: stored Codex credentials.
[00:07] Preparing scan
[06:32] Running scan
codex-security: Could not save the Codex Security scan: scan-manifest.json: expected a regular file inside the scan directory.
codex-security: Partial output was kept at C:\Users\<redacted>\.codex\state\plugins\codex-security\scans\SecureOn\codex-security-SecureOn-Gp6lAZ.

Additional Information

  • Authentication succeeds without issue.
  • The scan runs for approximately 6 minutes before failing.
  • A partial scan directory is created under the Codex state directory.
  • The error appears to occur while writing or packaging the final scan output rather than during the scan itself.

Please let me know if additional logs or the contents of the partial scan directory would help with debugging.

Activity

  1. hjo12 commented on Jul 29, 2026

    @hjo12

    receiving same error after ~3 minutes, on node version v24.16.0 and npm version 11.13.0, with package info below:

    sdkVersion: 0.1.1
    bundledPluginVersion: 0.1.14
    scanMcp: false
    cancellationNote: Scans are CLI-only because the MCP transport cannot cancel active commands.
    cliVersion: 0.1.1
    codexVersion: 0.144.6
    codexSdkVersion: 0.144.6
    model: gpt-5.6-sol
    reasoningEffort: xhigh
    
  2. smixs commented on Jul 29, 2026

    @smixs

    same here

  3. wellnotedhq commented on Jul 29, 2026

    @wellnotedhq

    Root cause and a working workaround posted on #20: #20 (comment)

    Short version: on Windows the SDK combines a managed filesystem permission profile with approvalPolicy: "never", and with WindowsSandboxLevel::Disabled (the default) render_decision_for_unmatched_command in exec_policy.rs returns Forbidden for every unmatched command. The agent's PowerShell helpers are all "rejected: blocked by policy", it writes nothing, and complete-scan still runs - producing the misleading missing-manifest error.

    Workaround: codex-security scan <repo> --output-dir <dir> --codex features.experimental_windows_sandbox=true. Verified A/B on one machine: without the flag, three runs died in preflight at ~7 min with zero files written; with it, the scan ran 49 min and wrote every canonical artifact.

  4. added
    bug
    on Aug 3, 2026
  5. added
    area:cost
    area:reports
    area:sandbox
    platform:windows
    priority:p2
    question
    status:needs-info
    on Aug 15, 2026
  6. mldangelo-oai commented on Aug 15, 2026

    @mldangelo-oai
    Collaborator

    Thanks for the reports. #67 fixed the original disabled Windows sandbox, but later comments suggest there may be a separate failure. Could you retry with @openai/[email protected] or newer and share the Windows version, scan mode, sandbox backend, first error, and a sanitized artifact listing? Please leave out source code, credentials, and repository details.

  7. mldangelo-oai commented on Aug 31, 2026

    @mldangelo-oai
    Collaborator

    Thanks for reporting this. I believe #67 resolved the original Windows sandbox issue. If this still happens on the latest version, please feel free to reopen with your Windows version and the error you’re seeing.

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

    area:costarea:reportsarea:sandboxbugplatform:windowspriority:p2questionstatus:needs-info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions