Skip to content

Windows: scan fails while saving scan-manifest.json #51

Closed

Description

@Dillish88

Environment

  • OS: Windows 10 Pro Education
  • Windows build: 22631
  • Package: @openai/[email protected]
  • Authentication: ChatGPT stored credentials
  • Node.js: v24.15.0
  • npm: 11.12.1
  • Repository: private repository authorized for scanning

Reproduction

The scan was run against a fresh local Git clone outside the Documents folder, using a fresh temporary output directory:

$scanRoot = Join-Path $env:TEMP "codex-security-repro"
New-Item -ItemType Directory -Force $scanRoot | Out-Null

npx @openai/codex-security scan `
  C:\dev\ship-nexus-security `
  --output-dir "$scanRoot\results" `
  --format json

Authentication and scan preparation completed successfully.
Expected behavior
The scan should complete and write a valid scan manifest and findings to the specified output directory.
Actual behavior
The scan failed while saving the scan manifest:

codex-security: Could not save the Codex Security scan:
scan-manifest.json: expected a regular file inside the scan directory.
Partial output was retained, but no complete scan result was produced.

Additional failure
When the same output directory was reused, the CLI failed with:
sqlite3.IntegrityError: UNIQUE constraint failed: scans.scan_dir

Notes
Reproduced on Windows.
Reproduced from a fresh local Git clone.
Reproduced with a fresh output directory.
Reproduced with both --json and --format json.
The output directory was outside the repository.
No repository files were modified.

Activity

  1. 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.

  2. added
    bug
    on Aug 3, 2026
  3. mldangelo-oai commented on Aug 3, 2026

    @mldangelo-oai
    Collaborator

    PR #67 addressed the default Windows sandbox configuration that can prevent scan artifacts from being written and automatically closed this report. Other causes of the same missing-manifest error remain under investigation in #20, #27, and #73. Thank you for documenting the Windows reproduction and workaround.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions