@openai/codex-security 0.5.0 → 0.6.0

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 (299) hide show
  1. package/README.md +93 -2
  2. package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
  3. package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
  4. package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
  5. package/_bundled_plugin/mcp/permission-profile-preflight.mjs +60 -9
  6. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  7. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  8. package/_bundled_plugin/schemas/definitions/artifact-common.schema.json +1 -1
  9. package/_bundled_plugin/scripts/finalize_scan_contract.py +12 -1
  10. package/_bundled_plugin/scripts/generate_in_scope_files.py +6 -6
  11. package/_bundled_plugin/scripts/generate_rank_input.py +12 -6
  12. package/_bundled_plugin/scripts/report_projection.py +2 -1
  13. package/_bundled_plugin/scripts/threat_model_projection.py +1 -3
  14. package/_bundled_plugin/scripts/workbench/saved_coverage.py +234 -0
  15. package/_bundled_plugin/scripts/workbench_cli.py +5 -7
  16. package/_bundled_plugin/scripts/workbench_db.py +12 -6
  17. package/_bundled_plugin/scripts/workbench_finding_workflows.py +2 -0
  18. package/_bundled_plugin/scripts/workbench_native_indexes.py +10 -7
  19. package/_bundled_plugin/scripts/workbench_publication.py +4 -3
  20. package/_bundled_plugin/scripts/workbench_remediation.py +5 -1
  21. package/_bundled_plugin/scripts/workbench_saved_results.py +542 -148
  22. package/_bundled_plugin/scripts/workbench_scan_history.py +79 -78
  23. package/_bundled_plugin/scripts/workbench_scan_usage.py +61 -13
  24. package/_bundled_plugin/scripts/workbench_target.py +21 -7
  25. package/_bundled_plugin/scripts/workbench_validation.py +21 -18
  26. package/_bundled_plugin/shared/workbench-migrations.json +26 -0
  27. package/_bundled_plugin/skills/fix-finding/SKILL.md +16 -8
  28. package/_bundled_plugin/skills/publish-findings/SKILL.md +130 -0
  29. package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +6 -0
  30. package/_bundled_plugin/skills/verify-fix/SKILL.md +4 -2
  31. package/dist/api.d.ts +4 -1
  32. package/dist/api.d.ts.map +1 -1
  33. package/dist/api.js +233 -91
  34. package/dist/api.js.map +1 -1
  35. package/dist/classify-scan-severity.d.ts.map +1 -1
  36. package/dist/classify-scan-severity.js +16 -18
  37. package/dist/classify-scan-severity.js.map +1 -1
  38. package/dist/classify-severity-records.d.ts +5 -2
  39. package/dist/classify-severity-records.d.ts.map +1 -1
  40. package/dist/classify-severity-records.js +40 -34
  41. package/dist/classify-severity-records.js.map +1 -1
  42. package/dist/classify-severity.d.ts +5 -1
  43. package/dist/classify-severity.d.ts.map +1 -1
  44. package/dist/classify-severity.js +20 -30
  45. package/dist/classify-severity.js.map +1 -1
  46. package/dist/cli-daybreak.d.ts +5 -0
  47. package/dist/cli-daybreak.d.ts.map +1 -0
  48. package/dist/cli-daybreak.js +89 -0
  49. package/dist/cli-daybreak.js.map +1 -0
  50. package/dist/cli-help.d.ts.map +1 -1
  51. package/dist/cli-help.js +1 -0
  52. package/dist/cli-help.js.map +1 -1
  53. package/dist/cli.d.ts +12 -1
  54. package/dist/cli.d.ts.map +1 -1
  55. package/dist/cli.js +1224 -596
  56. package/dist/cli.js.map +1 -1
  57. package/dist/cloud-endpoint.d.ts +6 -0
  58. package/dist/cloud-endpoint.d.ts.map +1 -0
  59. package/dist/cloud-endpoint.js +51 -0
  60. package/dist/cloud-endpoint.js.map +1 -0
  61. package/dist/cloud-publish.d.ts.map +1 -1
  62. package/dist/cloud-publish.js +7 -5
  63. package/dist/cloud-publish.js.map +1 -1
  64. package/dist/codeowners.js +2 -2
  65. package/dist/codeowners.js.map +1 -1
  66. package/dist/component-plan.d.ts.map +1 -1
  67. package/dist/component-plan.js +3 -2
  68. package/dist/component-plan.js.map +1 -1
  69. package/dist/component-scan.js +2 -2
  70. package/dist/component-scan.js.map +1 -1
  71. package/dist/config.d.ts.map +1 -1
  72. package/dist/config.js +5 -1
  73. package/dist/config.js.map +1 -1
  74. package/dist/cost.d.ts +2 -1
  75. package/dist/cost.d.ts.map +1 -1
  76. package/dist/cost.js +17 -8
  77. package/dist/cost.js.map +1 -1
  78. package/dist/custom-validation.d.ts.map +1 -1
  79. package/dist/custom-validation.js +2 -5
  80. package/dist/custom-validation.js.map +1 -1
  81. package/dist/deduplication/codex-review.d.ts.map +1 -1
  82. package/dist/deduplication/codex-review.js +8 -6
  83. package/dist/deduplication/codex-review.js.map +1 -1
  84. package/dist/deduplication/local.d.ts.map +1 -1
  85. package/dist/deduplication/local.js +5 -2
  86. package/dist/deduplication/local.js.map +1 -1
  87. package/dist/deduplication/retry.d.ts.map +1 -1
  88. package/dist/deduplication/retry.js +5 -0
  89. package/dist/deduplication/retry.js.map +1 -1
  90. package/dist/deduplication/scan.js +5 -1
  91. package/dist/deduplication/scan.js.map +1 -1
  92. package/dist/deep-scan.d.ts +6 -0
  93. package/dist/deep-scan.d.ts.map +1 -1
  94. package/dist/deep-scan.js +8 -6
  95. package/dist/deep-scan.js.map +1 -1
  96. package/dist/default-severity-rubric.d.ts +3 -0
  97. package/dist/default-severity-rubric.d.ts.map +1 -0
  98. package/dist/default-severity-rubric.js +67 -0
  99. package/dist/default-severity-rubric.js.map +1 -0
  100. package/dist/endor-findings.d.ts +7 -0
  101. package/dist/endor-findings.d.ts.map +1 -0
  102. package/dist/endor-findings.js +233 -0
  103. package/dist/endor-findings.js.map +1 -0
  104. package/dist/external-findings-import.d.ts +5 -0
  105. package/dist/external-findings-import.d.ts.map +1 -0
  106. package/dist/external-findings-import.js +38 -0
  107. package/dist/external-findings-import.js.map +1 -0
  108. package/dist/external-findings-local.d.ts +63 -0
  109. package/dist/external-findings-local.d.ts.map +1 -0
  110. package/dist/external-findings-local.js +337 -0
  111. package/dist/external-findings-local.js.map +1 -0
  112. package/dist/external-findings-publish.d.ts +73 -0
  113. package/dist/external-findings-publish.d.ts.map +1 -0
  114. package/dist/external-findings-publish.js +713 -0
  115. package/dist/external-findings-publish.js.map +1 -0
  116. package/dist/external-findings-read.d.ts +6 -0
  117. package/dist/external-findings-read.d.ts.map +1 -0
  118. package/dist/external-findings-read.js +88 -0
  119. package/dist/external-findings-read.js.map +1 -0
  120. package/dist/external-findings.d.ts +21 -0
  121. package/dist/external-findings.d.ts.map +1 -0
  122. package/dist/external-findings.js +2 -0
  123. package/dist/external-findings.js.map +1 -0
  124. package/dist/external-import-contract.d.ts +13 -0
  125. package/dist/external-import-contract.d.ts.map +1 -0
  126. package/dist/external-import-contract.js +254 -0
  127. package/dist/external-import-contract.js.map +1 -0
  128. package/dist/external-import-models.d.ts +362 -0
  129. package/dist/external-import-models.d.ts.map +1 -0
  130. package/dist/external-import-models.js +3 -0
  131. package/dist/external-import-models.js.map +1 -0
  132. package/dist/finding-workflow.d.ts +1 -1
  133. package/dist/finding-workflow.d.ts.map +1 -1
  134. package/dist/finding-workflow.js +2 -1
  135. package/dist/finding-workflow.js.map +1 -1
  136. package/dist/findings-import.d.ts.map +1 -1
  137. package/dist/findings-import.js +23 -3
  138. package/dist/findings-import.js.map +1 -1
  139. package/dist/github-advisories.d.ts +386 -0
  140. package/dist/github-advisories.d.ts.map +1 -0
  141. package/dist/github-advisories.js +131 -0
  142. package/dist/github-advisories.js.map +1 -0
  143. package/dist/github-findings.d.ts +10 -0
  144. package/dist/github-findings.d.ts.map +1 -0
  145. package/dist/github-findings.js +256 -0
  146. package/dist/github-findings.js.map +1 -0
  147. package/dist/host-protocol.d.ts +1 -0
  148. package/dist/host-protocol.d.ts.map +1 -1
  149. package/dist/host-protocol.js +1 -1
  150. package/dist/host-protocol.js.map +1 -1
  151. package/dist/hosted-remediation-protocol.d.ts +6 -0
  152. package/dist/hosted-remediation-protocol.d.ts.map +1 -0
  153. package/dist/hosted-remediation-protocol.js +32 -0
  154. package/dist/hosted-remediation-protocol.js.map +1 -0
  155. package/dist/hosted-remediation.d.ts +93 -0
  156. package/dist/hosted-remediation.d.ts.map +1 -0
  157. package/dist/hosted-remediation.js +124 -0
  158. package/dist/hosted-remediation.js.map +1 -0
  159. package/dist/hosted-scan.d.ts +16 -0
  160. package/dist/hosted-scan.d.ts.map +1 -1
  161. package/dist/hosted-scan.js +14 -2
  162. package/dist/hosted-scan.js.map +1 -1
  163. package/dist/import-scan.d.ts +1 -0
  164. package/dist/import-scan.d.ts.map +1 -1
  165. package/dist/import-scan.js +5 -1
  166. package/dist/import-scan.js.map +1 -1
  167. package/dist/index.d.ts +18 -1
  168. package/dist/index.d.ts.map +1 -1
  169. package/dist/index.js +10 -0
  170. package/dist/index.js.map +1 -1
  171. package/dist/multiscan.d.ts.map +1 -1
  172. package/dist/multiscan.js +3 -1
  173. package/dist/multiscan.js.map +1 -1
  174. package/dist/project-config-schema.d.ts +2 -0
  175. package/dist/project-config-schema.d.ts.map +1 -1
  176. package/dist/project-config-schema.js +1 -0
  177. package/dist/project-config-schema.js.map +1 -1
  178. package/dist/project-config.d.ts +1 -0
  179. package/dist/project-config.d.ts.map +1 -1
  180. package/dist/project-config.js +15 -9
  181. package/dist/project-config.js.map +1 -1
  182. package/dist/publish.d.ts +2 -0
  183. package/dist/publish.d.ts.map +1 -1
  184. package/dist/publish.js +9 -0
  185. package/dist/publish.js.map +1 -1
  186. package/dist/remediation.d.ts +69 -0
  187. package/dist/remediation.d.ts.map +1 -0
  188. package/dist/remediation.js +121 -0
  189. package/dist/remediation.js.map +1 -0
  190. package/dist/request-metadata.d.ts +17 -7
  191. package/dist/request-metadata.d.ts.map +1 -1
  192. package/dist/request-metadata.js +43 -8
  193. package/dist/request-metadata.js.map +1 -1
  194. package/dist/result.d.ts +4 -0
  195. package/dist/result.d.ts.map +1 -1
  196. package/dist/result.js +10 -0
  197. package/dist/result.js.map +1 -1
  198. package/dist/runtime.d.ts +1 -0
  199. package/dist/runtime.d.ts.map +1 -1
  200. package/dist/runtime.js +24 -15
  201. package/dist/runtime.js.map +1 -1
  202. package/dist/saved-scan-bootstrap.d.ts +1 -0
  203. package/dist/saved-scan-bootstrap.d.ts.map +1 -1
  204. package/dist/saved-scan-bootstrap.js +16 -4
  205. package/dist/saved-scan-bootstrap.js.map +1 -1
  206. package/dist/scan-activity.js +8 -8
  207. package/dist/scan-activity.js.map +1 -1
  208. package/dist/scan-comparison.d.ts.map +1 -1
  209. package/dist/scan-comparison.js +15 -9
  210. package/dist/scan-comparison.js.map +1 -1
  211. package/dist/scan-dashboard.d.ts.map +1 -1
  212. package/dist/scan-dashboard.js +12 -6
  213. package/dist/scan-dashboard.js.map +1 -1
  214. package/dist/scan-executor.d.ts +5 -1
  215. package/dist/scan-executor.d.ts.map +1 -1
  216. package/dist/scan-executor.js +9 -8
  217. package/dist/scan-executor.js.map +1 -1
  218. package/dist/scan-owner-suggestions.d.ts +8 -0
  219. package/dist/scan-owner-suggestions.d.ts.map +1 -0
  220. package/dist/scan-owner-suggestions.js +33 -0
  221. package/dist/scan-owner-suggestions.js.map +1 -0
  222. package/dist/{deep-progress.d.ts → scan-progress.d.ts} +15 -7
  223. package/dist/scan-progress.d.ts.map +1 -0
  224. package/dist/scan-progress.js +138 -0
  225. package/dist/scan-progress.js.map +1 -0
  226. package/dist/scan-settings.d.ts +1 -0
  227. package/dist/scan-settings.d.ts.map +1 -1
  228. package/dist/scan-settings.js +4 -0
  229. package/dist/scan-settings.js.map +1 -1
  230. package/dist/scanner-import.d.ts +20 -0
  231. package/dist/scanner-import.d.ts.map +1 -0
  232. package/dist/scanner-import.js +204 -0
  233. package/dist/scanner-import.js.map +1 -0
  234. package/dist/security-policy-diff.d.ts +2 -0
  235. package/dist/security-policy-diff.d.ts.map +1 -0
  236. package/dist/security-policy-diff.js +197 -0
  237. package/dist/security-policy-diff.js.map +1 -0
  238. package/dist/security-policy.d.ts +7 -3
  239. package/dist/security-policy.d.ts.map +1 -1
  240. package/dist/security-policy.js +11 -57
  241. package/dist/security-policy.js.map +1 -1
  242. package/dist/semgrep-findings.d.ts +9 -0
  243. package/dist/semgrep-findings.d.ts.map +1 -0
  244. package/dist/semgrep-findings.js +293 -0
  245. package/dist/semgrep-findings.js.map +1 -0
  246. package/dist/server/embeddings.d.ts.map +1 -1
  247. package/dist/server/embeddings.js +4 -0
  248. package/dist/server/embeddings.js.map +1 -1
  249. package/dist/server/sqlite-store.d.ts.map +1 -1
  250. package/dist/server/sqlite-store.js +14 -2
  251. package/dist/server/sqlite-store.js.map +1 -1
  252. package/dist/severity-review.d.ts +3 -0
  253. package/dist/severity-review.d.ts.map +1 -1
  254. package/dist/severity-review.js +19 -0
  255. package/dist/severity-review.js.map +1 -1
  256. package/dist/severity-store.js +11 -3
  257. package/dist/severity-store.js.map +1 -1
  258. package/dist/snyk-findings.d.ts +9 -0
  259. package/dist/snyk-findings.d.ts.map +1 -0
  260. package/dist/snyk-findings.js +349 -0
  261. package/dist/snyk-findings.js.map +1 -0
  262. package/dist/targets.d.ts +2 -2
  263. package/dist/targets.d.ts.map +1 -1
  264. package/dist/targets.js +12 -2
  265. package/dist/targets.js.map +1 -1
  266. package/dist/timestamps.d.ts +3 -0
  267. package/dist/timestamps.d.ts.map +1 -0
  268. package/dist/timestamps.js +14 -0
  269. package/dist/timestamps.js.map +1 -0
  270. package/dist/version.d.ts +1 -1
  271. package/dist/version.d.ts.map +1 -1
  272. package/dist/version.js +13 -2
  273. package/dist/version.js.map +1 -1
  274. package/dist/wiz-csv.d.ts +8 -0
  275. package/dist/wiz-csv.d.ts.map +1 -0
  276. package/dist/wiz-csv.js +116 -0
  277. package/dist/wiz-csv.js.map +1 -0
  278. package/dist/wiz-findings.d.ts +4 -0
  279. package/dist/wiz-findings.d.ts.map +1 -0
  280. package/dist/wiz-findings.js +460 -0
  281. package/dist/wiz-findings.js.map +1 -0
  282. package/dist/workbench-arguments.d.ts.map +1 -1
  283. package/dist/workbench-arguments.js +9 -3
  284. package/dist/workbench-arguments.js.map +1 -1
  285. package/dist/worker-progress.d.ts +11 -1
  286. package/dist/worker-progress.d.ts.map +1 -1
  287. package/dist/worker-progress.js +11 -1
  288. package/dist/worker-progress.js.map +1 -1
  289. package/docs/classify-severity-records.md +28 -10
  290. package/docs/cli.md +788 -46
  291. package/docs/findings-service.md +7 -2
  292. package/docs/hosted-remediation.md +134 -0
  293. package/docs/hosted-scans.md +20 -3
  294. package/package.json +9 -6
  295. package/schemas/external-findings.schema.json +1421 -0
  296. package/schemas/project-config.schema.json +4 -0
  297. package/dist/deep-progress.d.ts.map +0 -1
  298. package/dist/deep-progress.js +0 -92
  299. package/dist/deep-progress.js.map +0 -1
@@ -25,6 +25,8 @@ deployments; local deduplication uses the database selected by
25
25
  For direct embedding/storage integrations, `OpenAiFindingEmbedder` accepts a
26
26
  static key or `() => string | Promise<string>` as its first argument. It calls
27
27
  the callback before each HTTP batch; the caller handles token acquisition.
28
+ Cancellation prevents a new callback or HTTP request. Direct embedder callers
29
+ still await a key callback that has already started.
28
30
  Pass `fetch` as the second argument and the full endpoint URL as the third.
29
31
  By default, the saved-scan deduplication APIs use environment credentials. A
30
32
  custom SDK `embedding` binding can supply an adapter with its own credentials,
@@ -185,7 +187,8 @@ console.log(result.duplicateGroups);
185
187
  For a different embedding provider or model, both saved-scan SDK methods accept
186
188
  an `embedding` binding. Reuse the `FindingEmbedder` interface: return one
187
189
  `{ model, vector }` per input finding, in input order. The adapter owns its
188
- credentials, tokenization, chunking, and provider request format.
190
+ credentials, tokenization, chunking, and provider request format. Cancellation
191
+ stops the SDK's wait for embeddings; the adapter owns cleanup of its ongoing work.
189
192
 
190
193
  ```typescript
191
194
  import { deduplicateScan, type FindingEmbedder } from "@openai/codex-security";
@@ -314,7 +317,9 @@ required-source-access blockers are not retried. Refusals are not retried or
314
317
  sent to another model. If candidate retrieval or review still fails, the
315
318
  operation fails without posting groups.
316
319
  A failed group-write request may already have committed; resubmitting the same
317
- memberships does not create duplicate groups. Non-cancellation review failures
320
+ memberships does not create duplicate groups. Cancellation can also arrive after
321
+ a write completes; it does not mean that remote findings are unchanged. Completed
322
+ workflow stages remain saved even when cancellation is reported. Non-cancellation review failures
318
323
  throw `DeduplicationReviewError`, with diagnostic text and `metadata` for the
319
324
  stage, model, category, attempt count, and reason.
320
325
 
@@ -0,0 +1,134 @@
1
+ # Hosted patching and fix verification
2
+
3
+ `runHostedRemediation(input, { executor, signal, onEvent })` runs one patch or
4
+ verification using the same skills, prompts, and result schemas as the local
5
+ CLI. It requires a host executor and never starts local inference. This API is
6
+ separate from the Standard scan API and does not create scan/workbench state.
7
+
8
+ The host prepares an isolated checkout, freezes its HEAD, supplies the original
9
+ finding evidence and repository instructions, and enforces the requested
10
+ sandbox. For verification, the host must first apply the exact candidate patch
11
+ to its recorded base. The API does not apply a patch or infer a branch from the
12
+ finding. It checks HEAD before and after execution; the host owns checking the
13
+ candidate's bytes/digest and verifying that verification did not change them.
14
+
15
+ ```ts
16
+ const result = await runHostedRemediation(
17
+ {
18
+ version: 1,
19
+ operation: "verify", // or "patch"
20
+ repository: "/workspace/repository",
21
+ revision: "0123456789012345678901234567890123456789",
22
+ finding: {
23
+ id: "finding-1",
24
+ context:
25
+ "Original vulnerability, source evidence, reproducer, and controls.",
26
+ },
27
+ instructions: "Preserve existing repository conventions.",
28
+ validationInstructions:
29
+ "Run the focused reproduction and legitimate control.",
30
+ model: "your-model",
31
+ reasoningEffort: "high",
32
+ identity: {
33
+ runId: "run-1",
34
+ attemptId: "attempt-1",
35
+ buildId: "runtime-build",
36
+ },
37
+ },
38
+ { executor },
39
+ );
40
+ ```
41
+
42
+ Both instruction fields are optional and are distinct from finding data.
43
+ Reasoning effort is passed through unchanged so the selected model and provider
44
+ determine which values they support.
45
+ Verification remains read-only even when validation instructions request setup:
46
+ a required check that cannot run without repository changes is a proof gap,
47
+ not permission to edit. Generation's ordinary skill checks and standalone
48
+ verification are separate operations.
49
+
50
+ Set `verificationMode: "static"` to review attack paths, bypasses, and legitimate
51
+ behavior from source and diffs, without installing dependencies or executing
52
+ builds, tests, reproducers, or the application. Select it for both `patch` and
53
+ `verify` requests when both stages should be static. Omitted or `"standard"`
54
+ retains the existing behavior.
55
+
56
+ Static mode treats validation instructions as source-review questions. Missing
57
+ runtime tooling alone is not a blocker; material proof gaps still produce
58
+ `blocked` or `inconclusive`. Results must cite source evidence and state that
59
+ runtime checks were not performed. Hosts should retain and display the selected
60
+ mode with each attempt. This is an assessment policy; sandbox permissions remain
61
+ unchanged and do not enforce the static scope.
62
+
63
+ The executor receives one request with a unique `requestId`, operation,
64
+ repository/revision, identity, finding ID, prompt, model, reasoning effort,
65
+ `sandbox` (`workspace-write` for patch, `read-only` for verify), and
66
+ `runtime: { pluginRoot, pluginVersion }`. Its receipt contains the same
67
+ `requestId`, `status` (`completed`, `failed`, `canceled`, or
68
+ `acceptance_unknown`), `sessionId` (required for completed execution), and
69
+ optional `finalResponse`, opaque `usage`, `message`, and `error`.
70
+
71
+ The returned result retains that receipt, runtime provenance and request
72
+ identity even when parsing fails. `status: "completed"` means execution and
73
+ result validation finished; it does not imply that a patch fixed the finding:
74
+
75
+ - `patch` contains `occurrenceId`, `status` (`verified`, `no_change`, `blocked`,
76
+ or `failed`), `files`, and optional `verification`/`reason`. Verified and
77
+ no-change outcomes require verification evidence; blocked and failed outcomes
78
+ require a reason. The host must inspect the actual changes, collect the
79
+ canonical diff, and run separate verification.
80
+ - `verification` contains `id`, `status` (`fixed`, `still_vulnerable`, or
81
+ `inconclusive`), nonempty `evidence`, and a nonempty `checks` array. Each check
82
+ contains a nonempty `name`, `status` (`passed`, `failed`, or `not_run`),
83
+ nonempty `evidence`, and optional `command`. Names and evidence distinguish
84
+ static assessment from executed tests; `command` records an actual attempted
85
+ command, not a suggestion. A required check that could not be completed is
86
+ `not_run` with its blocker in `evidence`. An inconclusive result is preserved
87
+ as an assessment outcome rather than converted to execution failure.
88
+
89
+ Hosted verification requests these checks explicitly and rejects a result with
90
+ missing or empty checks, or a `fixed` verdict with a failed or unrun check. The
91
+ model must report the required vulnerability and legitimate-behavior checks;
92
+ the SDK does not reconstruct checks from prose. A malformed result retains the
93
+ execution receipt and returns `status: "failed"` with `INVALID_RESULT`, rather
94
+ than claiming verification succeeded. Shared result types keep `checks`
95
+ optional for older and local results; the local CLI command and result contract
96
+ are unchanged.
97
+
98
+ The host owns durable attempts, cancellation/reconciliation, usage, artifact
99
+ storage and publication. No operation publishes a pull request or marks a
100
+ finding closed. Retrying persistence must not resubmit execution.
101
+
102
+ ## JSON-RPC launcher
103
+
104
+ Use the public CLI to run the hosted protocol:
105
+
106
+ ```bash
107
+ codex-security patch --host
108
+ codex-security verify-fix --host
109
+ ```
110
+
111
+ Use `--host` alone with either command. The `run` request supplies all settings,
112
+ and its `operation` must match the command: `patch` or `verify`, respectively.
113
+ Neither command falls back to local inference. Ordinary patching and verification
114
+ remain unchanged when `--host` is omitted.
115
+
116
+ The SDK also exports `runHostedRemediationProtocol` for in-process hosts.
117
+
118
+ Use the existing newline-delimited host transport: send one `run` request whose
119
+ `params` are the input above; respond to `execution.run` with the executor
120
+ receipt. `execution.progress` notifications use `{ requestId, event }` and are
121
+ forwarded as `remediation.progress` with `{ id: originalRunId, event }`. Send
122
+ `cancel` with `{ id: originalRunId }` to receive `execution.cancel`; then return
123
+ the final execution receipt so usage and session identity survive cancellation.
124
+ The transport emits one terminal result. Preparation failures are JSON-RPC
125
+ errors; a mismatched HEAD includes `error.data.reason: "revision_mismatch"`.
126
+
127
+ Run the deterministic installed-package smoke check without model credentials:
128
+
129
+ ```sh
130
+ node scripts/smoke-hosted-remediation.mjs /path/to/node_modules/@openai/codex-security
131
+ ```
132
+
133
+ It uses a fake executor over real pipes, prepares a synthetic candidate, and
134
+ checks both operation contracts. It does not evaluate actual model fixes.
@@ -4,6 +4,9 @@
4
4
  stdin/stdout. Use the flag alone. It performs no login, update check, local
5
5
  inference, or model fallback. Ordinary local scans keep their existing behavior.
6
6
 
7
+ For hosted patch generation and verification, use the separate
8
+ [hosted remediation API](hosted-remediation.md).
9
+
7
10
  ## Public executor API
8
11
 
9
12
  Use the standalone `runHostedScan(input, { executor, signal, onEvent })`
@@ -71,11 +74,25 @@ Standard scan lifecycle. Omit `scope` for the entire repository, or pass literal
71
74
  repository-relative folders/files. Model settings come from the frozen input;
72
75
  local profiles and other local scan options are not accepted.
73
76
 
77
+ Set `ownerSuggestions: true` on the input to generate the optional
78
+ `owner-suggestions.json` after sealing the base scan. The completed receipt
79
+ includes that artifact when available, or `ownerSuggestionsError` if the owner
80
+ stage fails. Owner failure or cancellation does not invalidate sealed findings.
81
+ The SDK host can pass `ownerCodex` in the options to execute read-only owner
82
+ decisions using its own inference service. Without that callback, CODEOWNERS
83
+ matches still work and findings that require inference report an owner error.
84
+ The callback receives the model and reasoning effort in `startThread`, then
85
+ the prompt, output schema, and cancellation signal in `run`.
86
+ The CLI protocol does not provide an owner inference callback. Hosted owner
87
+ enrichment never launches local Codex or selects local credentials.
88
+
74
89
  `ScanExecutor.run` receives an AbortSignal and an optional `onEvent` observer for
75
90
  `{type: "progress", progress}` or `{type: "activity", activity}` events. Progress
76
- uses the existing `ScanProgress` type; activity uses `ScanActivity`. Observer
77
- failures cannot stop execution. Aborting waits for the executor to settle; the
78
- host must cancel remote work and return its recorded outcome.
91
+ uses the existing `ScanProgress` type; activity uses `ScanActivity`. Progress may
92
+ include `reviewItems: { completed, total }` for saved reviews, counted separately
93
+ from files. Observer failures cannot stop execution. Aborting waits for the
94
+ executor to settle; the host must cancel remote work and return its recorded
95
+ outcome.
79
96
 
80
97
  Preparation errors throw before execution. Execution and finalization return a
81
98
  `HostedScanResult` receipt with status `completed`, `failed`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openai/codex-security",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "TypeScript SDK and CLI for Codex Security",
5
5
  "license": "Apache-2.0",
6
6
  "author": "OpenAI",
@@ -47,7 +47,8 @@
47
47
  "docs/dedupe-records.md",
48
48
  "docs/classify-severity-records.md",
49
49
  "docs/hosted-scans.md",
50
- "docs/validate-records.md"
50
+ "docs/validate-records.md",
51
+ "docs/hosted-remediation.md"
51
52
  ],
52
53
  "publishConfig": {
53
54
  "access": "public",
@@ -57,7 +58,7 @@
57
58
  },
58
59
  "dependencies": {
59
60
  "@inquirer/prompts": "8.7.3",
60
- "@linear/sdk": "97.1.0",
61
+ "@linear/sdk": "97.2.0",
61
62
  "@octokit/core": "7.0.8",
62
63
  "@openai/codex": "0.163.0",
63
64
  "@openai/codex-sdk": "0.163.0",
@@ -76,7 +77,7 @@
76
77
  "strip-ansi": "7.2.0",
77
78
  "yaml": "2.9.1",
78
79
  "yauzl": "3.4.0",
79
- "zod": "4.6.6"
80
+ "zod": "4.6.7"
80
81
  },
81
82
  "devDependencies": {
82
83
  "@stryker-mutator/core": "10.0.0",
@@ -95,7 +96,7 @@
95
96
  "prettier": "3.9.10",
96
97
  "typescript": "7.0.2"
97
98
  },
98
- "gitHead": "03414ad84e91a8638bde85af08c47fe957dc9323",
99
+ "gitHead": "13dcc6fec00aaf4c23a6fa7e375ccc1726b22836",
99
100
  "scripts": {
100
101
  "audit:prod": "pnpm audit --prod --audit-level high",
101
102
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
@@ -109,12 +110,14 @@
109
110
  "format": "prettier --check --ignore-path .gitignore --ignore-path .prettierignore \"**/*.{cjs,mjs,js,ts,mts,tsx,json}\" \"../../.github/scripts/*.mts\" \"../../examples/custom-validation/*.mts\" \"../../plugins/codex-security/native/*.mts\" \"../../evals/{deep-reducer,secret-discovery,workflow-routing}/*.mts\" \"../../evals/triage-finding/{assertions,scripts,sastbench/assertions,sastbench/scripts}/*.mts\" \"../../evals/triage-finding/types.ts\" \"../../evals/tsconfig.json\" && node scripts/check-markdown.mjs",
110
111
  "generate:models": "node scripts/generate-models.cjs",
111
112
  "generate:models:check": "node scripts/generate-models.cjs --check",
113
+ "generate:external-import-models": "node scripts/generate-external-import-models.cjs",
114
+ "generate:external-import-models:check": "node scripts/generate-external-import-models.cjs --check",
112
115
  "lint": "tsc --noEmit",
113
116
  "test": "node --run build:plugin && bun test --timeout 30000 ./tests-ts",
114
117
  "test:ci": "node -e \"require('node:fs').mkdirSync('reports',{recursive:true})\" && pnpm run test --coverage --coverage-reporter=text --coverage-reporter=lcov --reporter=junit --reporter-outfile=reports/junit.xml",
115
118
  "test:mcp": "node --run build:plugin && pnpm --dir ../../plugins/codex-security/mcp-app run test:mcp",
116
119
  "test:mutation": "stryker run",
117
120
  "test:package": "node scripts/smoke-package.mjs",
118
- "types": "node scripts/generate-deep-defaults.mjs --check && node scripts/generate-project-config-schema.mjs --check && pnpm run generate:models:check && pnpm --dir ../../plugins/codex-security/mcp-app run typecheck && tsc --noEmit"
121
+ "types": "node scripts/generate-deep-defaults.mjs --check && node scripts/generate-project-config-schema.mjs --check && pnpm run generate:models:check && pnpm run generate:external-import-models:check && pnpm --dir ../../plugins/codex-security/mcp-app run typecheck && tsc --noEmit"
119
122
  }
120
123
  }