You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
scan-manifest.json not generated — scan fails with "expected a regular file inside the scan directory" #60
Or with explicit output: codex-security scan . --output-dir C:\Users\admin\Desktop\sqlmap-scan
Expected
Scan completes and saves results (manifest, findings, etc.) to the output directory.
Actual
Scan runs for ~8 minutes (API calls appear to succeed — "Running scan" phase completes), then fails:
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 .
The output directory is completely empty — no files were written at all.
Diagnosis
Tracked the error to _bundled_plugin/scripts/workbench_db.py:3502 (artifact_path function). The function expects scan-manifest.json to already exist as a regular file in the scan directory, but nothing in the scan pipeline writes this file before the finalize step tries to read it. The scan engine completes its work (API credits are consumed) but produces zero local artifacts.
Additional context
Reproduced twice: once via Codex Desktop, once via CLI directly with --output-dir
Both attempts produced empty output directories
Target directory was git-initialized before the second attempt (no change)
I can independently reproduce the same visible failure with @openai/[email protected] on native Windows, Node 22 and Python 3.12. Two full scan attempts ended with an empty output directory and the same scan-manifest.json: expected a regular file inside the scan directory message.
However, the root cause observed in my reproduction appears different from the diagnosis in the issue description. This may be a distinct earlier failure path that converges on the same final manifest error; I am not claiming to have confirmed that the original reporter's scan reached the same internal state.
I preserved and inspected the isolated Codex rollout JSONL. In my reproduction, no repository scan or artifact-writing step actually ran. The first required tool call attempted to read the bundled scan skill using a PowerShell command equivalent to:
The tool result was blocked by policy. The recorded command representation contained POSIX-style quote fragments around the PowerShell arguments (for example '"'"'), although it is unclear whether that is only rendering or part of the policy input.
The scan thread was started with approvalPolicy: "never", so the blocked command could not be approved or recovered. A later turn.completed event was still treated as successful, and finalization invoked complete-scan even though the canonical artifacts had never been created. That downstream validation then replaced the useful original failure with the missing-manifest error.
For this specific reproduction, two fixes may be needed:
Ensure the bundled skill can be read on native Windows under the scan permission profile without requesting an unavailable approval (and verify the PowerShell command is not being POSIX-requoted before policy evaluation).
Preserve tool/policy failures and do not invoke complete-scan merely because turn.completed arrived; first require the expected draft artifacts, otherwise report the original failure.
Likely public locations are sdk/typescript/src/api.ts around thread startup, event completion/finalization, and result collection, with a regression in sdk/typescript/tests-ts/api.test.ts for: policy-blocked tool call -> turn.completed -> no artifacts.
All paths and repository-specific content have been omitted from this report.
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.
PR #67 addressed the default Windows sandbox configuration and automatically closed this report. That change does not resolve every path that produces a missing scan-manifest.json; remaining Windows, Linux, and policy-related cases are still tracked in #20, #27, and #73. Thank you to everyone who documented reproductions and workarounds.
Activity
henrykemp1977 commentedon Jul 29, 2026
I can independently reproduce the same visible failure with
@openai/[email protected]on native Windows, Node 22 and Python 3.12. Two full scan attempts ended with an empty output directory and the samescan-manifest.json: expected a regular file inside the scan directorymessage.However, the root cause observed in my reproduction appears different from the diagnosis in the issue description. This may be a distinct earlier failure path that converges on the same final manifest error; I am not claiming to have confirmed that the original reporter's scan reached the same internal state.
I preserved and inspected the isolated Codex rollout JSONL. In my reproduction, no repository scan or artifact-writing step actually ran. The first required tool call attempted to read the bundled scan skill using a PowerShell command equivalent to:
The tool result was
blocked by policy. The recorded command representation contained POSIX-style quote fragments around the PowerShell arguments (for example'"'"'), although it is unclear whether that is only rendering or part of the policy input.The scan thread was started with
approvalPolicy: "never", so the blocked command could not be approved or recovered. A laterturn.completedevent was still treated as successful, and finalization invokedcomplete-scaneven though the canonical artifacts had never been created. That downstream validation then replaced the useful original failure with the missing-manifest error.For this specific reproduction, two fixes may be needed:
complete-scanmerely becauseturn.completedarrived; first require the expected draft artifacts, otherwise report the original failure.Likely public locations are
sdk/typescript/src/api.tsaround thread startup, event completion/finalization, and result collection, with a regression insdk/typescript/tests-ts/api.test.tsfor: policy-blocked tool call ->turn.completed-> no artifacts.All paths and repository-specific content have been omitted from this report.
pjlsergeant commentedon Jul 29, 2026
This is a dupe of #20
nadavkav commentedon Jul 29, 2026
I also experience this, on linux/ubuntu
wellnotedhq commentedon Jul 29, 2026
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 withWindowsSandboxLevel::Disabled(the default)render_decision_for_unmatched_commandinexec_policy.rsreturnsForbiddenfor every unmatched command. The agent's PowerShell helpers are all "rejected: blocked by policy", it writes nothing, andcomplete-scanstill 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.mldangelo-oai commentedon Aug 3, 2026
PR #67 addressed the default Windows sandbox configuration and automatically closed this report. That change does not resolve every path that produces a missing
scan-manifest.json; remaining Windows, Linux, and policy-related cases are still tracked in #20, #27, and #73. Thank you to everyone who documented reproductions and workarounds.