@openai/codex-security 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +228 -18
  2. package/_bundled_plugin/.app.json +1 -1
  3. package/_bundled_plugin/.mcp.json +10 -3
  4. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  5. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  6. package/_bundled_plugin/references/config-preflight.md +1 -1
  7. package/_bundled_plugin/references/core-scan.md +1 -1
  8. package/_bundled_plugin/references/final-report.md +4 -2
  9. package/_bundled_plugin/references/sarif-adapter.md +2 -0
  10. package/_bundled_plugin/references/scan-artifacts.md +1 -1
  11. package/_bundled_plugin/references/scan-contract.md +18 -7
  12. package/_bundled_plugin/schemas/scan-manifest.schema.json +2 -2
  13. package/_bundled_plugin/schemas/tools/scan-draft.schema.json +23 -0
  14. package/_bundled_plugin/scripts/deep_scan_workbench.py +122 -7
  15. package/_bundled_plugin/scripts/finalize_scan_contract.py +106 -38
  16. package/_bundled_plugin/scripts/generate_in_scope_files.py +20 -0
  17. package/_bundled_plugin/scripts/generate_rank_input.py +23 -7
  18. package/_bundled_plugin/scripts/launch_codex_security_mcp +32 -0
  19. package/_bundled_plugin/scripts/launch_codex_security_mcp.cmd +27 -0
  20. package/_bundled_plugin/scripts/report_projection.py +19 -8
  21. package/_bundled_plugin/scripts/workbench_cli.py +35 -15
  22. package/_bundled_plugin/scripts/workbench_db.py +184 -202
  23. package/_bundled_plugin/scripts/workbench_finding_index.py +101 -0
  24. package/_bundled_plugin/scripts/workbench_progress.py +6 -3
  25. package/_bundled_plugin/scripts/workbench_remediation.py +19 -0
  26. package/_bundled_plugin/scripts/workbench_saved_results.py +1289 -0
  27. package/_bundled_plugin/scripts/workbench_scan_history.py +17 -2
  28. package/_bundled_plugin/scripts/workbench_schema.py +28 -0
  29. package/_bundled_plugin/scripts/workbench_target.py +36 -5
  30. package/_bundled_plugin/scripts/workbench_validation.py +9 -0
  31. package/_bundled_plugin/skills/deep-security-scan/SKILL.md +4 -4
  32. package/_bundled_plugin/skills/fix-finding/SKILL.md +17 -1
  33. package/_bundled_plugin/skills/security-diff-scan/SKILL.md +1 -1
  34. package/_bundled_plugin/skills/security-scan/SKILL.md +1 -1
  35. package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +1 -1
  36. package/dist/api.d.ts +18 -1
  37. package/dist/api.d.ts.map +1 -1
  38. package/dist/api.js +234 -18
  39. package/dist/api.js.map +1 -1
  40. package/dist/cli.d.ts +5 -3
  41. package/dist/cli.d.ts.map +1 -1
  42. package/dist/cli.js +348 -43
  43. package/dist/cli.js.map +1 -1
  44. package/dist/component-plan.d.ts +15 -0
  45. package/dist/component-plan.d.ts.map +1 -0
  46. package/dist/component-plan.js +145 -0
  47. package/dist/component-plan.js.map +1 -0
  48. package/dist/component-scan.d.ts +83 -0
  49. package/dist/component-scan.d.ts.map +1 -0
  50. package/dist/component-scan.js +279 -0
  51. package/dist/component-scan.js.map +1 -0
  52. package/dist/contract.d.ts +8 -2
  53. package/dist/contract.d.ts.map +1 -1
  54. package/dist/contract.js +27 -8
  55. package/dist/contract.js.map +1 -1
  56. package/dist/cost-model.d.ts +20 -0
  57. package/dist/cost-model.d.ts.map +1 -0
  58. package/dist/cost-model.js +86 -0
  59. package/dist/cost-model.js.map +1 -0
  60. package/dist/cost.d.ts +2 -11
  61. package/dist/cost.d.ts.map +1 -1
  62. package/dist/cost.js +15 -98
  63. package/dist/cost.js.map +1 -1
  64. package/dist/custom-validation-prompt.d.ts +4 -0
  65. package/dist/custom-validation-prompt.d.ts.map +1 -0
  66. package/dist/custom-validation-prompt.js +94 -0
  67. package/dist/custom-validation-prompt.js.map +1 -0
  68. package/dist/custom-validation.d.ts +45 -0
  69. package/dist/custom-validation.d.ts.map +1 -0
  70. package/dist/custom-validation.js +292 -0
  71. package/dist/custom-validation.js.map +1 -0
  72. package/dist/errors.d.ts +1 -1
  73. package/dist/errors.d.ts.map +1 -1
  74. package/dist/errors.js +1 -1
  75. package/dist/errors.js.map +1 -1
  76. package/dist/index.d.ts +6 -1
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +2 -0
  79. package/dist/index.js.map +1 -1
  80. package/dist/models.d.ts +1 -1
  81. package/dist/models.d.ts.map +1 -1
  82. package/dist/models.js.map +1 -1
  83. package/dist/multiscan.d.ts +1 -0
  84. package/dist/multiscan.d.ts.map +1 -1
  85. package/dist/multiscan.js +53 -5
  86. package/dist/multiscan.js.map +1 -1
  87. package/dist/patch-tui.js +1 -1
  88. package/dist/patch-tui.js.map +1 -1
  89. package/dist/publication.d.ts.map +1 -1
  90. package/dist/publication.js +3 -4
  91. package/dist/publication.js.map +1 -1
  92. package/dist/runtime.d.ts +4 -2
  93. package/dist/runtime.d.ts.map +1 -1
  94. package/dist/runtime.js +109 -38
  95. package/dist/runtime.js.map +1 -1
  96. package/dist/scan-comparison.d.ts +12 -5
  97. package/dist/scan-comparison.d.ts.map +1 -1
  98. package/dist/scan-comparison.js +72 -28
  99. package/dist/scan-comparison.js.map +1 -1
  100. package/dist/scan-dashboard.d.ts +9 -2
  101. package/dist/scan-dashboard.d.ts.map +1 -1
  102. package/dist/scan-dashboard.js +198 -3
  103. package/dist/scan-dashboard.js.map +1 -1
  104. package/dist/scan-logs.d.ts.map +1 -1
  105. package/dist/scan-logs.js +5 -21
  106. package/dist/scan-logs.js.map +1 -1
  107. package/dist/scan-sessions.d.ts +4 -0
  108. package/dist/scan-sessions.d.ts.map +1 -0
  109. package/dist/scan-sessions.js +35 -0
  110. package/dist/scan-sessions.js.map +1 -0
  111. package/dist/targets.d.ts.map +1 -1
  112. package/dist/targets.js +16 -1
  113. package/dist/targets.js.map +1 -1
  114. package/dist/version.d.ts.map +1 -1
  115. package/dist/version.js +2 -20
  116. package/dist/version.js.map +1 -1
  117. package/dist/windows-path.d.ts +3 -0
  118. package/dist/windows-path.d.ts.map +1 -0
  119. package/dist/windows-path.js +16 -0
  120. package/dist/windows-path.js.map +1 -0
  121. package/dist/worker-progress.d.ts +1 -0
  122. package/dist/worker-progress.d.ts.map +1 -1
  123. package/dist/worker-progress.js +12 -0
  124. package/dist/worker-progress.js.map +1 -1
  125. package/package.json +8 -2
@@ -18,6 +18,10 @@ from workbench_scan_usage import stored_scan_cost_fields
18
18
  from workbench_target import git_output
19
19
 
20
20
 
21
+ def _windows_path_key(value: str) -> str:
22
+ return os.path.normcase(os.path.realpath(value))
23
+
24
+
21
25
  def _same_repository(
22
26
  before: sqlite3.Row,
23
27
  after: sqlite3.Row,
@@ -78,6 +82,8 @@ def _repository_origin(target: Path) -> tuple[str, str] | None:
78
82
  def list_scans(
79
83
  connection: sqlite3.Connection, args: argparse.Namespace | None = None
80
84
  ) -> dict[str, Any]:
85
+ if os.name == "nt":
86
+ connection.create_function("codex_security_path_key", 1, _windows_path_key)
81
87
  clauses: list[str] = []
82
88
  values: list[Any] = []
83
89
  if args is not None and args.repository:
@@ -110,7 +116,15 @@ def list_scans(
110
116
  if args is not None and args.scan_root:
111
117
  scan_root = str(Path(args.scan_root).expanduser().resolve())
112
118
  prefix = scan_root.rstrip(os.sep) + os.sep
113
- clauses.append("(scans.scan_dir = ? OR substr(scans.scan_dir, 1, ?) = ?)")
119
+ if os.name == "nt":
120
+ scan_root = _windows_path_key(scan_root)
121
+ prefix = scan_root.rstrip(os.sep) + os.sep
122
+ clauses.append(
123
+ "(codex_security_path_key(scans.scan_dir) = ? "
124
+ "OR substr(codex_security_path_key(scans.scan_dir), 1, ?) = ?)"
125
+ )
126
+ else:
127
+ clauses.append("(scans.scan_dir = ? OR substr(scans.scan_dir, 1, ?) = ?)")
114
128
  values.extend((scan_root, len(prefix), prefix))
115
129
  if args is not None and args.target_id:
116
130
  clauses.append("scans.target_id = ?")
@@ -456,8 +470,9 @@ def save_scan_comparison(
456
470
  read_coverage(after)
457
471
  before_findings = _scan_findings(connection, before["id"])
458
472
  after_findings = _scan_findings(connection, after["id"])
473
+ matches_json = sys.stdin.read() if args.matches_json_stdin else args.matches_json
459
474
  try:
460
- payload = json.loads(args.matches_json)
475
+ payload = json.loads(matches_json)
461
476
  except (TypeError, ValueError) as exc:
462
477
  raise SystemExit("Scan comparison matches must be a valid JSON object.") from exc
463
478
  if not isinstance(payload, dict) or set(payload) != {"matches", "uncertain"}:
@@ -683,6 +683,20 @@ MIGRATIONS = (
683
683
  WHERE project_id IS NULL;
684
684
  """,
685
685
  ),
686
+ (
687
+ 31,
688
+ "freeze stopped scan source digests",
689
+ """
690
+ ALTER TABLE scans ADD COLUMN retained_source_digests_json TEXT;
691
+ """,
692
+ ),
693
+ (
694
+ 32,
695
+ "separate deep scan publication failures",
696
+ """
697
+ ALTER TABLE deep_scan_runs ADD COLUMN publication_error_message TEXT;
698
+ """,
699
+ ),
686
700
  )
687
701
 
688
702
 
@@ -744,6 +758,20 @@ def apply_migrations(
744
758
  "max_time_hours",
745
759
  "REAL NOT NULL DEFAULT 96",
746
760
  )
761
+ elif version == 31:
762
+ add_column_if_missing(
763
+ connection,
764
+ "scans",
765
+ "retained_source_digests_json",
766
+ "TEXT",
767
+ )
768
+ elif version == 32:
769
+ add_column_if_missing(
770
+ connection,
771
+ "deep_scan_runs",
772
+ "publication_error_message",
773
+ "TEXT",
774
+ )
747
775
  continue
748
776
  if version == 6:
749
777
  repair_thread_scoped_workspaces_migration(connection)
@@ -25,8 +25,8 @@ def git_output(
25
25
  git_dir: Path | None = None,
26
26
  work_tree: Path | None = None,
27
27
  ) -> str | None:
28
- completed = git_command(target, *args, text=True, git_dir=git_dir, work_tree=work_tree)
29
- output = completed.stdout.strip()
28
+ completed = git_command(target, *args, text=False, git_dir=git_dir, work_tree=work_tree)
29
+ output = os.fsdecode(completed.stdout).strip()
30
30
  return output if completed.returncode == 0 and output else None
31
31
 
32
32
 
@@ -135,7 +135,15 @@ def git_command(
135
135
  environment.pop(name, None)
136
136
  environment["GIT_LITERAL_PATHSPECS"] = "1"
137
137
  # Repository-local config is untrusted; fsmonitor may name an executable hook.
138
- command = ["git", "-c", "core.fsmonitor=false", "-C", str(target)]
138
+ command = [
139
+ "git",
140
+ "-c",
141
+ "core.fsmonitor=false",
142
+ "-c",
143
+ "i18n.logOutputEncoding=UTF-8",
144
+ "-C",
145
+ str(target),
146
+ ]
139
147
  if git_dir is not None and work_tree is not None:
140
148
  command.extend(["--git-dir", str(git_dir), "--work-tree", str(work_tree)])
141
149
  full_command = [*command, *args]
@@ -146,6 +154,8 @@ def git_command(
146
154
  capture_output=True,
147
155
  env=environment,
148
156
  text=text,
157
+ encoding="utf-8" if text else None,
158
+ errors="surrogateescape" if text else None,
149
159
  input=input_data,
150
160
  )
151
161
  except FileNotFoundError:
@@ -168,6 +178,24 @@ def worktree_content_digest(target: Path) -> str:
168
178
  return worktree_content_digest_for_context(repository, pathspec)
169
179
 
170
180
 
181
+ def remediation_checkout_snapshot(
182
+ scan: sqlite3.Row, *, expected_revision: str | None = None
183
+ ) -> tuple[str, str | None]:
184
+ target = require_scan_target_identity(scan)
185
+ revision = git_revision(target)
186
+ required_revision = expected_revision or scan["target_revision"]
187
+ if revision != required_revision:
188
+ raise SystemExit(
189
+ "Repository HEAD changed. Regenerate the remediation patch against the current checkout."
190
+ )
191
+ content_digest = (
192
+ worktree_content_digest(target)
193
+ if revision != "unversioned"
194
+ else directory_content_digest(target, excluded=(Path(scan["scan_dir"]),))
195
+ )
196
+ return revision, content_digest
197
+
198
+
171
199
  def worktree_content_digest_for_context(
172
200
  repository: Path,
173
201
  pathspec: str,
@@ -513,7 +541,9 @@ def copy_git_worktree_files(source: Path, destination: Path, excluded: tuple[Pat
513
541
  if nested_git_dir is None:
514
542
  raise SystemExit(f"Could not inspect nested Git working tree: {relative}")
515
543
  copy_git_worktree_files(source_path, destination_path, excluded)
516
- (destination_path / ".git").write_text(f"gitdir: {nested_git_dir}\n")
544
+ (destination_path / ".git").write_text(
545
+ f"gitdir: {nested_git_dir}\n", encoding="utf-8"
546
+ )
517
547
  else:
518
548
  raise SystemExit(f"Unsupported Git working-tree file type: {relative}")
519
549
  copied_target = destination if pathspec == "." else destination / pathspec
@@ -548,9 +578,10 @@ def git_target_metadata(target: Path) -> dict[str, Any]:
548
578
  branch = git_output(target, "symbolic-ref", "--quiet", "--short", "HEAD")
549
579
  metadata.update({"branch": branch, "detachedHead": revision is not None and branch is None})
550
580
  if revision is not None:
581
+ subject = git_bytes(target, "show", "-s", "--format=%s", "HEAD")
551
582
  metadata.update(
552
583
  {
553
- "commitSubject": git_output(target, "show", "-s", "--format=%s", "HEAD"),
584
+ "commitSubject": (subject or b"").decode("utf-8").strip() or None,
554
585
  "revision": revision,
555
586
  "shortRevision": revision[:7],
556
587
  }
@@ -57,6 +57,15 @@ def user_text(value: str | None) -> str | None:
57
57
  return optional_text(value)
58
58
 
59
59
 
60
+ def user_context_argument(args: argparse.Namespace) -> str | None:
61
+ value = (
62
+ sys.stdin.read()
63
+ if getattr(args, "user_context_stdin", False)
64
+ else args.user_context
65
+ )
66
+ return user_text(value)
67
+
68
+
60
69
  def reject_nonstandard_json_number(value: str) -> None:
61
70
  raise ValueError(f"invalid JSON number {value}")
62
71
 
@@ -5,7 +5,7 @@ description: Use when the user asks for a deep, exhaustive, multi-pass, or varia
5
5
 
6
6
  # Deep Security Scan
7
7
 
8
- Use `start_codex_security_deep_scan` to run repeated independent workers against the exact requested target and scope. Each worker loads `../../references/core-scan.md` directly and performs the complete ordinary Standard audit, including its own threat map, investigation, source-backed validation, and attack-path reasoning, then submits one worker-bound semantic scan draft. The coordinator aggregates the finished Standard results and writes the parent scan's unsealed `scan-manifest.json`, `findings.json`, and `coverage.json` before returning `{ manifestPath }`.
8
+ Use `start_codex_security_deep_scan` to run repeated independent workers against the exact requested target and scope. Each worker loads `../../references/core-scan.md` directly and performs the complete ordinary Standard audit, including its own threat map, investigation, source-backed validation, and attack-path reasoning, saving worker-bound checkpoints as results arrive and one final semantic scan draft when its audit finishes. The coordinator aggregates the finished Standard results and writes the parent scan's unsealed `scan-manifest.json`, `findings.json`, and `coverage.json` before returning `{ manifestPath }`.
9
9
 
10
10
  ## Phase Ownership
11
11
 
@@ -58,8 +58,8 @@ If the host represents the pending call as a running execution cell, keep waitin
58
58
  Handle the result as follows:
59
59
 
60
60
  - `{ manifestPath }`: this is the parent scan's already-authored, unsealed canonical `scan-manifest.json`, not a request for another parent workflow. Its complete Standard worker results have already been validated. Older generic or benchmark instructions describing discovery-only coordinator manifests, candidate lists, parent validation or attack-path phases, or another semantic draft do not apply to this canonical-manifest result. Confirm that the manifest, `findings.json`, and `coverage.json` exist in the authoritative scan directory. For native continuations, keep the existing authoritative `scanId`; for a first target-based CLI or headless call, use the authoritative scan ID explicitly returned in the successful tool result's text. The unsealed manifest may not contain an ID, so never infer one from it, reload global context, or start a replacement scan. Immediately complete that same scan. Do not rerun validation or attack-path analysis, list candidates, aggregate findings, submit another semantic draft, or start another scan.
61
- - `status: "canceled"`: stop without producing a report or calling finalization.
62
- - Tool error or a result without `manifestPath`: surface the exact stable MCP error and any preserved failure-manifest path, then stop the current response. Do not call `start_codex_security_deep_scan` again, reload scan context, call completion, create a replacement scan, cancel an already terminal scan, synthesize findings or coverage, or return final, no-findings, structured, or benchmark output.
61
+ - `status: "canceled"`: stop all scan work and do not call completion. The workbench preserves saved findings and pending candidates; report those retained results with incomplete coverage without claiming a successful scan or generating a replacement report.
62
+ - Terminal scan failure: surface the exact stable MCP error, then read the existing scan context to report preserved findings and pending candidates with incomplete coverage. Do not start more scan work, call completion, cancel an already terminal scan, synthesize findings, or claim a successful/no-findings scan. An invocation failure before a scan starts is still a blocker; do not create a replacement scan or infer results.
63
63
 
64
64
  The native Security workbench observes durable progress without another scan-start call.
65
65
 
@@ -71,4 +71,4 @@ Detailed finding write-ups and hardening proposals remain optional, exactly as i
71
71
 
72
72
  Return user-facing or benchmark output only after completion succeeds and the generated `report.md` exists. Link the report and canonical artifacts. Include measured total, input, and cached input token counts; explicitly label partial coverage and state when measurement is unavailable instead of reporting zero or estimating. If the configured time limit elapsed before any source review completed, report the existing coverage as partial and never claim the repository is free of vulnerabilities. An empty finding set with completed review is the ordinary Codex Security no-findings result, not permission to skip completion.
73
73
 
74
- If canonical coordinator artifacts are missing or malformed, stop and surface the exact blocker without calling completion, fabricating a report, or claiming success. If completion fails, surface its exact MCP error without retrying, canceling, failing the durable scan, or returning final, no-findings, structured, or benchmark output. Leave resumable work running and preserve its handoff claim. On explicit cancellation, call `cancel_codex_security_scan` and do not accept later progress or artifacts. Never edit repository files, widen the target, expose internal worker bookkeeping unless requested, or call `fail_codex_security_scan` merely because a waiter detached, a turn ended, workers are still active, or partial artifacts exist.
74
+ If canonical coordinator artifacts are missing or malformed, stop and surface the exact blocker without calling completion, fabricating a report, or claiming success. If completion fails, surface its exact MCP error without retrying, canceling, failing the durable scan, or returning final, no-findings, structured, or benchmark output. Leave resumable work running and preserve its handoff claim. On explicit cancellation, call `cancel_codex_security_scan` and do not accept later scan progress or success. The host may preserve a final in-flight checkpoint after worker cleanup without resuming analysis. Never edit repository files, widen the target, expose internal worker bookkeeping unless requested, or call `fail_codex_security_scan` merely because a waiter detached, a turn ended, workers are still active, or partial artifacts exist.
@@ -42,7 +42,15 @@ Use this guidance whenever reproducing the finding, running tests, or validating
42
42
  - Do not stop a progressing command merely because it is slow. Inspect process state, logs, artifacts, or resource use first.
43
43
  - If runtime validation remains unavailable, use the strongest targeted static or harness-based artifact that preserves the real integration boundary. Do not substitute a simplified harness that removes the behavior being protected. Record every unrun check as unknown.
44
44
 
45
- ## Workflow
45
+ ## Pre-Patch Investigation
46
+
47
+ The parent agent owns the patch and independently traces the reported path. Before editing, launch one fresh read-only agent with `fork_turns: "none"` when delegation is available. If delegation is unavailable, perform the same perspective as a separate pass:
48
+
49
+ - **Security-boundary and compatibility investigator:** Independently trace the source-to-sink path and identify the shared enforcement boundary, affected entry points, alternate representations or lifecycle states, parser and validation-to-use transitions, concrete sibling paths, and source-backed bypass risks. Establish the legitimate workflows and public behavior that must remain, then inspect callers, implementations, optional modes, errors, side effects, repository conventions, existing helpers, and focused validation commands for integration constraints.
50
+
51
+ The investigation requires repository-relative evidence and a clear separation between facts, inferences, and unresolved questions. When it completes, reconcile its findings with the parent's investigation and choose the patch boundary.
52
+
53
+ ## Implementation Workflow
46
54
 
47
55
  1. Revalidate and scope the finding.
48
56
  - Inspect repository instructions, affected code, direct callers, and only the context needed to prove the vulnerable path.
@@ -76,6 +84,14 @@ Use this guidance whenever reproducing the finding, running tests, or validating
76
84
  - Treat a failed earlier gate as disqualifying. Revise only the candidate changes or return `blocked`; never compensate for failed security closure or behavior preservation with style, smaller scope, or additional reporting.
77
85
  6. Report the outcome with exact commands, results, changed files, and remaining risk.
78
86
 
87
+ ## Patch Candidate Review
88
+
89
+ After implementing and running focused checks, launch one fresh read-only agent with `fork_turns: "none"` when delegation is available. Give it only the finding, repository root, authorized scope, repository policy, and current candidate diff; do not provide the patch rationale, investigator report, or claims that tests passed. If delegation is unavailable, perform the same review perspective as a separate pass before final verification. In either case, use the following assignment:
90
+
91
+ - **Bypass and regression reviewer:** Reconstruct the invariant and look for a concrete surviving route through affected entry points, equivalent representations, parser boundaries, aliases, backend or platform variants, and validation-to-use gaps. Trace changed conditions and direct callers for concrete breakage of legitimate inputs, public contracts, errors, side effects, state transitions, optional modes, compatibility, resource behavior, and repository conventions.
92
+
93
+ The reviewer must not edit or delegate. Report only concrete, source-backed bypasses or regressions and explain how each can be verified. Treat reviewer findings as hypotheses: confirm them against the source or focused execution before revising the implementation. Address only confirmed issues within the finding and compatibility boundary; do not broaden into speculative concerns or redesign. Then rerun relevant verification and ensure no temporary or unrelated changes remain. Perform only one review cycle.
94
+
79
95
  ## Workbench Remediation Stages
80
96
 
81
97
  When a Codex Security workbench request includes a scan ID, occurrence ID, remediation request ID, action token, and expected version, follow only the requested remediation stage. The stage boundary changes when code may be written, but it does not weaken the validation requirements above.
@@ -25,7 +25,7 @@ Read `../../references/config-preflight.md` before dispatching the `security_dif
25
25
  2. Prepare the file list with `prepare_codex_security_review_items` and read all pages from `list_codex_security_review_items`. Inspect deleted files at the baseline revision and unchanged files only when needed to explain the change.
26
26
  3. Run `$finding-discovery` in compact diff mode across the existing file inventory. Do not create ranked worklists, per-finding ledgers, or discovery reports. Divide large changes among available workers without overlap; review any unassigned files yourself. Keep independently reachable bugs separate and record all candidates once with `record_codex_security_discovery_candidates`.
27
27
  4. If candidates exist, run `$validation` once, then `$attack-path-analysis` once for candidates marked `reportable` or `deferred`. Preserve exact locations, evidence, affected instances, and unresolved questions.
28
- 5. Record findings, coverage, and the retained canonical model with `record_codex_security_scan_draft({ scanId, handoffClaimToken?, scope?, threatModel, findings, coverage })`. Mark unresolved work as deferred. Request detailed write-ups or hardening plans only when the user asks.
28
+ 5. Record `complete: false` semantic checkpoints with `record_codex_security_scan_draft` as findings and validation decisions arrive, retaining unresolved candidates and original evidence in `coverage.deferred`. After the review settles, record one final `complete: true` semantic draft with the retained canonical model, findings, and coverage. Request detailed write-ups or hardening plans only when the user asks.
29
29
  6. Call `complete_codex_security_scan` once, then read `get_codex_security_completed_scan`. Finalization creates `report.md` and SARIF. Include measured token usage when available and identify incomplete coverage.
30
30
 
31
31
  For terminal scans without a `scanId`, generate the changed-file list with:
@@ -23,7 +23,7 @@ When an SDK or terminal host sets `CODEX_SECURITY_SCAN_ID`, emit its standalone
23
23
 
24
24
  1. Resolve the repository, requested scope, and output scan directory from the host-provided scan context when available; otherwise use the requested output directory or `<platform_temp>/codex-security-scans/<repo_name>/<scan_id>`. Preserve the exact user context, supplied threat model, applicable inherited `SECURITY.md` guidance, and optional `CODEX_SECURITY_KNOWLEDGE_BASE` for the core audit. Resolve `<python_command>` from the configured interpreter (`"$PYTHON"` in POSIX shells or `& "$env:PYTHON"` in PowerShell), otherwise use `python3` on Unix-like hosts or `python` on Windows. Only when `CODEX_SECURITY_TARGET_PATHS_FILE` is supplied, resolve every authorized source path before review with `<python_command> <plugin_dir>/scripts/generate_rank_input.py make-repo-scope-input --repo <repo_root> --scopes-file <target_paths_file> --out <scan_dir>/scoped-source-input.jsonl`; use `"$CODEX_SECURITY_TARGET_PATHS_FILE"` in POSIX shells or `"$env:CODEX_SECURITY_TARGET_PATHS_FILE"` in PowerShell and honor repository ignore rules for directory descendants while retaining every directly requested file. Never print, modify, or treat the scope input as shell syntax; pass it to the core audit without widening the authorized target or scope.
25
25
  2. Read `../../references/core-scan.md` once and perform its complete source-backed security audit against the resolved target, authorized scope, exact user context, supplied threat model, inherited security policy, optional knowledge base, available workers, and any resolved scoped-source inventory. Retain the resulting complete semantic `scope`, `threatModel`, `findings`, and `coverage`; preserve every finding's source evidence, calibrated severity, confidence, root cause, validation, attack path, and honest coverage.
26
- 3. For a host-backed scan, submit one accepted semantic draft with `record_codex_security_scan_draft({ scanId, handoffClaimToken?, scope?, threatModel, findings, coverage })`; let the workbench derive its authoritative target, scope, coverage metadata, surface IDs, finding identities, and fingerprints. If the draft is explicitly rejected before writing, correct only the identified fields without dropping valid findings or evidence and retry the same scan at most twice. For an SDK-owned or prompt-only headless scan, write unsealed canonical `scan-manifest.json`, `findings.json`, and `coverage.json`; use `scoped_path` for both coverage fields when a scope was requested, otherwise set `coverage.mode` to `repository` and `coverage.inventoryStrategy` to `directory` for a non-Git directory or `repository` for a Git-backed target. Omit `scan.sealedAt` and `scan.artifacts`; an SDK scan preserves its exact registered directory and all SDK-provided scan and target values. When `CODEX_SECURITY_TARGET_PATHS_FILE` is supplied on either file-authored path, bind its exact requested paths with `<python_command> <plugin_dir>/scripts/generate_rank_input.py bind-repo-scopes --scopes-file <target_paths_file> --manifest <scan_dir>/scan-manifest.json --coverage <scan_dir>/coverage.json`, using the same shell-specific target-paths reference.
26
+ 3. For a host-backed scan, save `complete: false` checkpoints during the core audit, then submit one accepted final semantic draft with `record_codex_security_scan_draft({ scanId, complete: true, handoffClaimToken?, scope?, threatModel, findings, coverage })`; let the workbench derive its authoritative target, scope, coverage metadata, surface IDs, finding identities, and fingerprints. If the draft is explicitly rejected before writing, correct only the identified fields without dropping valid findings or evidence and retry the same scan at most twice. For an SDK-owned or prompt-only headless scan, write unsealed canonical `scan-manifest.json`, `findings.json`, and `coverage.json`; use `scoped_path` for both coverage fields when a scope was requested, otherwise set `coverage.mode` to `repository` and `coverage.inventoryStrategy` to `directory` for a non-Git directory or `repository` for a Git-backed target. Omit `scan.sealedAt` and `scan.artifacts`; an SDK scan preserves its exact registered directory and all SDK-provided scan and target values. When `CODEX_SECURITY_TARGET_PATHS_FILE` is supplied on either file-authored path, bind its exact requested paths with `<python_command> <plugin_dir>/scripts/generate_rank_input.py bind-repo-scopes --scopes-file <target_paths_file> --manifest <scan_dir>/scan-manifest.json --coverage <scan_dir>/coverage.json`, using the same shell-specific target-paths reference.
27
27
  4. Verify all three canonical JSON files exist. For an SDK-owned scan, return control without finalizing, sealing, generating `report.md`, or starting another scan; the SDK owns completion. For another host-backed scan, call `complete_codex_security_scan({ scanId, handoffClaimToken? })` once. For a prompt-only headless scan, run `<python_command> <plugin_dir>/scripts/finalize_scan_contract.py --scan-dir <scan_dir> --source-root <repo_root>`. Outside the SDK path, return only after completion succeeds and the generated `report.md` exists; never write the report by hand or reread the complete canonical findings unless the user explicitly requests them. Report measured token counts when returned and label partial measurement or unavailable usage honestly.
28
28
 
29
29
  Keep discovery, validation, and attack-path reasoning within this Standard workflow; do not invoke separate phase skills or load Deep or diff references. Never call Deep-only tools. Do not create ranking phases, per-file or per-candidate ledgers, separate phase worker pools, repeated phase reports, or receipt files.
@@ -16,7 +16,7 @@ Use the existing desktop phase labels for work that actually occurs: threat mapp
16
16
 
17
17
  ## Complete The Same Scan
18
18
 
19
- Record the complete semantic scan draft once with `record_codex_security_scan_draft({ scanId, handoffClaimToken?, scope?, threatModel?, findings, coverage })`. Supply the actual findings, source-backed coverage, and preserved threat model; let the workbench write the unsealed canonical artifacts and derive authoritative target, scope, coverage metadata, finding identities, and fingerprints.
19
+ Save `complete: false` checkpoints as results arrive and validation decisions are made. Preserve pending candidates with their original evidence in `coverage.deferred`; they are not validated findings. When the audit finishes, record the final semantic scan draft once with `record_codex_security_scan_draft({ scanId, complete: true, handoffClaimToken?, scope?, threatModel?, findings, coverage })`. Supply the actual findings, source-backed coverage, and preserved threat model; let the workbench write the unsealed canonical artifacts and derive authoritative target, scope, coverage metadata, finding identities, and fingerprints.
20
20
 
21
21
  Honor desktop handoff requirements for any per-finding write-ups before completion. After the semantic draft succeeds and all three canonical JSON files exist, call `complete_codex_security_scan` exactly once with the same authoritative scan ID and handoff token. Return only after completion succeeds and `report.md` exists, linking the generated report and canonical artifacts; retrieve the complete findings only when the user explicitly requests them. Include measured token usage when available and explicitly label partial or unavailable measurement.
22
22
 
package/dist/api.d.ts CHANGED
@@ -17,10 +17,13 @@ export interface DeepScanOptions {
17
17
  }
18
18
  export interface ScanOptions extends DeepScanOptions {
19
19
  auth?: ScanAuthMode;
20
+ /** Stable, privacy-preserving end-user ID for this scan's model requests. */
21
+ safetyIdentifier?: string;
20
22
  target?: ScanTarget;
21
23
  mode?: ScanMode;
22
24
  knowledgeBasePaths?: string[];
23
25
  scanPrompt?: string;
26
+ validationPrompt?: string;
24
27
  postScanPrompt?: string;
25
28
  outputDir?: string;
26
29
  archiveExisting?: boolean;
@@ -43,7 +46,20 @@ export interface ScanOptions extends DeepScanOptions {
43
46
  onObserverError?: (observer: ScanObserverName, error: unknown) => void;
44
47
  signal?: AbortSignal;
45
48
  }
46
- export type ScanAuthMode = "auto" | "chatgpt" | "api-key";
49
+ export interface ValidationOptions extends Pick<ScanOptions, "auth" | "outputDir" | "signal"> {
50
+ repositoryPath: string;
51
+ /** Finding text or a JSON-serializable object. Strings are never file paths. */
52
+ finding: string | object;
53
+ }
54
+ declare const VALIDATION_DISPOSITIONS: readonly ["reportable", "suppressed", "not_applicable", "deferred"];
55
+ export interface ValidationResult {
56
+ disposition: (typeof VALIDATION_DISPOSITIONS)[number];
57
+ report: string;
58
+ outputDir: string;
59
+ threadId: string | null;
60
+ }
61
+ export declare const SCAN_AUTH_MODES: readonly ["auto", "chatgpt", "api-key"];
62
+ export type ScanAuthMode = (typeof SCAN_AUTH_MODES)[number];
47
63
  export type ScanAuthentication = {
48
64
  method: "api_key";
49
65
  source: "OPENAI_API_KEY" | "CODEX_API_KEY" | "OPENROUTER_API_KEY" | "FIREWORKS_API_KEY";
@@ -95,6 +111,7 @@ export declare class CodexSecurity {
95
111
  readonly metadata: CodexSecurityMetadata;
96
112
  constructor(config?: CodexSecurityConfig);
97
113
  run(repository: string, options?: ScanOptions): Promise<ScanResult>;
114
+ validate(options: ValidationOptions): Promise<ValidationResult>;
98
115
  preflight(repository: string, options?: ScanOptions): Promise<ScanPreflight>;
99
116
  loginApiKey(apiKey: string): Promise<void>;
100
117
  loginChatGPT(): Promise<CodexLoginHandle>;
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";AA0BA,OAAO,EAEL,gBAAgB,EAGhB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAoBnB,OAAO,EACL,UAAU,EAGX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMhF,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAUL,iBAAiB,EAgBjB,KAAK,kBAAkB,EAGxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,UAAU,EAIhB,MAAM,cAAc,CAAC;AAoDtB,MAAM,WAA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