@openai/codex-security 0.3.0 → 0.4.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 (118) hide show
  1. package/_bundled_plugin/.codex-plugin/plugin.json +5 -5
  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 +13 -20
  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/references/final-report.md +1 -1
  9. package/_bundled_plugin/schemas/coverage.schema.json +45 -126
  10. package/_bundled_plugin/schemas/findings.schema.json +140 -427
  11. package/_bundled_plugin/schemas/patch-risk-assessment.schema.json +106 -119
  12. package/_bundled_plugin/schemas/scan-manifest.schema.json +73 -188
  13. package/_bundled_plugin/scripts/finalize_scan_contract.py +7 -6
  14. package/_bundled_plugin/scripts/generate_rank_input.py +25 -106
  15. package/_bundled_plugin/scripts/report_projection.py +35 -13
  16. package/_bundled_plugin/scripts/workbench_cli.py +9 -6
  17. package/_bundled_plugin/scripts/workbench_db.py +51 -16
  18. package/_bundled_plugin/scripts/workbench_publication.py +216 -247
  19. package/_bundled_plugin/scripts/workbench_scan_usage.py +173 -10
  20. package/_bundled_plugin/scripts/workbench_validation.py +15 -1
  21. package/_bundled_plugin/shared/workbench-migrations.json +17 -0
  22. package/_bundled_plugin/skills/deep-security-scan/SKILL.md +1 -1
  23. package/_bundled_plugin/skills/deep-security-scan/agents/openai.yaml +1 -1
  24. package/_bundled_plugin/skills/security-diff-scan/agents/openai.yaml +1 -1
  25. package/_bundled_plugin/skills/security-scan/SKILL.md +1 -1
  26. package/_bundled_plugin/skills/security-scan/agents/openai.yaml +1 -1
  27. package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +1 -1
  28. package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +2 -0
  29. package/_bundled_plugin/skills/track-findings/SKILL.md +8 -4
  30. package/_bundled_plugin/skills/track-findings/agents/openai.yaml +1 -1
  31. package/_bundled_plugin/skills/track-findings/references/github-security-advisories.md +1 -1
  32. package/dist/api.d.ts +3 -0
  33. package/dist/api.d.ts.map +1 -1
  34. package/dist/api.js +212 -3
  35. package/dist/api.js.map +1 -1
  36. package/dist/cli.d.ts.map +1 -1
  37. package/dist/cli.js +15 -5
  38. package/dist/cli.js.map +1 -1
  39. package/dist/component-plan.js +1 -1
  40. package/dist/component-plan.js.map +1 -1
  41. package/dist/component-scan.d.ts.map +1 -1
  42. package/dist/component-scan.js +5 -4
  43. package/dist/component-scan.js.map +1 -1
  44. package/dist/contract.d.ts +1 -0
  45. package/dist/contract.d.ts.map +1 -1
  46. package/dist/contract.js +4 -3
  47. package/dist/contract.js.map +1 -1
  48. package/dist/custom-validation-prompt.js +1 -1
  49. package/dist/custom-validation-prompt.js.map +1 -1
  50. package/dist/deduplication/codex-review.d.ts +1 -5
  51. package/dist/deduplication/codex-review.d.ts.map +1 -1
  52. package/dist/deduplication/codex-review.js +2 -2
  53. package/dist/deduplication/codex-review.js.map +1 -1
  54. package/dist/deduplication/deduplication-reviewer.d.ts +1 -1
  55. package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
  56. package/dist/deduplication/deduplication-reviewer.js +1 -1
  57. package/dist/deduplication/deduplication-reviewer.js.map +1 -1
  58. package/dist/deduplication/records-protocol.d.ts +3 -8
  59. package/dist/deduplication/records-protocol.d.ts.map +1 -1
  60. package/dist/deduplication/records-protocol.js +11 -171
  61. package/dist/deduplication/records-protocol.js.map +1 -1
  62. package/dist/deep-progress.d.ts +15 -1
  63. package/dist/deep-progress.d.ts.map +1 -1
  64. package/dist/deep-progress.js +15 -16
  65. package/dist/deep-progress.js.map +1 -1
  66. package/dist/executable-path.d.ts +2 -0
  67. package/dist/executable-path.d.ts.map +1 -0
  68. package/dist/executable-path.js +12 -0
  69. package/dist/executable-path.js.map +1 -0
  70. package/dist/feedback.d.ts +1 -4
  71. package/dist/feedback.d.ts.map +1 -1
  72. package/dist/feedback.js +1 -1
  73. package/dist/feedback.js.map +1 -1
  74. package/dist/host-protocol.d.ts +19 -0
  75. package/dist/host-protocol.d.ts.map +1 -0
  76. package/dist/host-protocol.js +270 -0
  77. package/dist/host-protocol.js.map +1 -0
  78. package/dist/hosted-scan-protocol.d.ts +4 -0
  79. package/dist/hosted-scan-protocol.d.ts.map +1 -0
  80. package/dist/hosted-scan-protocol.js +25 -0
  81. package/dist/hosted-scan-protocol.js.map +1 -0
  82. package/dist/hosted-scan.d.ts +117 -0
  83. package/dist/hosted-scan.d.ts.map +1 -0
  84. package/dist/hosted-scan.js +260 -0
  85. package/dist/hosted-scan.js.map +1 -0
  86. package/dist/index.d.ts +3 -0
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +1 -0
  89. package/dist/index.js.map +1 -1
  90. package/dist/multiscan.d.ts.map +1 -1
  91. package/dist/multiscan.js +47 -9
  92. package/dist/multiscan.js.map +1 -1
  93. package/dist/publication-store.d.ts.map +1 -1
  94. package/dist/publication-store.js +73 -63
  95. package/dist/publication-store.js.map +1 -1
  96. package/dist/publication.d.ts +0 -2
  97. package/dist/publication.d.ts.map +1 -1
  98. package/dist/publication.js +0 -5
  99. package/dist/publication.js.map +1 -1
  100. package/dist/runtime.d.ts +5 -2
  101. package/dist/runtime.d.ts.map +1 -1
  102. package/dist/runtime.js +5 -38
  103. package/dist/runtime.js.map +1 -1
  104. package/dist/scan-executor.d.ts +104 -0
  105. package/dist/scan-executor.d.ts.map +1 -0
  106. package/dist/scan-executor.js +62 -0
  107. package/dist/scan-executor.js.map +1 -0
  108. package/dist/targets.d.ts.map +1 -1
  109. package/dist/targets.js +17 -25
  110. package/dist/targets.js.map +1 -1
  111. package/dist/worker-progress.d.ts +43 -11
  112. package/dist/worker-progress.d.ts.map +1 -1
  113. package/dist/worker-progress.js +21 -37
  114. package/dist/worker-progress.js.map +1 -1
  115. package/docs/cli.md +12 -2
  116. package/docs/hosted-scans.md +242 -0
  117. package/package.json +9 -7
  118. package/schemas/hosted-scan-v2.fixture.json +145 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "codex-security",
3
3
  "version": "0.1.95",
4
- "description": "Codex Security Local workflows for security scans, analysis, and investigation.",
4
+ "description": "Codex Security workflows for security scans, analysis, and investigation.",
5
5
  "author": {
6
6
  "name": "OpenAI"
7
7
  },
@@ -23,9 +23,9 @@
23
23
  "workerProviderSnapshot": 4
24
24
  },
25
25
  "interface": {
26
- "displayName": "Codex Security Local",
26
+ "displayName": "Codex Security",
27
27
  "shortDescription": "Security scanning for your codebase",
28
- "longDescription": "Codex Security Local packages reusable workflows for security scans, analysis, validation, and investigation across code, diffs, and related artifacts.",
28
+ "longDescription": "Codex Security packages reusable workflows for security scans, analysis, validation, and investigation across code, diffs, and related artifacts.",
29
29
  "developerName": "OpenAI",
30
30
  "category": "Security",
31
31
  "capabilities": ["Interactive", "Read", "Write"],
@@ -33,8 +33,8 @@
33
33
  "privacyPolicyURL": "https://openai.com/policies/row-privacy-policy/",
34
34
  "termsOfServiceURL": "https://openai.com/policies/row-terms-of-use/",
35
35
  "defaultPrompt": [
36
- "Run a Codex Security Local scan on this repository.",
37
- "Run a Codex Security Local diff scan on this PR, commit, branch diff, or working-tree patch.",
36
+ "Run a Codex Security scan on this repository.",
37
+ "Run a Codex Security diff scan on this PR, commit, branch diff, or working-tree patch.",
38
38
  "Triage existing security findings against this repository."
39
39
  ],
40
40
  "brandColor": "#111111",
@@ -23,7 +23,7 @@ var DeepScanNonRetryableError = class extends Error {
23
23
  }
24
24
  };
25
25
 
26
- // src/deep-scan/executable-path.ts
26
+ // src/executable-path.ts
27
27
  import { win32 } from "node:path";
28
28
  function executablePathForSpawn(command) {
29
29
  if (process.platform !== "win32" || !win32.isAbsolute(command))
@@ -183,16 +183,8 @@ var AppServerPreflightClient = class {
183
183
  crlfDelay: Infinity
184
184
  });
185
185
  this.stdoutLines.on("line", (line) => this.consumeStdoutLine(line));
186
- const onStdioError = (error) => {
187
- const failure = codexExecutableStdioError(
188
- options.codexPath,
189
- options.context
190
- );
191
- failure.message += "\n" + error.message;
192
- this.fail(failure);
193
- };
194
- this.stdoutLines.on("error", onStdioError);
195
- this.child.stdin.on("error", onStdioError);
186
+ this.stdoutLines.on("error", this.onStdioError);
187
+ this.child.stdin.on("error", this.onStdioError);
196
188
  this.child.on("error", (error) => {
197
189
  this.fail(
198
190
  codexExecutableStartError(options.codexPath, error, options.context)
@@ -228,6 +220,14 @@ var AppServerPreflightClient = class {
228
220
  closed = false;
229
221
  childClosed = false;
230
222
  removeAbortListener;
223
+ onStdioError = (error) => {
224
+ const failure = codexExecutableStdioError(
225
+ this.options.codexPath,
226
+ this.options.context
227
+ );
228
+ failure.message += "\n" + error.message;
229
+ this.fail(failure);
230
+ };
231
231
  get stderrText() {
232
232
  return Buffer.concat(this.stderr).toString("utf8");
233
233
  }
@@ -235,7 +235,7 @@ var AppServerPreflightClient = class {
235
235
  await this.request("initialize", {
236
236
  clientInfo: {
237
237
  name: "codex_security_deep_scan",
238
- title: "Codex Security Local Deep Scan",
238
+ title: "Codex Security Deep Scan",
239
239
  version
240
240
  },
241
241
  capabilities: { experimentalApi: true }
@@ -327,14 +327,7 @@ var AppServerPreflightClient = class {
327
327
  }
328
328
  this.child.stdin.write(`${JSON.stringify(message)}
329
329
  `, (error) => {
330
- if (error) {
331
- const failure = codexExecutableStdioError(
332
- this.options.codexPath,
333
- this.options.context
334
- );
335
- failure.message += "\n" + error.message;
336
- this.fail(failure);
337
- }
330
+ if (error) this.onStdioError(error);
338
331
  });
339
332
  }
340
333
  consumeStdoutLine(line) {
@@ -30,7 +30,7 @@ During a host-backed scan, checkpoint saved findings and pending candidates with
30
30
 
31
31
  On a confirmed failure or explicit cancellation, the workbench preserves saved results without marking the scan successful. Report validated findings separately from pending candidates and describe scope limitations and remaining work. Use the retained report and exports; do not start additional model work after cancellation or replace saved results with a no-findings response.
32
32
 
33
- After `complete_codex_security_scan` succeeds, include its returned `usage.totalTokens`, `usage.inputTokens`, and `usage.cachedInputTokens` in the final response when `usage.coverage` is `complete` or `partial`; explicitly label a partial measurement. If coverage is `unavailable`, say that token usage could not be measured instead of reporting zero or estimating a cost. Report only measured completion metadata in a terminal/chat host. Token usage is workbench metadata, not a reason to modify sealed scan artifacts or the deterministic report.
33
+ After `complete_codex_security_scan` succeeds, include its returned `usage.totalTokens`, `usage.inputTokens`, and `usage.cachedInputTokens` only when `usage.coverage` is `complete`. When `usage.completion.finalized` is `false`, leave the token total to the host: it finalizes usage after this turn ends, including the final response. Do not quote the preliminary count as a final total or an "at least" estimate. For other partial or unavailable measurements, say that the full token count is unavailable rather than reporting zero or estimating a cost. Token usage is workbench metadata, not a reason to modify sealed scan artifacts or the deterministic report.
34
34
 
35
35
  Before workbench-owned Standard or workbench-backed diff completion, require `record_codex_security_scan_draft` to succeed. Before Deep completion, require the coordinator to return the parent scan's already-authored canonical manifest; do not submit another draft or rerun worker phases. Explicitly SDK-owned workflows verify their canonical JSON before the SDK finalizes it. Completion validates and seals existing canonical artifacts and generates `report.md`; it does not create missing artifacts or run skipped scan phases.
36
36
 
@@ -1,31 +1,12 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
2
  "$id": "https://openai.com/codex-security/schemas/coverage.schema.json",
4
3
  "title": "Codex Security scan coverage",
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
5
  "type": "object",
6
- "required": [
7
- "documentType",
8
- "schemaVersion",
9
- "scanId",
10
- "mode",
11
- "inventoryStrategy",
12
- "includePaths",
13
- "excludePaths",
14
- "surfaces",
15
- "explicitExclusions",
16
- "deferred"
17
- ],
18
6
  "properties": {
19
- "documentType": {
20
- "const": "codex-security.coverage"
21
- },
22
- "schemaVersion": {
23
- "const": "1.0"
24
- },
25
- "scanId": {
26
- "type": "string",
27
- "minLength": 1
28
- },
7
+ "documentType": { "const": "codex-security.coverage" },
8
+ "schemaVersion": { "const": "1.0" },
9
+ "scanId": { "type": "string", "minLength": 1 },
29
10
  "mode": {
30
11
  "enum": [
31
12
  "repository",
@@ -38,45 +19,17 @@
38
19
  ]
39
20
  },
40
21
  "inventoryStrategy": {
41
- "enum": [
42
- "repository",
43
- "scoped_path",
44
- "diff",
45
- "directory",
46
- "custom"
47
- ]
48
- },
49
- "includePaths": {
50
- "type": "array",
51
- "items": {
52
- "type": "string"
53
- }
54
- },
55
- "excludePaths": {
56
- "type": "array",
57
- "items": {
58
- "type": "string"
59
- }
22
+ "enum": ["repository", "scoped_path", "diff", "directory", "custom"]
60
23
  },
24
+ "includePaths": { "type": "array", "items": { "type": "string" } },
25
+ "excludePaths": { "type": "array", "items": { "type": "string" } },
61
26
  "surfaces": {
62
27
  "type": "array",
63
28
  "items": {
64
29
  "type": "object",
65
- "required": [
66
- "id",
67
- "label",
68
- "disposition",
69
- "receiptRefs"
70
- ],
71
30
  "properties": {
72
- "id": {
73
- "type": "string",
74
- "minLength": 1
75
- },
76
- "label": {
77
- "type": "string",
78
- "minLength": 1
79
- },
31
+ "id": { "type": "string", "minLength": 1 },
32
+ "label": { "type": "string", "minLength": 1 },
80
33
  "disposition": {
81
34
  "enum": [
82
35
  "reported",
@@ -94,111 +47,77 @@
94
47
  "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)artifacts/.+$"
95
48
  }
96
49
  },
97
- "riskArea": {
98
- "type": "string",
99
- "minLength": 1
100
- },
101
- "notes": {
102
- "type": "string",
103
- "minLength": 1
104
- }
105
- }
50
+ "riskArea": { "type": "string", "minLength": 1 },
51
+ "notes": { "type": "string", "minLength": 1 }
52
+ },
53
+ "required": ["id", "label", "disposition", "receiptRefs"]
106
54
  }
107
55
  },
108
56
  "explicitExclusions": {
109
57
  "type": "array",
110
58
  "items": {
111
59
  "type": "object",
112
- "required": [
113
- "pattern",
114
- "reason"
115
- ],
116
60
  "properties": {
117
- "pattern": {
118
- "type": "string",
119
- "minLength": 1
120
- },
121
- "reason": {
122
- "type": "string",
123
- "minLength": 1
124
- }
125
- }
61
+ "pattern": { "type": "string", "minLength": 1 },
62
+ "reason": { "type": "string", "minLength": 1 }
63
+ },
64
+ "required": ["pattern", "reason"]
126
65
  }
127
66
  },
128
67
  "deferred": {
129
68
  "type": "array",
130
69
  "items": {
131
70
  "type": "object",
132
- "required": [
133
- "id",
134
- "reason"
135
- ],
136
71
  "properties": {
137
- "id": {
138
- "type": "string",
139
- "minLength": 1
140
- },
141
- "reason": {
142
- "type": "string",
143
- "minLength": 1
144
- },
72
+ "id": { "type": "string", "minLength": 1 },
73
+ "reason": { "type": "string", "minLength": 1 },
145
74
  "paths": {
146
75
  "type": "array",
147
- "items": {
148
- "type": "string",
149
- "minLength": 1
150
- }
76
+ "items": { "type": "string", "minLength": 1 }
151
77
  },
152
78
  "surfaceIds": {
153
79
  "type": "array",
154
- "items": {
155
- "type": "string",
156
- "minLength": 1
157
- }
80
+ "items": { "type": "string", "minLength": 1 }
158
81
  }
159
- }
82
+ },
83
+ "required": ["id", "reason"]
160
84
  }
161
85
  },
162
86
  "resolvedDeferred": {
163
- "description": "Completed generic review tasks, with their saved IDs and completion reasons.",
164
87
  "type": "array",
165
88
  "items": {
166
89
  "type": "object",
167
90
  "properties": {
168
- "id": {
169
- "type": "string",
170
- "minLength": 1
171
- },
172
- "reason": {
173
- "type": "string",
174
- "minLength": 1
175
- }
91
+ "id": { "type": "string", "minLength": 1 },
92
+ "reason": { "type": "string", "minLength": 1 }
176
93
  },
177
- "required": [
178
- "id",
179
- "reason"
180
- ],
94
+ "required": ["id", "reason"],
181
95
  "additionalProperties": false
182
- }
96
+ },
97
+ "description": "Completed generic review tasks, with their saved IDs and completion reasons."
183
98
  },
184
99
  "openQuestions": {
185
100
  "type": "array",
186
101
  "items": {
187
102
  "type": "object",
188
- "required": [
189
- "question"
190
- ],
191
103
  "properties": {
192
- "question": {
193
- "type": "string",
194
- "minLength": 1
195
- },
196
- "followUpPrompt": {
197
- "type": "string",
198
- "minLength": 1
199
- }
200
- }
104
+ "question": { "type": "string", "minLength": 1 },
105
+ "followUpPrompt": { "type": "string", "minLength": 1 }
106
+ },
107
+ "required": ["question"]
201
108
  }
202
109
  }
203
- }
110
+ },
111
+ "required": [
112
+ "documentType",
113
+ "schemaVersion",
114
+ "scanId",
115
+ "mode",
116
+ "inventoryStrategy",
117
+ "includePaths",
118
+ "excludePaths",
119
+ "surfaces",
120
+ "explicitExclusions",
121
+ "deferred"
122
+ ]
204
123
  }