@openai/codex-security 0.5.1 → 0.7.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 (313) hide show
  1. package/README.md +151 -36
  2. package/_bundled_plugin/.mcp.json +1 -0
  3. package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
  4. package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
  5. package/_bundled_plugin/mcp/native/THIRD_PARTY_NOTICES.txt +1 -1
  6. package/_bundled_plugin/mcp/native/darwin-arm64/unix.node +0 -0
  7. package/_bundled_plugin/mcp/native/darwin-x64/unix.node +0 -0
  8. package/_bundled_plugin/mcp/native/linux-arm64-gnu/unix.node +0 -0
  9. package/_bundled_plugin/mcp/native/linux-arm64-musl/unix.node +0 -0
  10. package/_bundled_plugin/mcp/native/linux-x64-gnu/unix.node +0 -0
  11. package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
  12. package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
  13. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  14. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  15. package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
  16. package/_bundled_plugin/references/access-advisory.md +11 -0
  17. package/_bundled_plugin/references/core-scan.md +30 -77
  18. package/_bundled_plugin/references/final-report.md +45 -189
  19. package/_bundled_plugin/references/scan-contract.md +2 -0
  20. package/_bundled_plugin/references/scan-prologue.md +1 -1
  21. package/_bundled_plugin/references/scan-runtime.md +1 -5
  22. package/_bundled_plugin/references/threat-model.md +33 -41
  23. package/_bundled_plugin/schemas/coverage.schema.json +12 -1
  24. package/_bundled_plugin/schemas/scan-manifest.schema.json +1 -0
  25. package/_bundled_plugin/schemas/tools/deep-reducer.schema.json +38 -1
  26. package/_bundled_plugin/scripts/deep_scan_config.py +39 -39
  27. package/_bundled_plugin/scripts/deep_scan_workbench.py +145 -85
  28. package/_bundled_plugin/scripts/finalize_scan_contract.py +189 -57
  29. package/_bundled_plugin/scripts/report_projection.py +44 -15
  30. package/_bundled_plugin/scripts/threat_model_projection.py +4 -2
  31. package/_bundled_plugin/scripts/windows_scan_local_files.py +43 -14
  32. package/_bundled_plugin/scripts/workbench/retained_coverage.py +3218 -0
  33. package/_bundled_plugin/scripts/workbench/retained_records.py +627 -0
  34. package/_bundled_plugin/scripts/workbench/saved_coverage.py +644 -1
  35. package/_bundled_plugin/scripts/workbench/saved_outputs.py +72 -0
  36. package/_bundled_plugin/scripts/workbench/saved_sources.py +712 -0
  37. package/_bundled_plugin/scripts/workbench_cli.py +3 -0
  38. package/_bundled_plugin/scripts/workbench_coverage_receipts.py +479 -0
  39. package/_bundled_plugin/scripts/workbench_db.py +51 -22
  40. package/_bundled_plugin/scripts/workbench_feedback.py +0 -1
  41. package/_bundled_plugin/scripts/workbench_finding_workflows.py +53 -9
  42. package/_bundled_plugin/scripts/workbench_native_indexes.py +56 -44
  43. package/_bundled_plugin/scripts/workbench_saved_results.py +641 -2387
  44. package/_bundled_plugin/scripts/workbench_scan_history.py +72 -7
  45. package/_bundled_plugin/scripts/workbench_schema.py +1 -1
  46. package/_bundled_plugin/scripts/workbench_source_scopes.py +4 -1
  47. package/_bundled_plugin/scripts/workbench_target.py +142 -17
  48. package/_bundled_plugin/scripts/workbench_validation.py +9 -2
  49. package/_bundled_plugin/shared/workbench-history-repairs.json +21 -0
  50. package/_bundled_plugin/shared/workbench-migrations.json +44 -0
  51. package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +3 -14
  52. package/_bundled_plugin/skills/assess-patch-risk/references/windows-validation.md +14 -0
  53. package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +38 -103
  54. package/_bundled_plugin/skills/attack-path-analysis/references/attack-path-facts.md +11 -73
  55. package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +57 -116
  56. package/_bundled_plugin/skills/deep-security-scan/SKILL.md +28 -51
  57. package/_bundled_plugin/skills/define-security-policy/SKILL.md +9 -9
  58. package/_bundled_plugin/skills/finding-discovery/SKILL.md +26 -140
  59. package/_bundled_plugin/skills/fix-finding/SKILL.md +19 -30
  60. package/_bundled_plugin/skills/propose-security-hardening/SKILL.md +28 -218
  61. package/_bundled_plugin/skills/propose-security-hardening/references/proposal-format.md +29 -424
  62. package/_bundled_plugin/skills/publish-findings/SKILL.md +134 -0
  63. package/_bundled_plugin/skills/publish-findings/agents/openai.yaml +6 -0
  64. package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +64 -0
  65. package/_bundled_plugin/skills/security-diff-scan/SKILL.md +12 -12
  66. package/_bundled_plugin/skills/security-scan/SKILL.md +28 -16
  67. package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +11 -17
  68. package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +52 -69
  69. package/_bundled_plugin/skills/threat-model/SKILL.md +16 -9
  70. package/_bundled_plugin/skills/triage-finding/SKILL.md +5 -15
  71. package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +6 -6
  72. package/_bundled_plugin/skills/validation/SKILL.md +42 -104
  73. package/_bundled_plugin/skills/validation/references/validation-guidance.md +21 -106
  74. package/_bundled_plugin/skills/verify-fix/SKILL.md +8 -4
  75. package/_bundled_plugin/skills/vulnerability-writeup/SKILL.md +21 -159
  76. package/_bundled_plugin/skills/vulnerability-writeup/references/report-format.md +18 -60
  77. package/dist/api.d.ts +8 -3
  78. package/dist/api.d.ts.map +1 -1
  79. package/dist/api.js +414 -72
  80. package/dist/api.js.map +1 -1
  81. package/dist/auth.d.ts.map +1 -1
  82. package/dist/auth.js +4 -1
  83. package/dist/auth.js.map +1 -1
  84. package/dist/classify-severity-records.d.ts +5 -2
  85. package/dist/classify-severity-records.d.ts.map +1 -1
  86. package/dist/classify-severity-records.js +40 -34
  87. package/dist/classify-severity-records.js.map +1 -1
  88. package/dist/classify-severity.d.ts +5 -1
  89. package/dist/classify-severity.d.ts.map +1 -1
  90. package/dist/classify-severity.js +20 -30
  91. package/dist/classify-severity.js.map +1 -1
  92. package/dist/cli-help.d.ts.map +1 -1
  93. package/dist/cli-help.js +1 -0
  94. package/dist/cli-help.js.map +1 -1
  95. package/dist/cli.d.ts +9 -2
  96. package/dist/cli.d.ts.map +1 -1
  97. package/dist/cli.js +802 -149
  98. package/dist/cli.js.map +1 -1
  99. package/dist/cloud-endpoint.d.ts +6 -0
  100. package/dist/cloud-endpoint.d.ts.map +1 -0
  101. package/dist/cloud-endpoint.js +51 -0
  102. package/dist/cloud-endpoint.js.map +1 -0
  103. package/dist/cloud-publish.d.ts.map +1 -1
  104. package/dist/cloud-publish.js +7 -5
  105. package/dist/cloud-publish.js.map +1 -1
  106. package/dist/component-scan.d.ts +8 -2
  107. package/dist/component-scan.d.ts.map +1 -1
  108. package/dist/component-scan.js +2 -0
  109. package/dist/component-scan.js.map +1 -1
  110. package/dist/contract.d.ts +2 -0
  111. package/dist/contract.d.ts.map +1 -1
  112. package/dist/contract.js +67 -33
  113. package/dist/contract.js.map +1 -1
  114. package/dist/cost.d.ts +18 -0
  115. package/dist/cost.d.ts.map +1 -1
  116. package/dist/cost.js +107 -12
  117. package/dist/cost.js.map +1 -1
  118. package/dist/coverage-presentation.d.ts +6 -0
  119. package/dist/coverage-presentation.d.ts.map +1 -0
  120. package/dist/coverage-presentation.js +34 -0
  121. package/dist/coverage-presentation.js.map +1 -0
  122. package/dist/custom-validation-prompt.js +3 -3
  123. package/dist/custom-validation-prompt.js.map +1 -1
  124. package/dist/custom-validation.d.ts.map +1 -1
  125. package/dist/custom-validation.js +30 -4
  126. package/dist/custom-validation.js.map +1 -1
  127. package/dist/deduplication/checkpointed-review.d.ts.map +1 -1
  128. package/dist/deduplication/checkpointed-review.js +3 -1
  129. package/dist/deduplication/checkpointed-review.js.map +1 -1
  130. package/dist/deduplication/scan.d.ts.map +1 -1
  131. package/dist/deduplication/scan.js +7 -5
  132. package/dist/deduplication/scan.js.map +1 -1
  133. package/dist/default-severity-rubric.d.ts +3 -0
  134. package/dist/default-severity-rubric.d.ts.map +1 -0
  135. package/dist/default-severity-rubric.js +67 -0
  136. package/dist/default-severity-rubric.js.map +1 -0
  137. package/dist/endor-findings.d.ts +8 -0
  138. package/dist/endor-findings.d.ts.map +1 -0
  139. package/dist/endor-findings.js +238 -0
  140. package/dist/endor-findings.js.map +1 -0
  141. package/dist/external-findings-import.d.ts +5 -0
  142. package/dist/external-findings-import.d.ts.map +1 -0
  143. package/dist/external-findings-import.js +46 -0
  144. package/dist/external-findings-import.js.map +1 -0
  145. package/dist/external-findings-local.d.ts +63 -0
  146. package/dist/external-findings-local.d.ts.map +1 -0
  147. package/dist/external-findings-local.js +344 -0
  148. package/dist/external-findings-local.js.map +1 -0
  149. package/dist/external-findings-publish.d.ts +73 -0
  150. package/dist/external-findings-publish.d.ts.map +1 -0
  151. package/dist/external-findings-publish.js +721 -0
  152. package/dist/external-findings-publish.js.map +1 -0
  153. package/dist/external-findings-read.d.ts +16 -0
  154. package/dist/external-findings-read.d.ts.map +1 -0
  155. package/dist/external-findings-read.js +97 -0
  156. package/dist/external-findings-read.js.map +1 -0
  157. package/dist/external-findings.d.ts +21 -0
  158. package/dist/external-findings.d.ts.map +1 -0
  159. package/dist/external-findings.js +2 -0
  160. package/dist/external-findings.js.map +1 -0
  161. package/dist/external-import-contract.d.ts +15 -0
  162. package/dist/external-import-contract.d.ts.map +1 -0
  163. package/dist/external-import-contract.js +262 -0
  164. package/dist/external-import-contract.js.map +1 -0
  165. package/dist/external-import-models.d.ts +362 -0
  166. package/dist/external-import-models.d.ts.map +1 -0
  167. package/dist/external-import-models.js +3 -0
  168. package/dist/external-import-models.js.map +1 -0
  169. package/dist/external-imports-feature.d.ts +6 -0
  170. package/dist/external-imports-feature.d.ts.map +1 -0
  171. package/dist/external-imports-feature.js +51 -0
  172. package/dist/external-imports-feature.js.map +1 -0
  173. package/dist/finding-workflow.d.ts +23 -6
  174. package/dist/finding-workflow.d.ts.map +1 -1
  175. package/dist/finding-workflow.js +23 -10
  176. package/dist/finding-workflow.js.map +1 -1
  177. package/dist/github-advisories.d.ts +386 -0
  178. package/dist/github-advisories.d.ts.map +1 -0
  179. package/dist/github-advisories.js +133 -0
  180. package/dist/github-advisories.js.map +1 -0
  181. package/dist/github-findings.d.ts +11 -0
  182. package/dist/github-findings.d.ts.map +1 -0
  183. package/dist/github-findings.js +258 -0
  184. package/dist/github-findings.js.map +1 -0
  185. package/dist/hosted-remediation-protocol.d.ts +2 -1
  186. package/dist/hosted-remediation-protocol.d.ts.map +1 -1
  187. package/dist/hosted-remediation-protocol.js +17 -11
  188. package/dist/hosted-remediation-protocol.js.map +1 -1
  189. package/dist/hosted-remediation.d.ts +4 -0
  190. package/dist/hosted-remediation.d.ts.map +1 -1
  191. package/dist/hosted-remediation.js +22 -3
  192. package/dist/hosted-remediation.js.map +1 -1
  193. package/dist/hosted-scan.d.ts +16 -0
  194. package/dist/hosted-scan.d.ts.map +1 -1
  195. package/dist/hosted-scan.js +9 -2
  196. package/dist/hosted-scan.js.map +1 -1
  197. package/dist/import-scan.js +1 -1
  198. package/dist/import-scan.js.map +1 -1
  199. package/dist/index.d.ts +16 -3
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js +9 -1
  202. package/dist/index.js.map +1 -1
  203. package/dist/knowledge-base.d.ts +1 -0
  204. package/dist/knowledge-base.d.ts.map +1 -1
  205. package/dist/knowledge-base.js +17 -8
  206. package/dist/knowledge-base.js.map +1 -1
  207. package/dist/models.d.ts +1 -0
  208. package/dist/models.d.ts.map +1 -1
  209. package/dist/models.js.map +1 -1
  210. package/dist/owner-evidence.d.ts +2 -0
  211. package/dist/owner-evidence.d.ts.map +1 -1
  212. package/dist/owner-evidence.js +2 -1
  213. package/dist/owner-evidence.js.map +1 -1
  214. package/dist/project-config-schema.d.ts +2 -0
  215. package/dist/project-config-schema.d.ts.map +1 -1
  216. package/dist/project-config-schema.js +1 -0
  217. package/dist/project-config-schema.js.map +1 -1
  218. package/dist/project-config.d.ts +1 -0
  219. package/dist/project-config.d.ts.map +1 -1
  220. package/dist/project-config.js +2 -0
  221. package/dist/project-config.js.map +1 -1
  222. package/dist/publish.d.ts +2 -0
  223. package/dist/publish.d.ts.map +1 -1
  224. package/dist/publish.js +1 -1
  225. package/dist/publish.js.map +1 -1
  226. package/dist/remediation.d.ts +7 -25
  227. package/dist/remediation.d.ts.map +1 -1
  228. package/dist/remediation.js +18 -28
  229. package/dist/remediation.js.map +1 -1
  230. package/dist/result.d.ts +4 -0
  231. package/dist/result.d.ts.map +1 -1
  232. package/dist/result.js +10 -0
  233. package/dist/result.js.map +1 -1
  234. package/dist/runtime.d.ts +1 -0
  235. package/dist/runtime.d.ts.map +1 -1
  236. package/dist/runtime.js +10 -8
  237. package/dist/runtime.js.map +1 -1
  238. package/dist/scan-dashboard.d.ts +5 -3
  239. package/dist/scan-dashboard.d.ts.map +1 -1
  240. package/dist/scan-dashboard.js +79 -26
  241. package/dist/scan-dashboard.js.map +1 -1
  242. package/dist/scan-history-renderer.d.ts.map +1 -1
  243. package/dist/scan-history-renderer.js +8 -2
  244. package/dist/scan-history-renderer.js.map +1 -1
  245. package/dist/scan-owner-suggestions.d.ts +8 -0
  246. package/dist/scan-owner-suggestions.d.ts.map +1 -0
  247. package/dist/scan-owner-suggestions.js +33 -0
  248. package/dist/scan-owner-suggestions.js.map +1 -0
  249. package/dist/scan-settings.d.ts +1 -0
  250. package/dist/scan-settings.d.ts.map +1 -1
  251. package/dist/scan-settings.js +4 -0
  252. package/dist/scan-settings.js.map +1 -1
  253. package/dist/scan-usage-display.d.ts +8 -0
  254. package/dist/scan-usage-display.d.ts.map +1 -0
  255. package/dist/scan-usage-display.js +46 -0
  256. package/dist/scan-usage-display.js.map +1 -0
  257. package/dist/scanner-import.d.ts +20 -0
  258. package/dist/scanner-import.d.ts.map +1 -0
  259. package/dist/scanner-import.js +208 -0
  260. package/dist/scanner-import.js.map +1 -0
  261. package/dist/security-policy-diff.d.ts +2 -0
  262. package/dist/security-policy-diff.d.ts.map +1 -0
  263. package/dist/security-policy-diff.js +197 -0
  264. package/dist/security-policy-diff.js.map +1 -0
  265. package/dist/security-policy.d.ts +7 -3
  266. package/dist/security-policy.d.ts.map +1 -1
  267. package/dist/security-policy.js +11 -76
  268. package/dist/security-policy.js.map +1 -1
  269. package/dist/semgrep-findings.d.ts +10 -0
  270. package/dist/semgrep-findings.d.ts.map +1 -0
  271. package/dist/semgrep-findings.js +293 -0
  272. package/dist/semgrep-findings.js.map +1 -0
  273. package/dist/severity-review.d.ts +3 -0
  274. package/dist/severity-review.d.ts.map +1 -1
  275. package/dist/severity-review.js +19 -0
  276. package/dist/severity-review.js.map +1 -1
  277. package/dist/severity-store.js +7 -2
  278. package/dist/severity-store.js.map +1 -1
  279. package/dist/skill-authentication.d.ts +18 -0
  280. package/dist/skill-authentication.d.ts.map +1 -0
  281. package/dist/skill-authentication.js +82 -0
  282. package/dist/skill-authentication.js.map +1 -0
  283. package/dist/snyk-findings.d.ts +10 -0
  284. package/dist/snyk-findings.d.ts.map +1 -0
  285. package/dist/snyk-findings.js +350 -0
  286. package/dist/snyk-findings.js.map +1 -0
  287. package/dist/suggest-owners.d.ts +4 -1
  288. package/dist/suggest-owners.d.ts.map +1 -1
  289. package/dist/suggest-owners.js +53 -21
  290. package/dist/suggest-owners.js.map +1 -1
  291. package/dist/targets.d.ts +2 -2
  292. package/dist/targets.d.ts.map +1 -1
  293. package/dist/targets.js +16 -3
  294. package/dist/targets.js.map +1 -1
  295. package/dist/wiz-csv.d.ts +9 -0
  296. package/dist/wiz-csv.d.ts.map +1 -0
  297. package/dist/wiz-csv.js +116 -0
  298. package/dist/wiz-csv.js.map +1 -0
  299. package/dist/wiz-findings.d.ts +5 -0
  300. package/dist/wiz-findings.d.ts.map +1 -0
  301. package/dist/wiz-findings.js +464 -0
  302. package/dist/wiz-findings.js.map +1 -0
  303. package/docs/classify-severity-records.md +30 -13
  304. package/docs/cli.md +835 -47
  305. package/docs/findings-service.md +119 -118
  306. package/docs/hosted-remediation.md +43 -24
  307. package/docs/hosted-scans.md +38 -0
  308. package/package.json +11 -9
  309. package/schemas/external-findings.schema.json +1421 -0
  310. package/schemas/project-config.schema.json +4 -0
  311. package/_bundled_plugin/scripts/generate_in_scope_files.py +0 -277
  312. package/_bundled_plugin/scripts/generate_rank_input.py +0 -350
  313. package/_bundled_plugin/scripts/rank_preview.py +0 -129
@@ -5,124 +5,7 @@ Deduplication reads that database directly; no local HTTP service is needed.
5
5
  The CLI can also publish to and deduplicate against independently operated
6
6
  compatible endpoints through explicit `--findings-url` settings.
7
7
 
8
- ## Local service removal
9
-
10
- The `serve` command (including `--port`), `start:server` script,
11
- `dist/server/index.js` entrypoint, `startFindingsServer` SDK export, browser
12
- dashboard, and findings-service Compose deployment have been removed.
13
- `HOST`, `PORT`, and `CODEX_SECURITY_FINDINGS_IMAGE` no longer configure a bundled
14
- service. The dashboard storage projection is also removed.
15
-
16
- Existing SQLite databases, migrations, saved scans, findings, and duplicate
17
- groups are retained. No data migration or deletion is performed. Keep any
18
- existing service volume or state directory and back it up before changing
19
- deployments; local deduplication uses the database selected by
20
- `CODEX_SECURITY_STATE_DIR`, not a separate service volume automatically.
21
-
22
- `@openai/codex-security/server` continues to export `OpenAiFindingEmbedder`,
23
- `SqliteFindingsStore`, and their storage types for direct storage users.
24
-
25
- For direct embedding/storage integrations, `OpenAiFindingEmbedder` accepts a
26
- static key or `() => string | Promise<string>` as its first argument. It calls
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.
30
- Pass `fetch` as the second argument and the full endpoint URL as the third.
31
- By default, the saved-scan deduplication APIs use environment credentials. A
32
- custom SDK `embedding` binding can supply an adapter with its own credentials,
33
- including an `OpenAiFindingEmbedder` with a renewable key callback.
34
-
35
- Custom publication, explicit remote deduplication, Cloud publication, the
36
- plugin MCP server, and Codex app-server are unchanged.
37
-
38
- ## Direct storage helpers
39
-
40
- Direct callers of the retired Python findings helpers can use the retained Node
41
- helpers from an installed plugin directory:
42
-
43
- ```bash
44
- scripts/launch_codex_security_mcp --helper list-stored-findings < request.json
45
- ```
46
-
47
- On Windows, use `scripts\launch_codex_security_mcp.cmd` with the same arguments
48
- and JSON on stdin. For example, `request.json` selects the existing database:
49
-
50
- ```json
51
- {
52
- "stateDirectory": "/absolute/path/to/state",
53
- "payload": { "limit": 50, "offset": 0 }
54
- }
55
- ```
56
-
57
- Use an absolute Windows path on Windows. The retained helper commands accept
58
- these `payload` fields:
59
-
60
- | Command | Payload |
61
- | --------------------------- | ------------------------------------------------------------------------------------------------------- |
62
- | `store-findings` | `entries` containing finding and embedding records; optional `repositoryId`. |
63
- | `list-stored-findings` | Positive integer `limit` and non-negative integer `offset`. |
64
- | `find-potential-duplicates` | `findingId` and `scope`: either `{ "repositoryId": "REPOSITORY_ID" }` or `{ "allRepositories": true }`. |
65
- | `store-dedupe-groups` | `groups`, an array of finding-ID arrays. |
66
- | `list-dedupe-groups` | `findingId`. |
67
-
68
- Retained scan commands such as `workbench_db.py list-findings` keep their existing
69
- interface. The dashboard projection is removed along with the browser dashboard.
70
-
71
- ## Publish a scan
72
-
73
- Send a completed scan to an independently operated compatible endpoint:
74
-
75
- ```bash
76
- codex-security publish scan --scan SCAN_ID --to custom \
77
- --findings-url https://findings.example.com --json
78
- ```
79
-
80
- `--findings-url` is required. The client appends `/v1/bulk/findings` to this
81
- base URL, preserving any base path. Custom endpoints must implement that API
82
- and return the stored finding IDs.
83
-
84
- Publication sends the complete sealed findings and the manifest's
85
- `scan.target.targetId` as `repositoryId`. It leaves the scan artifacts unchanged
86
- and does not forward model credentials. The endpoint is responsible for storing the batch before acknowledging it.
87
-
88
- Use `--scan` for a saved scan, `--scan-dir` for an external scan directory, or
89
- the interactive picker. Custom publication accepts one scan; CSV input and
90
- Linear options do not apply. Add `--dry-run` to preview the payload without an
91
- HTTP request. Upload failures and incomplete receipts fail the command. Uploads
92
- are not automatically retried because a lost response may have been committed.
93
-
94
- ```typescript
95
- import { publishScanToCustom } from "@openai/codex-security";
96
-
97
- const receipt = await publishScanToCustom("/path/to/completed-scan", {
98
- findingsUrl: "https://findings.example.com",
99
- // dryRun: true,
100
- // signal: controller.signal,
101
- });
102
- console.log(receipt.repositoryId, receipt.findingIds);
103
- ```
104
-
105
- ## Compatible endpoint contract
106
-
107
- The retained HTTP clients use these endpoints on the supplied base URL,
108
- preserving its base path:
109
-
110
- | Method | Path | Response |
111
- | ------ | --------------------------------------- | ------------------------------------------------------------------------ |
112
- | `POST` | `/v1/bulk/findings` | An array acknowledging all submitted finding IDs; order does not matter. |
113
- | `GET` | `/v1/finding/{id}/potential-duplicates` | `{finding, potentialDuplicates}` containing complete finding records. |
114
- | `POST` | `/v1/dedupe-groups` | A successful JSON acknowledgement, such as `{}`. |
115
-
116
- Publication sends `{findings, repositoryId}`. Candidate requests include either
117
- `repositoryId` or `allRepositories=true`. Group writes send
118
- `{groups: [[findingId, ...], ...]}`; repeated membership must be idempotent for
119
- workflow retries. Both POST endpoints must persist their writes before
120
- acknowledging them and return a JSON body. An explicit URL selects this remote
121
- contract instead of local SQLite. This package no longer implements or hosts the HTTP endpoints.
122
-
123
- SDK findings client failures preserve the endpoint's error code and message with
124
- the HTTP status. Other responses retain the HTTP-status diagnostic. Retry
125
- behavior uses the HTTP status and `Retry-After`.
8
+ For an older service deployment or helper integration, see [compatibility](#compatibility).
126
9
 
127
10
  ## Deduplicate a scan
128
11
 
@@ -405,3 +288,121 @@ including `text-embedding-3-large`, 1,536-dimensional float vectors, and token
405
288
  array inputs. Requests encode the complete finding JSON with `cl100k_base` and
406
289
  send the API key as a bearer token. Long inputs are combined without truncation.
407
290
  Cached compatible vectors avoid new requests.
291
+
292
+ ## Publish a scan
293
+
294
+ Send a completed scan to an independently operated compatible endpoint:
295
+
296
+ ```bash
297
+ codex-security publish scan --scan SCAN_ID --to custom \
298
+ --findings-url https://findings.example.com --json
299
+ ```
300
+
301
+ `--findings-url` is required. The client appends `/v1/bulk/findings` to this
302
+ base URL, preserving any base path. Custom endpoints must implement that API
303
+ and return the stored finding IDs.
304
+
305
+ Publication sends the complete sealed findings and the manifest's
306
+ `scan.target.targetId` as `repositoryId`. It leaves the scan artifacts unchanged
307
+ and does not forward model credentials. The endpoint is responsible for storing the batch before acknowledging it.
308
+
309
+ Use `--scan` for a saved scan, `--scan-dir` for an external scan directory, or
310
+ the interactive picker. Custom publication accepts one scan; CSV input and
311
+ Linear options do not apply. Add `--dry-run` to preview the payload without an
312
+ HTTP request. Upload failures and incomplete receipts fail the command. Uploads
313
+ are not automatically retried because a lost response may have been committed.
314
+
315
+ ```typescript
316
+ import { publishScanToCustom } from "@openai/codex-security";
317
+
318
+ const receipt = await publishScanToCustom("/path/to/completed-scan", {
319
+ findingsUrl: "https://findings.example.com",
320
+ // dryRun: true,
321
+ // signal: controller.signal,
322
+ });
323
+ console.log(receipt.repositoryId, receipt.findingIds);
324
+ ```
325
+
326
+ ## Compatible endpoint contract
327
+
328
+ The retained HTTP clients use these endpoints on the supplied base URL,
329
+ preserving its base path:
330
+
331
+ | Method | Path | Response |
332
+ | ------ | --------------------------------------- | ------------------------------------------------------------------------ |
333
+ | `POST` | `/v1/bulk/findings` | An array acknowledging all submitted finding IDs; order does not matter. |
334
+ | `GET` | `/v1/finding/{id}/potential-duplicates` | `{finding, potentialDuplicates}` containing complete finding records. |
335
+ | `POST` | `/v1/dedupe-groups` | A successful JSON acknowledgement, such as `{}`. |
336
+
337
+ Publication sends `{findings, repositoryId}`. Candidate requests include either
338
+ `repositoryId` or `allRepositories=true`. Group writes send
339
+ `{groups: [[findingId, ...], ...]}`; repeated membership must be idempotent for
340
+ workflow retries. Both POST endpoints must persist their writes before
341
+ acknowledging them and return a JSON body. An explicit URL selects this remote
342
+ contract instead of local SQLite. This package no longer implements or hosts the HTTP endpoints.
343
+
344
+ SDK findings client failures preserve the endpoint's error code and message with
345
+ the HTTP status. Other responses retain the HTTP-status diagnostic. Retry
346
+ behavior uses the HTTP status and `Retry-After`.
347
+
348
+ ## Compatibility
349
+
350
+ ### Local service removal
351
+
352
+ The `serve` command (including `--port`), `start:server` script,
353
+ `dist/server/index.js` entrypoint, `startFindingsServer` SDK export, browser
354
+ dashboard, and findings-service Compose deployment have been removed.
355
+ `HOST`, `PORT`, and `CODEX_SECURITY_FINDINGS_IMAGE` no longer configure a bundled
356
+ service. The dashboard storage projection is also removed.
357
+
358
+ Existing SQLite databases, migrations, saved scans, findings, and duplicate
359
+ groups are retained. No data migration or deletion is performed. Keep any
360
+ existing service volume or state directory and back it up before changing
361
+ deployments; local deduplication uses the database selected by
362
+ `CODEX_SECURITY_STATE_DIR`, not a separate service volume automatically.
363
+
364
+ `@openai/codex-security/server` continues to export `OpenAiFindingEmbedder`,
365
+ `SqliteFindingsStore`, and their storage types for direct storage users.
366
+
367
+ For direct embedding/storage integrations, `OpenAiFindingEmbedder` accepts a
368
+ static key or `() => string | Promise<string>` as its first argument. It calls
369
+ the callback before each HTTP batch; the caller handles token acquisition.
370
+ Cancellation prevents a new callback or HTTP request. Direct embedder callers
371
+ still await a key callback that has already started.
372
+ Pass `fetch` as the second argument and the full endpoint URL as the third.
373
+ By default, the saved-scan deduplication APIs use environment credentials. A
374
+ custom SDK `embedding` binding can supply an adapter with its own credentials,
375
+ including an `OpenAiFindingEmbedder` with a renewable key callback.
376
+
377
+ ### Direct storage helpers
378
+
379
+ Direct callers of the retired Python findings helpers can use the retained Node
380
+ helpers from an installed plugin directory:
381
+
382
+ ```bash
383
+ scripts/launch_codex_security_mcp --helper list-stored-findings < request.json
384
+ ```
385
+
386
+ On Windows, use `scripts\launch_codex_security_mcp.cmd` with the same arguments
387
+ and JSON on stdin. For example, `request.json` selects the existing database:
388
+
389
+ ```json
390
+ {
391
+ "stateDirectory": "/absolute/path/to/state",
392
+ "payload": { "limit": 50, "offset": 0 }
393
+ }
394
+ ```
395
+
396
+ Use an absolute Windows path on Windows. The retained helper commands accept
397
+ these `payload` fields:
398
+
399
+ | Command | Payload |
400
+ | --------------------------- | ------------------------------------------------------------------------------------------------------- |
401
+ | `store-findings` | `entries` containing finding and embedding records; optional `repositoryId`. |
402
+ | `list-stored-findings` | Positive integer `limit` and non-negative integer `offset`. |
403
+ | `find-potential-duplicates` | `findingId` and `scope`: either `{ "repositoryId": "REPOSITORY_ID" }` or `{ "allRepositories": true }`. |
404
+ | `store-dedupe-groups` | `groups`, an array of finding-ID arrays. |
405
+ | `list-dedupe-groups` | `findingId`. |
406
+
407
+ Retained scan commands such as `workbench_db.py list-findings` keep their existing
408
+ interface.
@@ -47,6 +47,19 @@ a required check that cannot run without repository changes is a proof gap,
47
47
  not permission to edit. Generation's ordinary skill checks and standalone
48
48
  verification are separate operations.
49
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
+
50
63
  The executor receives one request with a unique `requestId`, operation,
51
64
  repository/revision, identity, finding ID, prompt, model, reasoning effort,
52
65
  `sandbox` (`workspace-write` for patch, `read-only` for verify), and
@@ -65,22 +78,22 @@ result validation finished; it does not imply that a patch fixed the finding:
65
78
  require a reason. The host must inspect the actual changes, collect the
66
79
  canonical diff, and run separate verification.
67
80
  - `verification` contains `id`, `status` (`fixed`, `still_vulnerable`, or
68
- `inconclusive`), nonempty `evidence`, and a nonempty `checks` array. Each check
69
- contains a nonempty `name`, `status` (`passed`, `failed`, or `not_run`),
70
- nonempty `evidence`, and optional `command`. Names and evidence distinguish
71
- static assessment from executed tests; `command` records an actual attempted
72
- command, not a suggestion. A required check that could not be completed is
73
- `not_run` with its blocker in `evidence`. An inconclusive result is preserved
74
- as an assessment outcome rather than converted to execution failure.
75
-
76
- Hosted verification requests these checks explicitly and rejects a result with
77
- missing or empty checks, or a `fixed` verdict with a failed or unrun check. The
78
- model must report the required vulnerability and legitimate-behavior checks;
79
- the SDK does not reconstruct checks from prose. A malformed result retains the
80
- execution receipt and returns `status: "failed"` with `INVALID_RESULT`, rather
81
- than claiming verification succeeded. Shared result types keep `checks`
82
- optional for older and local results; the local CLI command and result contract
83
- are unchanged.
81
+ `inconclusive`), and nonempty `evidence`, the same fields used by local
82
+ `verify-fix`. The finding ID must match the request. A `fixed` verdict needs
83
+ evidence that the original exploit path is closed and legitimate behavior
84
+ still works. If the selected mode cannot establish that, use `inconclusive`
85
+ unless the evidence shows the finding is still vulnerable.
86
+
87
+ Hosted and local verification use the same verdict parser and do not require
88
+ `checks`. At the hosted boundary, a `fixed` verdict is rejected if a nonempty
89
+ `checks` array matches the SDK 0.6.0 check format and reports a `failed` or
90
+ `not_run` required check. Other extra fields are ignored.
91
+
92
+ When upgrading from SDK 0.6.0, remove imports of `FindingVerificationCheck`
93
+ and read `verification.status` and `verification.evidence`. The SDK no longer
94
+ returns `verification.checks`. The executor's original report, when supplied,
95
+ remains in `execution.finalResponse`. Invalid or contradictory verdicts return
96
+ `INVALID_RESULT` with the execution receipt.
84
97
 
85
98
  The host owns durable attempts, cancellation/reconciliation, usage, artifact
86
99
  storage and publication. No operation publishes a pull request or marks a
@@ -88,16 +101,20 @@ finding closed. Retrying persistence must not resubmit execution.
88
101
 
89
102
  ## JSON-RPC launcher
90
103
 
91
- The SDK exports `runHostedRemediationProtocol`. An installed npm package can run it
92
- without adding any public CLI flag:
104
+ Use the public CLI to run the hosted protocol:
93
105
 
94
- ```sh
95
- node --input-type=module -e '
96
- import { runHostedRemediationProtocol } from "@openai/codex-security";
97
- process.exitCode = await runHostedRemediationProtocol(process.stdin, process.stdout);
98
- '
106
+ ```bash
107
+ codex-security patch --host
108
+ codex-security verify-fix --host
99
109
  ```
100
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
+
101
118
  Use the existing newline-delimited host transport: send one `run` request whose
102
119
  `params` are the input above; respond to `execution.run` with the executor
103
120
  receipt. `execution.progress` notifications use `{ requestId, event }` and are
@@ -107,7 +124,9 @@ the final execution receipt so usage and session identity survive cancellation.
107
124
  The transport emits one terminal result. Preparation failures are JSON-RPC
108
125
  errors; a mismatched HEAD includes `error.data.reason: "revision_mismatch"`.
109
126
 
110
- Run the deterministic installed-package smoke check without model credentials:
127
+ To run the deterministic installed-package smoke check, use a source checkout
128
+ of this repository and run the following from `sdk/typescript`. The script is
129
+ not included in the npm package and needs no model credentials:
111
130
 
112
131
  ```sh
113
132
  node scripts/smoke-hosted-remediation.mjs /path/to/node_modules/@openai/codex-security
@@ -74,6 +74,44 @@ Standard scan lifecycle. Omit `scope` for the entire repository, or pass literal
74
74
  repository-relative folders/files. Model settings come from the frozen input;
75
75
  local profiles and other local scan options are not accepted.
76
76
 
77
+ Set `ownerSuggestions: true` to record ownership evidence during the existing
78
+ scan execution. The scan agent may include an optional hint on each finding:
79
+
80
+ ```json
81
+ {
82
+ "extensions": {
83
+ "ownerSuggestion": {
84
+ "email": "alex@example.test",
85
+ "commit": "0123456789012345678901234567890123456789",
86
+ "reason": "Maintains the affected source."
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ Use an observed contributor email and a full supporting commit hash from Git
93
+ blame/history for the affected source. Omit the hint when ownership is unclear.
94
+ Hints use the scan's existing session and budget; there is no extra ownership
95
+ turn or model call. Security findings take priority over optional hints.
96
+
97
+ After sealing the scan, the SDK builds `owner-suggestions.json` without inference.
98
+ CODEOWNERS declarations take precedence. Other hints must match an observed Git
99
+ identity and supporting commit in the finding's evidence. Missing hints abstain;
100
+ invalid hints produce per-finding owner errors. Neither invalid hints nor report
101
+ failures invalidate sealed findings. A completed receipt includes the artifact
102
+ when available, or `ownerSuggestionsError` if finalization fails.
103
+
104
+ Hosts run the normal scan request and capture the optional owner report.
105
+ Automatic reporting uses `suggestOwnersFromScan`; it does not use the legacy
106
+ `ownerCodex` option or send `owner.infer` / `owner.cancel` requests.
107
+
108
+ The standalone `suggestOwners` API and `suggest-owners` command can call a
109
+ model under their own budget. Both paths use the same CODEOWNERS rules, Git
110
+ evidence, identity checks, and report format.
111
+
112
+ Report generation works after the scan reaches `maxCostUsd`. It uses the
113
+ hints already recorded and never starts another model call to fill gaps.
114
+
77
115
  `ScanExecutor.run` receives an AbortSignal and an optional `onEvent` observer for
78
116
  `{type: "progress", progress}` or `{type: "activity", activity}` events. Progress
79
117
  uses the existing `ScanProgress` type; activity uses `ScanActivity`. Progress may
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openai/codex-security",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "TypeScript SDK and CLI for Codex Security",
5
5
  "license": "Apache-2.0",
6
6
  "author": "OpenAI",
@@ -58,18 +58,18 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@inquirer/prompts": "8.7.3",
61
- "@linear/sdk": "97.1.0",
61
+ "@linear/sdk": "98.0.0",
62
62
  "@octokit/core": "7.0.8",
63
- "@openai/codex": "0.163.0",
64
- "@openai/codex-sdk": "0.163.0",
63
+ "@openai/codex": "0.164.0",
64
+ "@openai/codex-sdk": "0.164.0",
65
65
  "ajv": "8.20.0",
66
66
  "fflate": "0.8.3",
67
- "incur": "0.7.0",
67
+ "incur": "0.7.1",
68
68
  "ink": "8.0.0",
69
69
  "js-tiktoken": "1.0.21",
70
70
  "papaparse": "5.7.0",
71
71
  "pdfjs-dist": "6.4.299",
72
- "react": "19.3.0",
72
+ "react": "19.3.1",
73
73
  "saxes": "6.0.0",
74
74
  "semver": "7.8.5",
75
75
  "smol-toml": "1.9.1",
@@ -96,7 +96,7 @@
96
96
  "prettier": "3.9.10",
97
97
  "typescript": "7.0.2"
98
98
  },
99
- "gitHead": "b2fa51576d81cda5e311e7eb89131ffb13daad8b",
99
+ "gitHead": "f05a0b096cc881242ddf34a4d6b3ce0f322f3cf9",
100
100
  "scripts": {
101
101
  "audit:prod": "pnpm audit --prod --audit-level high",
102
102
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
@@ -107,15 +107,17 @@
107
107
  "build:plugin": "node scripts/build-plugin.mjs",
108
108
  "check:plugin-source": "node scripts/check-plugin-source.mjs",
109
109
  "check:package": "node scripts/check-package.mjs",
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
+ "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,standard-time-budget,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",
111
111
  "generate:models": "node scripts/generate-models.cjs",
112
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",
113
115
  "lint": "tsc --noEmit",
114
116
  "test": "node --run build:plugin && bun test --timeout 30000 ./tests-ts",
115
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",
116
118
  "test:mcp": "node --run build:plugin && pnpm --dir ../../plugins/codex-security/mcp-app run test:mcp",
117
119
  "test:mutation": "stryker run",
118
120
  "test:package": "node scripts/smoke-package.mjs",
119
- "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"
120
122
  }
121
123
  }