@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.
- package/_bundled_plugin/.codex-plugin/plugin.json +5 -5
- package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
- package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
- package/_bundled_plugin/mcp/permission-profile-preflight.mjs +13 -20
- package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
- package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
- package/_bundled_plugin/references/final-report.md +1 -1
- package/_bundled_plugin/schemas/coverage.schema.json +45 -126
- package/_bundled_plugin/schemas/findings.schema.json +140 -427
- package/_bundled_plugin/schemas/patch-risk-assessment.schema.json +106 -119
- package/_bundled_plugin/schemas/scan-manifest.schema.json +73 -188
- package/_bundled_plugin/scripts/finalize_scan_contract.py +7 -6
- package/_bundled_plugin/scripts/generate_rank_input.py +25 -106
- package/_bundled_plugin/scripts/report_projection.py +35 -13
- package/_bundled_plugin/scripts/workbench_cli.py +9 -6
- package/_bundled_plugin/scripts/workbench_db.py +51 -16
- package/_bundled_plugin/scripts/workbench_publication.py +216 -247
- package/_bundled_plugin/scripts/workbench_scan_usage.py +173 -10
- package/_bundled_plugin/scripts/workbench_validation.py +15 -1
- package/_bundled_plugin/shared/workbench-migrations.json +17 -0
- package/_bundled_plugin/skills/deep-security-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/deep-security-scan/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/security-diff-scan/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/security-scan/SKILL.md +1 -1
- package/_bundled_plugin/skills/security-scan/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/security-scan/references/desktop-scan.md +1 -1
- package/_bundled_plugin/skills/security-scan/references/scan-artifacts-and-ledger.md +2 -0
- package/_bundled_plugin/skills/track-findings/SKILL.md +8 -4
- package/_bundled_plugin/skills/track-findings/agents/openai.yaml +1 -1
- package/_bundled_plugin/skills/track-findings/references/github-security-advisories.md +1 -1
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +212 -3
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +15 -5
- package/dist/cli.js.map +1 -1
- package/dist/component-plan.js +1 -1
- package/dist/component-plan.js.map +1 -1
- package/dist/component-scan.d.ts.map +1 -1
- package/dist/component-scan.js +5 -4
- package/dist/component-scan.js.map +1 -1
- package/dist/contract.d.ts +1 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +4 -3
- package/dist/contract.js.map +1 -1
- package/dist/custom-validation-prompt.js +1 -1
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/deduplication/codex-review.d.ts +1 -5
- package/dist/deduplication/codex-review.d.ts.map +1 -1
- package/dist/deduplication/codex-review.js +2 -2
- package/dist/deduplication/codex-review.js.map +1 -1
- package/dist/deduplication/deduplication-reviewer.d.ts +1 -1
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
- package/dist/deduplication/deduplication-reviewer.js +1 -1
- package/dist/deduplication/deduplication-reviewer.js.map +1 -1
- package/dist/deduplication/records-protocol.d.ts +3 -8
- package/dist/deduplication/records-protocol.d.ts.map +1 -1
- package/dist/deduplication/records-protocol.js +11 -171
- package/dist/deduplication/records-protocol.js.map +1 -1
- package/dist/deep-progress.d.ts +15 -1
- package/dist/deep-progress.d.ts.map +1 -1
- package/dist/deep-progress.js +15 -16
- package/dist/deep-progress.js.map +1 -1
- package/dist/executable-path.d.ts +2 -0
- package/dist/executable-path.d.ts.map +1 -0
- package/dist/executable-path.js +12 -0
- package/dist/executable-path.js.map +1 -0
- package/dist/feedback.d.ts +1 -4
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +1 -1
- package/dist/feedback.js.map +1 -1
- package/dist/host-protocol.d.ts +19 -0
- package/dist/host-protocol.d.ts.map +1 -0
- package/dist/host-protocol.js +270 -0
- package/dist/host-protocol.js.map +1 -0
- package/dist/hosted-scan-protocol.d.ts +4 -0
- package/dist/hosted-scan-protocol.d.ts.map +1 -0
- package/dist/hosted-scan-protocol.js +25 -0
- package/dist/hosted-scan-protocol.js.map +1 -0
- package/dist/hosted-scan.d.ts +117 -0
- package/dist/hosted-scan.d.ts.map +1 -0
- package/dist/hosted-scan.js +260 -0
- package/dist/hosted-scan.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/multiscan.d.ts.map +1 -1
- package/dist/multiscan.js +47 -9
- package/dist/multiscan.js.map +1 -1
- package/dist/publication-store.d.ts.map +1 -1
- package/dist/publication-store.js +73 -63
- package/dist/publication-store.js.map +1 -1
- package/dist/publication.d.ts +0 -2
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +0 -5
- package/dist/publication.js.map +1 -1
- package/dist/runtime.d.ts +5 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +5 -38
- package/dist/runtime.js.map +1 -1
- package/dist/scan-executor.d.ts +104 -0
- package/dist/scan-executor.d.ts.map +1 -0
- package/dist/scan-executor.js +62 -0
- package/dist/scan-executor.js.map +1 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +17 -25
- package/dist/targets.js.map +1 -1
- package/dist/worker-progress.d.ts +43 -11
- package/dist/worker-progress.d.ts.map +1 -1
- package/dist/worker-progress.js +21 -37
- package/dist/worker-progress.js.map +1 -1
- package/docs/cli.md +12 -2
- package/docs/hosted-scans.md +242 -0
- package/package.json +9 -7
- package/schemas/hosted-scan-v2.fixture.json +145 -0
|
@@ -84,11 +84,13 @@ def collect_scan_usage(
|
|
|
84
84
|
*,
|
|
85
85
|
thread_id: str | None = None,
|
|
86
86
|
completed_at: str | None = None,
|
|
87
|
+
completed_turn_id: str | None = None,
|
|
87
88
|
) -> dict[str, Any]:
|
|
88
89
|
"""Count only complete, attributable rollout events inside this scan's window."""
|
|
89
90
|
|
|
90
91
|
roots = _scan_root_thread_ids(connection, scan, thread_id)
|
|
91
|
-
|
|
92
|
+
worker_directories = _scan_worker_directories(connection, scan)
|
|
93
|
+
if not roots and not worker_directories:
|
|
92
94
|
return _unavailable_usage("scan_thread_unavailable")
|
|
93
95
|
|
|
94
96
|
state_database = _codex_state_database()
|
|
@@ -106,6 +108,9 @@ def collect_scan_usage(
|
|
|
106
108
|
state_database,
|
|
107
109
|
roots,
|
|
108
110
|
warnings,
|
|
111
|
+
worker_directories=worker_directories,
|
|
112
|
+
started_at=started_at,
|
|
113
|
+
completed_at=stopped_at,
|
|
109
114
|
)
|
|
110
115
|
except (OSError, sqlite3.Error, ValueError):
|
|
111
116
|
return _unavailable_usage("codex_state_unavailable")
|
|
@@ -132,6 +137,7 @@ def collect_scan_usage(
|
|
|
132
137
|
session,
|
|
133
138
|
started_at=started_at,
|
|
134
139
|
completed_at=stopped_at,
|
|
140
|
+
completed_turn_id=completed_turn_id if session.thread_id == thread_id else None,
|
|
135
141
|
)
|
|
136
142
|
except (OSError, UnicodeError, ValueError):
|
|
137
143
|
missing_thread_ids.add(session.thread_id)
|
|
@@ -214,6 +220,21 @@ def _scan_execution_thread_ids(connection: sqlite3.Connection, scan: sqlite3.Row
|
|
|
214
220
|
)
|
|
215
221
|
|
|
216
222
|
|
|
223
|
+
def _scan_worker_directories(connection: sqlite3.Connection, scan: sqlite3.Row) -> set[str]:
|
|
224
|
+
if scan["mode"] != "deep":
|
|
225
|
+
return set()
|
|
226
|
+
return {
|
|
227
|
+
row["artifact_dir"]
|
|
228
|
+
if row["kind"] == "discovery"
|
|
229
|
+
else str(Path(scan["scan_dir"]) / "artifacts")
|
|
230
|
+
for row in connection.execute(
|
|
231
|
+
"SELECT kind, artifact_dir FROM deep_scan_workers "
|
|
232
|
+
"WHERE scan_id = ? AND kind IN ('discovery', 'dedup')",
|
|
233
|
+
(scan["id"],),
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
217
238
|
def _codex_state_database() -> Path | None:
|
|
218
239
|
configured_database = os.environ.get("CODEX_STATE_DB", "").strip()
|
|
219
240
|
if configured_database:
|
|
@@ -255,6 +276,10 @@ def _discover_rollout_sessions(
|
|
|
255
276
|
state_database: Path,
|
|
256
277
|
roots: list[str],
|
|
257
278
|
warnings: set[str],
|
|
279
|
+
*,
|
|
280
|
+
worker_directories: set[str],
|
|
281
|
+
started_at: datetime,
|
|
282
|
+
completed_at: datetime | None,
|
|
258
283
|
) -> tuple[list[RolloutSession], set[str]]:
|
|
259
284
|
database = sqlite3.connect(
|
|
260
285
|
f"file:{quote(str(state_database), safe='')}?mode=ro",
|
|
@@ -273,7 +298,27 @@ def _discover_rollout_sessions(
|
|
|
273
298
|
raise ValueError("Codex state graph does not expose the required thread columns.")
|
|
274
299
|
sessions: dict[str, RolloutSession] = {}
|
|
275
300
|
missing_thread_ids: set[str] = set()
|
|
276
|
-
|
|
301
|
+
root_ids = dict.fromkeys(roots)
|
|
302
|
+
started_millisecond = started_at.replace(microsecond=started_at.microsecond // 1000 * 1000)
|
|
303
|
+
completed_timestamp = int(completed_at.timestamp()) if completed_at is not None else None
|
|
304
|
+
directory_expression = "cwd"
|
|
305
|
+
if worker_directories and os.name == "nt":
|
|
306
|
+
from windows_scan_local_files import _normalized_windows_path
|
|
307
|
+
|
|
308
|
+
database.create_function(
|
|
309
|
+
"codex_security_path_key", 1, _normalized_windows_path, deterministic=True
|
|
310
|
+
)
|
|
311
|
+
directory_expression = "codex_security_path_key(cwd)"
|
|
312
|
+
worker_directories = {_normalized_windows_path(value) for value in worker_directories}
|
|
313
|
+
for directory in sorted(worker_directories):
|
|
314
|
+
for row in database.execute(
|
|
315
|
+
"SELECT id FROM threads WHERE cwd IS NOT NULL "
|
|
316
|
+
f"AND {directory_expression} = ? AND created_at >= ? "
|
|
317
|
+
"AND (? IS NULL OR created_at <= ?) ORDER BY id",
|
|
318
|
+
(directory, int(started_at.timestamp()), completed_timestamp, completed_timestamp),
|
|
319
|
+
):
|
|
320
|
+
root_ids[row["id"]] = None
|
|
321
|
+
for root in root_ids:
|
|
277
322
|
row = database.execute(
|
|
278
323
|
"SELECT id, rollout_path FROM threads WHERE id = ?",
|
|
279
324
|
(root,),
|
|
@@ -282,13 +327,29 @@ def _discover_rollout_sessions(
|
|
|
282
327
|
missing_thread_ids.add(root)
|
|
283
328
|
warnings.add("scan_root_unavailable")
|
|
284
329
|
continue
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
330
|
+
path = _rollout_path(row["rollout_path"])
|
|
331
|
+
if path is None:
|
|
332
|
+
missing_thread_ids.add(root)
|
|
333
|
+
warnings.add("rollout_unavailable")
|
|
334
|
+
continue
|
|
335
|
+
if root not in roots:
|
|
336
|
+
try:
|
|
337
|
+
with path.open("rb") as source:
|
|
338
|
+
metadata = json.loads(source.readline())
|
|
339
|
+
except (OSError, ValueError):
|
|
288
340
|
missing_thread_ids.add(root)
|
|
289
341
|
warnings.add("rollout_unavailable")
|
|
290
342
|
continue
|
|
291
|
-
|
|
343
|
+
if (
|
|
344
|
+
isinstance(metadata, dict)
|
|
345
|
+
and metadata.get("type") == "session_meta"
|
|
346
|
+
and isinstance(payload := metadata.get("payload"), dict)
|
|
347
|
+
and (payload.get("id") or payload.get("session_id")) == root
|
|
348
|
+
and (created_at := _timestamp(payload.get("timestamp"))) is not None
|
|
349
|
+
and created_at < started_millisecond
|
|
350
|
+
):
|
|
351
|
+
continue
|
|
352
|
+
sessions[root] = RolloutSession(root, None, path)
|
|
292
353
|
descendants = database.execute(
|
|
293
354
|
"""
|
|
294
355
|
WITH RECURSIVE descendants(
|
|
@@ -378,11 +439,18 @@ def _read_rollout_usage(
|
|
|
378
439
|
*,
|
|
379
440
|
started_at: datetime,
|
|
380
441
|
completed_at: datetime | None,
|
|
442
|
+
completed_turn_id: str | None = None,
|
|
381
443
|
) -> tuple[dict[str, int], set[str]]:
|
|
382
444
|
total = _empty_token_usage()
|
|
383
445
|
warnings: set[str] = set()
|
|
384
446
|
previous = _empty_token_usage()
|
|
385
447
|
boundary_reached = False
|
|
448
|
+
legacy_usage = _empty_token_usage()
|
|
449
|
+
response_usage: dict[str, int] | None = None
|
|
450
|
+
observed_response_usage = _empty_token_usage()
|
|
451
|
+
response_ids: set[str] = set()
|
|
452
|
+
current_turn_id: str | None = None
|
|
453
|
+
completed_turn_measured = False
|
|
386
454
|
|
|
387
455
|
with session.path.open("rb") as source:
|
|
388
456
|
for line_number, raw_line in enumerate(source, start=1):
|
|
@@ -431,16 +499,100 @@ def _read_rollout_usage(
|
|
|
431
499
|
warnings.add("thread_ownership_unavailable")
|
|
432
500
|
return total, warnings
|
|
433
501
|
if task_started_at < started_at or (
|
|
434
|
-
completed_at is not None
|
|
502
|
+
completed_at is not None
|
|
503
|
+
and task_started_at > completed_at
|
|
504
|
+
and payload.get("turn_id") != completed_turn_id
|
|
435
505
|
):
|
|
436
506
|
warnings.add("thread_outside_scan_window")
|
|
437
507
|
return total, warnings
|
|
438
508
|
boundary_reached = True
|
|
509
|
+
current_turn_id = payload.get("turn_id")
|
|
439
510
|
elif event.get("type") == "event_msg" and payload.get("type") == "token_count":
|
|
440
511
|
inherited_usage = _token_snapshot(payload)
|
|
441
512
|
if inherited_usage is not None:
|
|
442
513
|
previous = inherited_usage
|
|
443
514
|
continue
|
|
515
|
+
if event.get("type") == "event_msg" and payload.get("type") == "task_started":
|
|
516
|
+
if (
|
|
517
|
+
completed_turn_id is not None
|
|
518
|
+
and current_turn_id == completed_turn_id
|
|
519
|
+
and payload.get("turn_id") != completed_turn_id
|
|
520
|
+
):
|
|
521
|
+
break
|
|
522
|
+
_add_token_usage(
|
|
523
|
+
total, response_usage if response_usage is not None else legacy_usage
|
|
524
|
+
)
|
|
525
|
+
legacy_usage = _empty_token_usage()
|
|
526
|
+
response_usage = None
|
|
527
|
+
if payload.get("turn_id") != current_turn_id:
|
|
528
|
+
observed_response_usage = _empty_token_usage()
|
|
529
|
+
current_turn_id = payload.get("turn_id")
|
|
530
|
+
continue
|
|
531
|
+
if (
|
|
532
|
+
completed_turn_id is not None
|
|
533
|
+
and event.get("type") == "event_msg"
|
|
534
|
+
and payload.get("type") == "task_complete"
|
|
535
|
+
and payload.get("turn_id") == completed_turn_id
|
|
536
|
+
):
|
|
537
|
+
break
|
|
538
|
+
if event.get("type") == "compacted":
|
|
539
|
+
timestamp = _timestamp(event.get("timestamp"))
|
|
540
|
+
if (
|
|
541
|
+
timestamp is not None
|
|
542
|
+
and timestamp >= started_at
|
|
543
|
+
and (
|
|
544
|
+
completed_at is None
|
|
545
|
+
or timestamp <= completed_at
|
|
546
|
+
or (completed_turn_id is not None and current_turn_id == completed_turn_id)
|
|
547
|
+
)
|
|
548
|
+
and "compaction_response_id" not in payload
|
|
549
|
+
and response_usage is None
|
|
550
|
+
):
|
|
551
|
+
warnings.add("compaction_usage_unavailable")
|
|
552
|
+
continue
|
|
553
|
+
if event.get("type") == "token_usage_record":
|
|
554
|
+
if not isinstance(payload.get("thread_id"), str):
|
|
555
|
+
warnings.add("token_record_invalid")
|
|
556
|
+
continue
|
|
557
|
+
if payload.get("thread_id") != session.thread_id:
|
|
558
|
+
continue
|
|
559
|
+
timestamp = _timestamp(event.get("timestamp"))
|
|
560
|
+
usage = _usage_counts(payload.get("usage"))
|
|
561
|
+
response_id = payload.get("response_id")
|
|
562
|
+
if (
|
|
563
|
+
timestamp is None
|
|
564
|
+
or usage is None
|
|
565
|
+
or not isinstance(response_id, str)
|
|
566
|
+
or not response_id
|
|
567
|
+
):
|
|
568
|
+
warnings.add("token_record_invalid")
|
|
569
|
+
continue
|
|
570
|
+
is_completion_turn = (
|
|
571
|
+
completed_turn_id is not None and payload.get("turn_id") == completed_turn_id
|
|
572
|
+
)
|
|
573
|
+
if completed_at is not None and timestamp > completed_at and not is_completion_turn:
|
|
574
|
+
continue
|
|
575
|
+
if response_usage is None:
|
|
576
|
+
response_usage = _empty_token_usage()
|
|
577
|
+
if current_turn_id is None:
|
|
578
|
+
current_turn_id = payload.get("turn_id")
|
|
579
|
+
if response_id in response_ids:
|
|
580
|
+
continue
|
|
581
|
+
response_ids.add(response_id)
|
|
582
|
+
_add_token_usage(observed_response_usage, usage)
|
|
583
|
+
turn_usage = _usage_counts(payload.get("turn_token_usage"))
|
|
584
|
+
if timestamp < started_at:
|
|
585
|
+
if turn_usage is not None:
|
|
586
|
+
observed_response_usage = turn_usage
|
|
587
|
+
continue
|
|
588
|
+
if is_completion_turn:
|
|
589
|
+
completed_turn_measured = True
|
|
590
|
+
if turn_usage is not None and any(
|
|
591
|
+
turn_usage[key] > observed_response_usage[key] for key in TOKEN_FIELDS.values()
|
|
592
|
+
):
|
|
593
|
+
warnings.add("token_record_incomplete")
|
|
594
|
+
_add_token_usage(response_usage, usage)
|
|
595
|
+
continue
|
|
444
596
|
if event.get("type") != "event_msg" or payload.get("type") != "token_count":
|
|
445
597
|
continue
|
|
446
598
|
if "info" in payload and payload["info"] is None:
|
|
@@ -457,14 +609,22 @@ def _read_rollout_usage(
|
|
|
457
609
|
previous = snapshot
|
|
458
610
|
if timestamp < started_at:
|
|
459
611
|
continue
|
|
460
|
-
|
|
612
|
+
is_completion_turn = (
|
|
613
|
+
completed_turn_id is not None and current_turn_id == completed_turn_id
|
|
614
|
+
)
|
|
615
|
+
if completed_at is not None and timestamp > completed_at and not is_completion_turn:
|
|
461
616
|
continue
|
|
617
|
+
if is_completion_turn:
|
|
618
|
+
completed_turn_measured = True
|
|
462
619
|
if delta["totalTokens"] <= 0:
|
|
463
620
|
continue
|
|
464
|
-
_add_token_usage(
|
|
621
|
+
_add_token_usage(legacy_usage, delta)
|
|
465
622
|
|
|
623
|
+
_add_token_usage(total, response_usage if response_usage is not None else legacy_usage)
|
|
466
624
|
if not boundary_reached:
|
|
467
625
|
warnings.add("thread_ownership_unavailable")
|
|
626
|
+
if completed_turn_id is not None and not completed_turn_measured:
|
|
627
|
+
warnings.add("completion_turn_unavailable")
|
|
468
628
|
return total, warnings
|
|
469
629
|
|
|
470
630
|
|
|
@@ -515,7 +675,10 @@ def _token_snapshot(payload: Mapping[str, Any]) -> dict[str, int] | None:
|
|
|
515
675
|
info = payload.get("info")
|
|
516
676
|
if not isinstance(info, dict):
|
|
517
677
|
return None
|
|
518
|
-
|
|
678
|
+
return _usage_counts(info.get("total_token_usage"))
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
def _usage_counts(usage: object) -> dict[str, int] | None:
|
|
519
682
|
if not isinstance(usage, dict):
|
|
520
683
|
return None
|
|
521
684
|
cache_write = usage.get("cache_write_input_tokens", usage.get("cache_write_tokens", 0))
|
|
@@ -92,6 +92,19 @@ def _valid_measured_scan_usage(usage: object) -> bool:
|
|
|
92
92
|
or thread_count < 0
|
|
93
93
|
):
|
|
94
94
|
return False
|
|
95
|
+
completion = usage.get("completion")
|
|
96
|
+
if "completion" in usage and (
|
|
97
|
+
not isinstance(completion, dict)
|
|
98
|
+
or set(completion) != {"threadId", "turnId", "finalized"}
|
|
99
|
+
or not isinstance(completion["threadId"], str)
|
|
100
|
+
or not completion["threadId"]
|
|
101
|
+
or not isinstance(completion["turnId"], str)
|
|
102
|
+
or not completion["turnId"]
|
|
103
|
+
or type(completion["finalized"]) is not bool
|
|
104
|
+
or not completion["finalized"]
|
|
105
|
+
and coverage == "complete"
|
|
106
|
+
):
|
|
107
|
+
return False
|
|
95
108
|
warnings = usage.get("warnings", [])
|
|
96
109
|
if (
|
|
97
110
|
not isinstance(warnings, list)
|
|
@@ -105,7 +118,7 @@ def _valid_measured_scan_usage(usage: object) -> bool:
|
|
|
105
118
|
return False
|
|
106
119
|
if coverage == "unavailable":
|
|
107
120
|
return thread_count == 0 and set(usage).issubset(
|
|
108
|
-
{"coverage", "source", "threadCount", "warnings"}
|
|
121
|
+
{"coverage", "source", "threadCount", "warnings", "completion"}
|
|
109
122
|
)
|
|
110
123
|
|
|
111
124
|
allowed_keys = {
|
|
@@ -114,6 +127,7 @@ def _valid_measured_scan_usage(usage: object) -> bool:
|
|
|
114
127
|
"threadCount",
|
|
115
128
|
"missingThreadCount",
|
|
116
129
|
"warnings",
|
|
130
|
+
"completion",
|
|
117
131
|
*SCAN_USAGE_TOKEN_KEYS,
|
|
118
132
|
}
|
|
119
133
|
if thread_count == 0 or not set(usage).issubset(allowed_keys):
|
|
@@ -393,5 +393,22 @@
|
|
|
393
393
|
"statements": [
|
|
394
394
|
"ALTER TABLE deep_scan_runs ADD COLUMN discovery_user_context_json TEXT;"
|
|
395
395
|
]
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"version": 48,
|
|
399
|
+
"name": "share finding issue receipts across trackers",
|
|
400
|
+
"statements": [
|
|
401
|
+
"CREATE TABLE finding_issue_receipts (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n scan_id TEXT NOT NULL,\n finding_id TEXT NOT NULL,\n occurrence_id TEXT NOT NULL,\n destination_key TEXT NOT NULL,\n external_id TEXT NOT NULL,\n external_url TEXT,\n operation TEXT NOT NULL CHECK (operation IN ('create', 'update', 'reuse')),\n readback_json TEXT,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n UNIQUE (occurrence_id, destination_key, external_id, operation)\n);",
|
|
402
|
+
"INSERT INTO finding_issue_receipts (\n scan_id, finding_id, occurrence_id, destination_key, external_id, external_url,\n operation, readback_json, created_at, updated_at\n) SELECT scan_id, finding_id, occurrence_id, json_array(destination_type, team_id, project_id),\n external_id, external_url, 'create', NULL, created_at, created_at\nFROM finding_publications ORDER BY id;",
|
|
403
|
+
"DROP TABLE finding_publications;",
|
|
404
|
+
"CREATE INDEX finding_issue_receipts_by_finding\nON finding_issue_receipts(finding_id, destination_key, id);"
|
|
405
|
+
]
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"version": 49,
|
|
409
|
+
"name": "index finding issue receipt ownership",
|
|
410
|
+
"statements": [
|
|
411
|
+
"CREATE INDEX finding_issue_receipts_by_destination_issue\nON finding_issue_receipts(destination_key, external_id, finding_id);"
|
|
412
|
+
]
|
|
396
413
|
}
|
|
397
414
|
]
|
|
@@ -75,6 +75,6 @@ After the coordinator returns the canonical manifest and all three unsealed pare
|
|
|
75
75
|
|
|
76
76
|
Detailed finding write-ups and hardening proposals remain optional, exactly as in an ordinary Standard scan; invoke `$codex-security:vulnerability-writeup` or `$codex-security:propose-security-hardening` only when the corresponding additional output is requested. Read `get_codex_security_completed_scan` only when requested structured or benchmark output actually requires the full sealed documents.
|
|
77
77
|
|
|
78
|
-
Return user-facing or benchmark output only after completion succeeds and the generated `report.md` exists. Link the report and canonical artifacts. Include measured total, input, and cached input token counts;
|
|
78
|
+
Return user-facing or benchmark output only after completion succeeds and the generated `report.md` exists. Link the report and canonical artifacts. Include measured total, input, and cached input token counts only when coverage is complete; leave pending usage to the host's end-of-turn finalization and identify other incomplete counts as unavailable. Never report a preliminary count as a final total or an "at least" estimate. If the configured time limit elapsed before any source review completed, explain that no source review finished and retain any saved findings or pending work; do not claim the repository is free of vulnerabilities. An empty finding set with completed review is the ordinary Codex Security no-findings result, not permission to skip completion.
|
|
79
79
|
|
|
80
80
|
If canonical coordinator artifacts are missing or malformed, stop and surface the exact blocker without calling completion, fabricating a report, or claiming success. If completion fails, surface its exact MCP error without retrying, canceling, failing the durable scan, or returning final, no-findings, structured, or benchmark output. Leave resumable work running and preserve its handoff claim. On explicit cancellation, call `cancel_codex_security_scan` and do not accept later scan progress or success. The host may preserve a final in-flight checkpoint after worker cleanup without resuming analysis. Never edit repository files, widen the target, expose internal worker bookkeeping unless requested, or call `fail_codex_security_scan` merely because a waiter detached, a turn ended, workers are still active, or partial artifacts exist.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Deep Security Scan"
|
|
3
3
|
short_description: "Run a deeper security scan"
|
|
4
|
-
default_prompt: "Use $codex-security:deep-security-scan to run a deep Codex Security
|
|
4
|
+
default_prompt: "Use $codex-security:deep-security-scan to run a deep Codex Security scan."
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Security Diff Scan"
|
|
3
3
|
short_description: "Run security review on a Git diff"
|
|
4
|
-
default_prompt: "Run a Codex Security
|
|
4
|
+
default_prompt: "Run a Codex Security diff scan on this PR, commit, branch diff, or working-tree patch. Cover all in-scope changed files and complete the required scan phases."
|
|
@@ -24,7 +24,7 @@ When an SDK or terminal host sets `CODEX_SECURITY_SCAN_ID`, emit its standalone
|
|
|
24
24
|
1. Resolve the repository, requested scope, and output scan directory from the host-provided scan context when available; otherwise use only the explicitly SDK-provided directory. Preserve the exact user context, supplied threat model, applicable inherited `SECURITY.md` guidance, and optional `CODEX_SECURITY_KNOWLEDGE_BASE` for the core audit. Resolve `<python_command>` from the configured interpreter (`"$PYTHON"` in POSIX shells or `& "$env:PYTHON"` in PowerShell), otherwise use `python3` on Unix-like hosts or `python` on Windows. Only when `CODEX_SECURITY_TARGET_PATHS_FILE` is supplied, resolve every authorized source path before review with `<python_command> <plugin_dir>/scripts/generate_rank_input.py make-repo-scope-input --repo <repo_root> --scopes-file <target_paths_file> --out <scan_dir>/scoped-source-input.jsonl`; use `"$CODEX_SECURITY_TARGET_PATHS_FILE"` in POSIX shells or `"$env:CODEX_SECURITY_TARGET_PATHS_FILE"` in PowerShell and honor repository ignore rules for directory descendants while retaining every directly requested file. Never print, modify, or treat the scope input as shell syntax; pass it to the core audit without widening the authorized target or scope.
|
|
25
25
|
2. Read `../../references/core-scan.md` once and review the resolved target within its authorized scope and configured limits, using the supplied context, threat model, security policy, knowledge base, workers, and scoped-source inventory. Retain the resulting complete semantic `scope`, `threatModel`, `findings`, and `coverage`; preserve every finding's source evidence, calibrated severity, confidence, root cause, validation, attack path, and honest coverage.
|
|
26
26
|
3. For a host-backed scan, save a `complete: false` checkpoint as soon as the threat model is available, with no findings when none exist yet. Continue checkpointing during the core audit, then submit one accepted final semantic draft with `record_codex_security_scan_draft({ scanId, complete: true, handoffClaimToken?, scope?, threatModel, findings, coverage })`; let the workbench derive its authoritative target, scope, coverage metadata, surface IDs, finding identities, and fingerprints. On that final draft, close finished generic tasks with `coverage.resolvedDeferred: [{ id, reason }]`, using the saved IDs from `coverage.deferred` and a completion reason. Reuse saved surface IDs for updates; retain unfinished work and candidate outcomes. If the draft is explicitly rejected before writing, correct only the identified fields without dropping valid findings or evidence and retry the same scan at most twice. For an SDK-owned scan with a bound semantic draft tool, use it for the same early model checkpoint and later drafts. For an explicitly SDK-owned scan without that tool, retain the model in an early unsealed canonical draft and update the unsealed canonical `scan-manifest.json`, `findings.json`, and `coverage.json`; use `scoped_path` for both coverage fields when a scope was requested, otherwise set `coverage.mode` to `repository` and `coverage.inventoryStrategy` to `directory` for a non-Git directory or `repository` for a Git-backed target. Omit `scan.sealedAt` and `scan.artifacts`; an SDK scan preserves its exact registered directory and all SDK-provided scan and target values. When `CODEX_SECURITY_TARGET_PATHS_FILE` is supplied on either file-authored path, bind its exact requested paths with `<plugin_dir>/scripts/launch_codex_security_mcp --helper bind-repo-scopes --scopes-file <target_paths_file> --manifest <scan_dir>/scan-manifest.json --coverage <scan_dir>/coverage.json`, using the same shell-specific target-paths reference. For SDK scans, use the exact scope-binding command in the scan instructions so Windows batch invocation preserves literal path values. For other Windows scans, use the [PowerShell scope-binding command](#windows-scope-binding) below.
|
|
27
|
-
4. Verify all three canonical JSON files exist. For an SDK-owned scan, return control without finalizing, sealing, generating `report.md` or `threatmodel.md`, or starting another scan; the SDK owns completion. For another host-backed scan, call `complete_codex_security_scan({ scanId, handoffClaimToken? })` once. Outside the SDK path, return only after completion succeeds and the generated `report.md` exists; never write the report by hand or reread the complete canonical findings unless the user explicitly requests them. Report measured token counts
|
|
27
|
+
4. Verify all three canonical JSON files exist. For an SDK-owned scan, return control without finalizing, sealing, generating `report.md` or `threatmodel.md`, or starting another scan; the SDK owns completion. For another host-backed scan, call `complete_codex_security_scan({ scanId, handoffClaimToken? })` once. Outside the SDK path, return only after completion succeeds and the generated `report.md` exists; never write the report by hand or reread the complete canonical findings unless the user explicitly requests them. Report complete measured token counts only; leave pending usage to the host's end-of-turn finalization and identify other incomplete counts as unavailable.
|
|
28
28
|
|
|
29
29
|
Keep discovery, validation, and attack-path reasoning within this Standard workflow; do not invoke separate phase skills or load Deep or diff references. Never call Deep-only tools. Do not create ranking phases, per-file or per-candidate ledgers, separate phase worker pools, repeated phase reports, or receipt files.
|
|
30
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Security Scan"
|
|
3
3
|
short_description: "Run repository or scoped-path security scan"
|
|
4
|
-
default_prompt: "Run a Codex Security
|
|
4
|
+
default_prompt: "Run a Codex Security scan on this repository or scoped path using subagents. Cover all in-scope files and complete the required scan phases."
|
|
@@ -22,7 +22,7 @@ Publish meaningful completed-review batches through the same tool. Increase the
|
|
|
22
22
|
|
|
23
23
|
Save the first `complete: false` checkpoint as soon as architecture mapping produces the threat model, with `findings: []` when no findings exist yet. The host retains the canonical model and generates `threatmodel.md`. Continue saving checkpoints as results arrive and validation decisions are made. Preserve pending candidates with their original evidence in `coverage.deferred`; they are not validated findings. When the audit finishes, record the final semantic scan draft once with `record_codex_security_scan_draft({ scanId, complete: true, handoffClaimToken?, scope?, threatModel?, findings, coverage })`. Supply the actual findings, source-backed coverage, and preserved threat model; let the workbench write the unsealed canonical artifacts and derive authoritative target, scope, coverage metadata, finding identities, and fingerprints.
|
|
24
24
|
|
|
25
|
-
Honor desktop handoff requirements for any per-finding write-ups before completion. After the semantic draft succeeds and all three canonical JSON files exist, call `complete_codex_security_scan` exactly once with the same authoritative scan ID and handoff token. Return only after completion succeeds and `report.md` exists, linking the generated report and canonical artifacts; retrieve the complete findings only when the user explicitly requests them. Include measured token usage
|
|
25
|
+
Honor desktop handoff requirements for any per-finding write-ups before completion. After the semantic draft succeeds and all three canonical JSON files exist, call `complete_codex_security_scan` exactly once with the same authoritative scan ID and handoff token. Return only after completion succeeds and `report.md` exists, linking the generated report and canonical artifacts; retrieve the complete findings only when the user explicitly requests them. Include complete measured token usage only; the host finalizes pending usage after this turn ends. Identify other incomplete counts as unavailable.
|
|
26
26
|
|
|
27
27
|
For each reported finding, emit one `::code-comment{title="[<priority-label>] <title>" body="<explanation>" file="<absolute path>" start=<line> end=<line> priority=<priority-number> confidence=<0-to-1>}` review directive at its tightest `root_control` location, or the most relevant affected source location when no root control is identifiable. Map `critical`, `high`, `medium`, and `low` to `P0/0`, `P1/1`, `P2/2`, and `P3/3` respectively; keep its title and explanation consistent with the generated report.
|
|
28
28
|
|
|
@@ -55,6 +55,8 @@ The parent agent must reconcile validation and attack-path subagent outputs befo
|
|
|
55
55
|
|
|
56
56
|
## Scoped Deep Review
|
|
57
57
|
|
|
58
|
+
The legacy ranking helpers have been removed: `make-repo-rank-input`, `select-deep-review-input`, `make-rank-shards`, `validate-rank-shard`, `merge-rank-outputs`, `make-rank-pool-plan`, `validate-rank-worker`, and `validate-rank-pool`. Use `make-repo-scope-input --repo <repo_root> --scopes-file <scopes_json> --out <output_jsonl>` for explicit repository scopes. Diff scans retain `make-diff-rank-input` and `copy-deep-review-input` as shown below, including their existing arguments and worklist formats.
|
|
59
|
+
|
|
58
60
|
- Use `deep_review_input.jsonl` as the canonical changed-file review worklist for diff scans.
|
|
59
61
|
- For diff-scoped scans, generate `rank_input.jsonl` deterministically from changed text files regardless of filename, extension, or directory, with `<python_command> <plugin_dir>/scripts/generate_rank_input.py make-diff-rank-input --repo <repo_root> --base <base> --mode revisions --head <head> --out <discovery_dir>/rank_input.jsonl` for PR, commit, and branch diffs, or `<python_command> <plugin_dir>/scripts/generate_rank_input.py make-diff-rank-input --repo <repo_root> --base <base> --mode local-patch --out <discovery_dir>/rank_input.jsonl` for a local patch, then copy every row into `deep_review_input.jsonl` with `<plugin_dir>/scripts/launch_codex_security_mcp --helper copy-deep-review-input --rank-input <discovery_dir>/rank_input.jsonl --out <discovery_dir>/deep_review_input.jsonl`. On Windows, use the [PowerShell copy command](#windows-worklist-copy) below.
|
|
60
62
|
- Diff-scoped scans do not rank or drop changed files before deep review. Every row in diff `rank_input.jsonl` must be copied into `deep_review_input.jsonl` and receive a full-file review receipt.
|
|
@@ -52,12 +52,14 @@ Report source status as `verified`, `unverified` (a candidate cannot be tied to
|
|
|
52
52
|
|
|
53
53
|
Read the provider state needed to choose supported fields. Use exact ids for teams, projects, labels, milestones, and assignees when available. Do not invent metadata or infer it from names.
|
|
54
54
|
|
|
55
|
+
Call `get_codex_security_finding_issues` with `scanDirectory`, the selected `findingIds`, and the confirmed `destination`: Linear `{type: "linear", teamId, projectId?}`, Jira `{type: "jira", cloudId, projectId}`, or GitHub `{type: "github-issue" | "github-advisory", hostname, repository: "owner/repo"}`. Use canonical provider ids. Saved associations include earlier scan occurrences and CLI publications; read them through the selected provider and confirm the match before reuse. They do not replace remote duplicate searches.
|
|
56
|
+
|
|
55
57
|
Search the finding id and fingerprint before proposing a create. Search all statuses in the exact destination; GitHub issue searches exclude pull requests. Complete identifier searches and read plausible matches. Add narrow semantic searches when safe for the confirmed audience.
|
|
56
58
|
|
|
57
59
|
Compare bindings when present and assess whether the source context, affected code, root cause, control, and sink match. Similar wording or missing bindings alone do not settle the comparison. Choose one outcome:
|
|
58
60
|
|
|
59
61
|
- `create`: complete searches found no issue tracking the same finding.
|
|
60
|
-
- `reuse`: one issue tracks the finding, established by a current read or this run's successful create receipt. Reuse
|
|
62
|
+
- `reuse`: one issue tracks the finding, established by a current read or this run's successful create receipt. Reuse does not require adding bindings or rewriting the issue.
|
|
61
63
|
- `update`: one verified matching issue should receive specific reviewed changes.
|
|
62
64
|
- `blocked`: routing, access, disclosure, or duplicate ambiguity prevents a decision.
|
|
63
65
|
|
|
@@ -73,7 +75,7 @@ Every create or update body includes labeled canonical finding id and primary fi
|
|
|
73
75
|
|
|
74
76
|
Do not include credentials, signed URLs, local file URLs, or unreviewed links. A public GitHub issue requires approval of its complete public title and body, including a prominent visibility warning. Exclude internal evidence, attack paths, exploit detail, and private source links from public issues.
|
|
75
77
|
|
|
76
|
-
For batches, show every item in execution order and obtain approval for that list. A general request to track findings does not approve an unseen payload. Changes to source, identity, transport, destination, audience, duplicate decision, payload, or membership require a new preview and approval.
|
|
78
|
+
For batches, show every item in execution order and obtain approval for that list. A general request to track findings does not approve an unseen payload. Changes to source, identity, transport, destination, audience, duplicate decision, payload, or membership require a new preview and approval. Reuse requires neither provider mutation approval nor write access.
|
|
77
79
|
|
|
78
80
|
## 5. Apply and verify
|
|
79
81
|
|
|
@@ -81,9 +83,11 @@ After an approval pause or interruption, rerun source validation, reverify sourc
|
|
|
81
83
|
|
|
82
84
|
Before creating, refresh duplicate results to catch an issue created while awaiting approval. After a pause, reread each selected reuse candidate and reconfirm the match; stop if it is unreadable or ambiguous, and return to preview if the duplicate decision changes. Before updating after a pause, reread the fields being changed and return to preview if they differ from the reviewed values. Without an intervening pause, a successful create receipt can supply the values for an already approved follow-up edit. Preserve unowned fields and existing rich content.
|
|
83
85
|
|
|
84
|
-
Process findings serially in the approved order. Immediately before each create, update, or reuse, run the source validator with that exact finding id and stop if it fails. Use the exact approved payload
|
|
86
|
+
Process findings serially in the approved order. Immediately before each create, update, or reuse, run the source validator with that exact finding id and stop if it fails. Use the exact approved payload. Stop the batch on a failed or uncertain mutation or unresolved duplicate.
|
|
87
|
+
|
|
88
|
+
A successful provider response establishes an accepted write. Immediately call `record_codex_security_finding_issues` with the same source and destination and a receipt containing the canonical `findingId` and `occurrenceId`, returned `issueIdentifier`, optional returned `url`, and `operation: "create" | "update" | "reuse"`. Record verified reuse the same way, using the current scan occurrence. Preserve returned identities and stop the batch if local recording fails; a storage failure never authorizes another create.
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
After recording an accepted write, read the returned object through the same transport when possible to check identity and changed fields, allowing provider formatting that preserves meaning and links. Record the same receipt again with `readback: {status: "verified"}` or `{status: "failed", error}`; omit readback when no read was attempted. A current read confirming reuse can be recorded as verified immediately. Keep accepted writes and read failures distinct. An unreadable issue does not authorize another create.
|
|
87
91
|
|
|
88
92
|
For CLI issue writes, put the approved body in a mode-`0600` temporary file outside the repository and scan bundle, arrange cleanup on every exit, and pass it to one `gh issue create` or `gh issue edit`. Never print the file. Capture the issue identity and read it with `gh issue view --json`. Use the advisory reference for JSON file creation and required readback.
|
|
89
93
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Track Findings"
|
|
3
3
|
short_description: "Track findings in Linear, Jira, GitHub issues, or draft advisories"
|
|
4
|
-
default_prompt: "Track validated Codex Security
|
|
4
|
+
default_prompt: "Track validated Codex Security findings. Show a reviewable dry run before writing."
|
|
5
5
|
policy:
|
|
6
6
|
allow_implicit_invocation: true
|
|
@@ -43,4 +43,4 @@ Use the main skill's preview and approval flow, including package metadata, the
|
|
|
43
43
|
|
|
44
44
|
Write the approved JSON to a mode-`0600` temporary file outside the repository and scan directory. Review it for sensitive content and send it once with `gh api --hostname github.com --input`; remove it on every exit. Reconcile uncertain creates by exact bindings before considering another mutation.
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Record the accepted create with the returned `ghsa_id` using the main skill's shared issue history, then read it through the allowed endpoint. Compare normalized structured readback with the approved payload and require `state: draft` before reporting success. Record that readback separately from the accepted create.
|
package/dist/api.d.ts
CHANGED
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";AA2CA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,OAAO,EAKL,gBAAgB,EAIhB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAcL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,sBAAsB,EA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