@openai/codex-security 0.1.20 → 0.1.23
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/README.md +1101 -865
- package/_bundled_plugin/.codex-plugin/plugin.json +1 -1
- 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/config-preflight.md +2 -30
- package/_bundled_plugin/references/core-scan.md +1 -1
- package/_bundled_plugin/references/final-report.md +1 -1
- package/_bundled_plugin/references/finding-detail-fields.md +5 -10
- package/_bundled_plugin/references/sarif-adapter.md +1 -1
- package/_bundled_plugin/schemas/patch-risk-assessment.schema.json +243 -0
- package/_bundled_plugin/scripts/config_preflight.py +2 -8
- package/_bundled_plugin/scripts/finalize_scan_contract.py +206 -35
- package/_bundled_plugin/scripts/finding_preview.py +22 -4
- package/_bundled_plugin/scripts/generate_in_scope_files.py +27 -1
- package/_bundled_plugin/scripts/launch_codex_security_mcp +0 -0
- package/_bundled_plugin/scripts/windows_scan_local_files.py +101 -7
- package/_bundled_plugin/scripts/workbench_cli.py +21 -1
- package/_bundled_plugin/scripts/workbench_dashboard.py +115 -0
- package/_bundled_plugin/scripts/workbench_db.py +29 -2
- package/_bundled_plugin/scripts/workbench_finding_index.py +42 -24
- package/_bundled_plugin/scripts/workbench_finding_workflows.py +190 -0
- package/_bundled_plugin/scripts/workbench_findings.py +216 -0
- package/_bundled_plugin/scripts/workbench_saved_results.py +30 -5
- package/_bundled_plugin/scripts/workbench_schema.py +263 -58
- package/_bundled_plugin/scripts/workbench_target.py +22 -3
- package/_bundled_plugin/skills/assess-patch-risk/SKILL.md +88 -0
- package/_bundled_plugin/skills/assess-patch-risk/agents/openai.yaml +4 -0
- package/_bundled_plugin/skills/assess-patch-risk/references/risk-rubric.md +76 -0
- package/_bundled_plugin/skills/assess-patch-risk/scripts/validate_patch_risk_assessment.py +163 -0
- package/_bundled_plugin/skills/fix-finding/SKILL.md +16 -48
- package/_bundled_plugin/skills/track-findings/SKILL.md +2 -0
- package/dist/api.d.ts +3 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +129 -45
- package/dist/api.js.map +1 -1
- package/dist/bulk-scan-discovery.d.ts.map +1 -1
- package/dist/bulk-scan-discovery.js +6 -24
- package/dist/bulk-scan-discovery.js.map +1 -1
- package/dist/cli.d.ts +28 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +525 -96
- package/dist/cli.js.map +1 -1
- package/dist/cloud-publish.d.ts +5 -1
- package/dist/cloud-publish.d.ts.map +1 -1
- package/dist/cloud-publish.js +312 -10
- package/dist/cloud-publish.js.map +1 -1
- package/dist/component-plan.d.ts.map +1 -1
- package/dist/component-plan.js +5 -1
- package/dist/component-plan.js.map +1 -1
- package/dist/contract.d.ts +1 -0
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +9 -0
- package/dist/contract.js.map +1 -1
- package/dist/custom-publish.d.ts +22 -0
- package/dist/custom-publish.d.ts.map +1 -0
- package/dist/custom-publish.js +47 -0
- package/dist/custom-publish.js.map +1 -0
- package/dist/custom-validation-prompt.js +1 -1
- package/dist/custom-validation-prompt.js.map +1 -1
- package/dist/deduplication/checkpointed-review.d.ts +16 -0
- package/dist/deduplication/checkpointed-review.d.ts.map +1 -0
- package/dist/deduplication/checkpointed-review.js +76 -0
- package/dist/deduplication/checkpointed-review.js.map +1 -0
- package/dist/deduplication/codex-review.d.ts +21 -0
- package/dist/deduplication/codex-review.d.ts.map +1 -0
- package/dist/deduplication/codex-review.js +252 -0
- package/dist/deduplication/codex-review.js.map +1 -0
- package/dist/deduplication/deduplication-prompts.d.ts +8 -0
- package/dist/deduplication/deduplication-prompts.d.ts.map +1 -0
- package/dist/deduplication/deduplication-prompts.js +35 -0
- package/dist/deduplication/deduplication-prompts.js.map +1 -0
- package/dist/deduplication/deduplication-reviewer.d.ts +46 -0
- package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -0
- package/dist/deduplication/deduplication-reviewer.js +105 -0
- package/dist/deduplication/deduplication-reviewer.js.map +1 -0
- package/dist/deduplication/deduplication.d.ts +6 -0
- package/dist/deduplication/deduplication.d.ts.map +1 -0
- package/dist/deduplication/deduplication.js +85 -0
- package/dist/deduplication/deduplication.js.map +1 -0
- package/dist/deduplication/scan.d.ts +16 -0
- package/dist/deduplication/scan.d.ts.map +1 -0
- package/dist/deduplication/scan.js +101 -0
- package/dist/deduplication/scan.js.map +1 -0
- package/dist/finding-dedupe-groups.d.ts +7 -0
- package/dist/finding-dedupe-groups.d.ts.map +1 -0
- package/dist/finding-dedupe-groups.js +2 -0
- package/dist/finding-dedupe-groups.js.map +1 -0
- package/dist/finding-retrieval.d.ts +13 -0
- package/dist/finding-retrieval.d.ts.map +1 -0
- package/dist/finding-retrieval.js +2 -0
- package/dist/finding-retrieval.js.map +1 -0
- package/dist/finding-workflow.d.ts +53 -0
- package/dist/finding-workflow.d.ts.map +1 -0
- package/dist/finding-workflow.js +117 -0
- package/dist/finding-workflow.js.map +1 -0
- package/dist/findings-client.d.ts +15 -0
- package/dist/findings-client.d.ts.map +1 -0
- package/dist/findings-client.js +60 -0
- package/dist/findings-client.js.map +1 -0
- package/dist/github.d.ts +161 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +158 -0
- package/dist/github.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/publication.js +28 -40
- package/dist/publication.js.map +1 -1
- package/dist/publish.d.ts +10 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +29 -5
- package/dist/publish.js.map +1 -1
- package/dist/runtime.d.ts +5 -4
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +371 -197
- package/dist/runtime.js.map +1 -1
- package/dist/saved-scan.d.ts +15 -0
- package/dist/saved-scan.d.ts.map +1 -0
- package/dist/saved-scan.js +68 -0
- package/dist/saved-scan.js.map +1 -0
- package/dist/scan-comparison.d.ts +6 -2
- package/dist/scan-comparison.d.ts.map +1 -1
- package/dist/scan-comparison.js +7 -2
- package/dist/scan-comparison.js.map +1 -1
- package/dist/server/dashboard/THIRD_PARTY_NOTICES.txt +276 -0
- package/dist/server/dashboard/app.css +2 -0
- package/dist/server/dashboard/app.js +66 -0
- package/dist/server/dashboard/index.html +18 -0
- package/dist/server/dashboard-types.d.ts +45 -0
- package/dist/server/dashboard-types.d.ts.map +1 -0
- package/dist/server/dashboard-types.js +2 -0
- package/dist/server/dashboard-types.js.map +1 -0
- package/dist/server/dashboard.d.ts +6 -0
- package/dist/server/dashboard.d.ts.map +1 -0
- package/dist/server/dashboard.js +45 -0
- package/dist/server/dashboard.js.map +1 -0
- package/dist/server/embeddings.d.ts +16 -0
- package/dist/server/embeddings.d.ts.map +1 -0
- package/dist/server/embeddings.js +114 -0
- package/dist/server/embeddings.js.map +1 -0
- package/dist/server/errors.d.ts +5 -0
- package/dist/server/errors.d.ts.map +1 -0
- package/dist/server/errors.js +8 -0
- package/dist/server/errors.js.map +1 -0
- package/dist/server/findings-service.d.ts +20 -0
- package/dist/server/findings-service.d.ts.map +1 -0
- package/dist/server/findings-service.js +31 -0
- package/dist/server/findings-service.js.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +32 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/routes.d.ts +6 -0
- package/dist/server/routes.d.ts.map +1 -0
- package/dist/server/routes.js +86 -0
- package/dist/server/routes.js.map +1 -0
- package/dist/server/server.d.ts +10 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +17 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/sqlite-store.d.ts +22 -0
- package/dist/server/sqlite-store.d.ts.map +1 -0
- package/dist/server/sqlite-store.js +82 -0
- package/dist/server/sqlite-store.js.map +1 -0
- package/dist/server/storage.d.ts +32 -0
- package/dist/server/storage.d.ts.map +1 -0
- package/dist/server/storage.js +2 -0
- package/dist/server/storage.js.map +1 -0
- package/dist/server/validation.d.ts +17 -0
- package/dist/server/validation.d.ts.map +1 -0
- package/dist/server/validation.js +53 -0
- package/dist/server/validation.js.map +1 -0
- package/dist/targets.d.ts.map +1 -1
- package/dist/targets.js +1 -0
- package/dist/targets.js.map +1 -1
- package/dist/thread-source.d.ts +8 -0
- package/dist/thread-source.d.ts.map +1 -0
- package/dist/thread-source.js +7 -0
- package/dist/thread-source.js.map +1 -0
- package/dist/trusted-executable.d.ts.map +1 -1
- package/dist/trusted-executable.js +2 -1
- package/dist/trusted-executable.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +23 -8
|
Binary file
|
|
Binary file
|
|
@@ -72,39 +72,11 @@ After a native handoff or direct conversation start provides a `scanId`, use its
|
|
|
72
72
|
|
|
73
73
|
For standard and diff scans, the app handoff starts preflight without an item count. After every structured helper result, call `update_codex_security_scan_progress` without changing phase and set `preflightChecks` to every entry from the helper's `results` array, projecting each entry to only `capability`, `reason`, `severity`, and `status`. Do not send `phaseItemsTotal`, `phaseItemsCompleted`, or `phaseProgressUnit` with `preflightChecks`: the server derives the total from the array length, counts `pass` and `fail` as completed, excludes `unknown` from completed, and derives the visible `block` or `warn` attention items. Send the full fresh results array after a clean rerun so stale issues disappear. Do not interpret item-count completion as readiness: remain in preflight for every blocked, incomplete, or error result while remediation or retry remains pending, even when every returned check was evaluated. Only after a `ready` result has published its fresh `preflightChecks` should a separate progress call advance to `threat_model`. These counts and issues belong to the current scan rather than the legacy setup-time workspace preflight, and remain visible after the scan advances. Deep Scan preflight and discovery progress remain owned by `start_codex_security_deep_scan`.
|
|
74
74
|
|
|
75
|
-
Continue after a `ready` result. Explain
|
|
76
|
-
|
|
77
|
-
When blocked or incomplete preflight includes actionable remediation, first classify the current session before choosing a remediation control. Treat `codex exec`, headless runs, automation runs, and any host that cannot actually pause for a human reply as non-interactive even if `request_user_input` or `request_codex_security_user_input` is named in this document or appears callable. In a non-interactive session, never call either user-input tool and never fall back to a chat question; go directly to the automatic-remediation path below. Only after the session is confirmed interactive, present the exact reasons and config delta in the Codex thread and optimistically call the native `request_user_input` tool so the paused scan is visibly waiting for the user's decision instead of asking only in plain chat prose:
|
|
78
|
-
|
|
79
|
-
```text
|
|
80
|
-
request_user_input(
|
|
81
|
-
questions=[
|
|
82
|
-
{
|
|
83
|
-
"header": "Preflight?",
|
|
84
|
-
"id": "apply_preflight_remediation",
|
|
85
|
-
"question": "Apply the recommended remediation and retry the preflight?",
|
|
86
|
-
"options": [
|
|
87
|
-
{
|
|
88
|
-
"label": "Apply and retry (Recommended)",
|
|
89
|
-
"description": "Apply the approved remediation, then rerun the capability preflight."
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"label": "Leave paused",
|
|
93
|
-
"description": "Keep the scan running for a later retry without changing configuration."
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"label": "Cancel scan",
|
|
97
|
-
"description": "Cancel this scan without applying the remediation."
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
)
|
|
103
|
-
```
|
|
75
|
+
Continue only after a `ready` result. Explain material warnings and use the documented degraded path. For a blocked, incomplete, or error result, report the exact reason and preserve any durable running scan while recovery remains possible; do not review source or start workers early.
|
|
104
76
|
|
|
105
77
|
Do not set `autoResolutionMs`; in an interactive session, an explicit answer is required before persistent configuration changes or scan continuation. If native `request_user_input` is unavailable or errors, call `request_codex_security_user_input` with the same `questions` payload. This MCP fallback is interactive and must remain prohibited in non-interactive sessions. If it returns `accepted`, follow its answer. If it is unavailable or errors, ask the same choices in chat. If it returns `declined` or `cancelled`, do not infer a choice; preserve the running scan, stop, and state that an explicit answer is still required. In every interactive waiting case, stop for the user's answer before creating or adopting a scan goal. Do not call `fail_codex_security_scan` while waiting for that answer. Apply only the approved remediation after `Apply and retry`, preserve the running scan and stop after `Leave paused`, and call `cancel_codex_security_scan` after `Cancel scan`.
|
|
106
78
|
|
|
107
|
-
In a non-interactive
|
|
79
|
+
In a non-interactive session, never request user input. Automatically apply only the helper's concrete `value` or `remove` patches to its writable `user_config_path`, preserving unrelated settings; never apply `host_setting` patches automatically. Rerun once with the same verified runtime facts and continue only if the result is `ready`. If remediation is unavailable, needs a new session, remains blocked, or errors, report the blocker without looping, canceling, or marking the scan failed; preserve a durable scan for later continuation.
|
|
108
80
|
|
|
109
81
|
For any non-ready result, do not fail automatically. If an interactive chat fallback declines required remediation without choosing whether to cancel or leave the scan running, ask that follow-up before taking either action. If remediation is unavailable, the helper cannot run, the helper returns an error envelope, or a rerun remains blocked or incomplete, preserve a durable running scan and retry or hand off while recovery may still be possible. Call `fail_codex_security_scan` with the exact reasons only after the documented recovery path is exhausted and the blocker is confirmed unrecoverable. When the user explicitly cancels, call `cancel_codex_security_scan`.
|
|
110
82
|
|
|
@@ -11,7 +11,7 @@ Perform one complete, evidence-backed security audit of the exact supplied repos
|
|
|
11
11
|
5. Launch focused investigator subagents with `fork_turns: "none"` as soon as useful packet groups exist. Choose their number and assignments from the amount, complexity, and independence of source-backed work, bounded by the supplied available subagent allowance; use fewer for related packets and more only when distinct surfaces justify them. Keep mapping other surfaces while they run. Send each only its focused-investigator prompt below, assigned packets, investigator perspective, repository path, authorized scope, any supplied scoped-source inventory, exact user context, supplied threat model, applicable packet-specific security guidance and its resolver command, the optional authoritative knowledge-base location, and verified search command. Do not include this reference or another worker's prompt. Supporting code may be outside a requested path, but an affected entry point, control, or operation must be in scope.
|
|
12
12
|
6. Before combining or revalidating any returned baseline or investigator result, persist it through the caller's bound `record_codex_security_scan_draft` tool when available, using `complete: false` and partial coverage. Give each candidate a stable `candidateId`; put candidates awaiting parent validation in `coverage.deferred` with a meaningful reason and their original finding payload under `candidate`. Preserve returned counterevidence and unresolved questions too. Checkpoint again after each validation decision, without waiting for other workers or the final report. Put source-validated findings in `findings` with the same `provenance.candidateId`; for a rejection, retain the candidate ID, original evidence, and source-backed counterevidence on a `rejected` coverage surface. An unfinished scan must retain its saved findings and pending candidates without presenting pending work as validated. Reconcile source coverage before combining findings. Union only the baseline and focused investigators' `fully_reviewed_files` with files the parent fully security-audited, then intersect that set with the supplied authorized inventory or an inventory of the selected current scope. Architecture mapping alone and supporting files outside that inventory do not count toward completed audit coverage. Finish the remaining in-scope files in coherent groups, reusing available investigators within the same allowance. Inspect implementation-owning generated or compressed code as data. Do not add overlapping worker counts or claim that a search hit completed a file. Keep this one transient set; do not create a separate progress ledger or receipt format. If a user limit or unavailable source prevents completion, identify the actual remaining paths and report partial coverage. Then combine baseline and investigator findings once. Group observations only when they share the same broken security control and effective remediation; preserve every affected route, operation, sink, and supporting source location. Never merge different security failures solely because they share a CWE.
|
|
13
13
|
7. Independently validate each unique finding against local source once. Establish its attacker, entry point, trust boundary, attacker-controlled dataflow, transformations, broken control, sensitive operation, prerequisites, effective mitigations, strongest counterevidence, and concrete impact. Record concise, source-backed `rootCause.summary`, `validation.summary`, `attackPath.dataflow.summary`, and `attackPath.reachability.summary` alongside their supporting facts; determine impact, likelihood, and severity from those established facts. State optional configuration, dependency-version, or deployment prerequisites; do not require proof of a real deployment or runtime reproduction. A public library or parser boundary is sufficient when callers control the input. Reject only with source-backed counterevidence, preserve valid baseline findings, record material unresolved proof gaps, and apply the severity rules below.
|
|
14
|
-
8. Assemble complete semantic `scope`, `threatModel`, `findings`, and `coverage` using the plugin's `examples/completed-scan/` and `schemas/` as shape references, never as values to copy. Use the canonical field mapping and scenario reconciliation in `threat-model.md`, preserving supplied models unchanged and retaining source-backed architecture, capability, deployment, and uncertainty facts. Give each finding a stable lowercase vulnerability-family `ruleId`, its precise `taxonomy.category` and `taxonomy.cwe` values, genuine `provenance.source`, an instance when separately reported findings would otherwise collide, a `root_control` location when identifiable, all materially affected locations, calibrated severity and rationale, confidence and rationale, verified nonempty source evidence, attacker-to-sink reachability, and practical remediation. Use actual coverage surface labels and dispositions; report reviewed surfaces, explicit exclusions, deferred work, and unresolved questions honestly, and mark coverage `complete` only when the requested source scope was actually reviewed. Preserve every genuine finding, evidence item, user-supplied assumption, and unresolved proof gap in the caller's complete semantic result.
|
|
14
|
+
8. Assemble complete semantic `scope`, `threatModel`, `findings`, and `coverage` using the plugin's `examples/completed-scan/` and `schemas/` as shape references, never as values to copy. Use the canonical field mapping and scenario reconciliation in `threat-model.md`, preserving supplied models unchanged and retaining source-backed architecture, capability, deployment, and uncertainty facts. Give each finding a stable lowercase vulnerability-family `ruleId`, its precise `taxonomy.category` and `taxonomy.cwe` values, genuine `provenance.source`, an instance when separately reported findings would otherwise collide, a `root_control` location when identifiable, all materially affected locations, calibrated severity and rationale, confidence and rationale, verified nonempty source evidence, attacker-to-sink reachability, and practical remediation. Write source evidence as `codeEvidence` entries with required `id`, `label`, `path`, `startLine`, `code`, and `explanation` fields; `endLine`, `language`, and `role` are optional. Use `code`, never `snippet`, and write new root-cause details as `rootCause`, never `root_cause`. Follow `finding-detail-fields.md` when constructing rich finding details. Use actual coverage surface labels and dispositions; report reviewed surfaces, explicit exclusions, deferred work, and unresolved questions honestly, and mark coverage `complete` only when the requested source scope was actually reviewed. Preserve every genuine finding, evidence item, user-supplied assumption, and unresolved proof gap in the caller's complete semantic result.
|
|
15
15
|
|
|
16
16
|
Keep discovery, validation, and attack-path reasoning within this one self-contained audit; do not invoke separate phase skills. Do not create ranking phases, per-file or per-candidate ledgers, separate phase worker pools, repeated phase reports, or receipt files.
|
|
17
17
|
|
|
@@ -118,7 +118,7 @@ Affected lines must include the root broken control or dangerous sink line when
|
|
|
118
118
|
Then render these subsections under each finding:
|
|
119
119
|
|
|
120
120
|
- `#### Summary`
|
|
121
|
-
-
|
|
121
|
+
- Start with how to reproduce the issue and what happens in the product, then explain why the code causes that behavior.
|
|
122
122
|
- Wrap code identifiers, RPC names, functions, types, fields, parameters, configuration keys, and literal values in single backticks.
|
|
123
123
|
- `#### Root Cause`
|
|
124
124
|
- State the violated security invariant and explain exactly how the implementation breaks it.
|
|
@@ -4,6 +4,9 @@ For every reportable finding in `findings.json`, preserve the validated reasonin
|
|
|
4
4
|
|
|
5
5
|
## Writing Rules
|
|
6
6
|
|
|
7
|
+
- Lead the title and `summary` with the user action and product impact.
|
|
8
|
+
- Use `attackPath.summary` to briefly explain how to reproduce the issue.
|
|
9
|
+
- Explain how the code causes that product behavior in `rootCause.summary`. Use plain language and avoid repetition.
|
|
7
10
|
- Wrap RPC names, functions, types, fields, parameters, configuration keys, literal identifiers, and short expressions in single backticks. For example: `environment/add`, `environmentId`, `execServerUrl`, and `EnvironmentManager::upsert_environment()`.
|
|
8
11
|
- Keep code out of prose. Put source snippets in `codeEvidence[].code`, then reference them from the section that explains why the snippet matters. The workspace consolidates those referenced snippets under **Root cause** so the violated invariant and its source proof stay together.
|
|
9
12
|
- Root cause must be a source-backed walkthrough, not a verdict paragraph. Start with the code where user-controlled data is declared, decoded, or read; follow each meaningful call, transformation, or state transition; then show the missing control, dangerous operation, and later consumer when it affects impact.
|
|
@@ -106,11 +109,7 @@ The following shape shows how to encode the `environment/add` reserved-environme
|
|
|
106
109
|
"validation": {
|
|
107
110
|
"method": "static source trace",
|
|
108
111
|
"summary": "The source trace confirms that an `environment/add` caller controls both inputs, the RPC forwards them unchanged, and runtime insertion accepts `local`.",
|
|
109
|
-
"evidenceRefs": [
|
|
110
|
-
"rpc-input",
|
|
111
|
-
"rpc-forward",
|
|
112
|
-
"runtime-upsert"
|
|
113
|
-
],
|
|
112
|
+
"evidenceRefs": ["rpc-input", "rpc-forward", "runtime-upsert"],
|
|
114
113
|
"assertions": [
|
|
115
114
|
"The runtime path lacks the reserved-ID check present during startup.",
|
|
116
115
|
"Inserting `local` replaces the existing `HashMap` entry."
|
|
@@ -139,11 +138,7 @@ The following shape shows how to encode the `environment/add` reserved-environme
|
|
|
139
138
|
"entrypoint": "experimental `environment/add` RPC",
|
|
140
139
|
"outcome": "future operations selected for `local` are routed to the remote executor"
|
|
141
140
|
},
|
|
142
|
-
"evidenceRefs": [
|
|
143
|
-
"rpc-forward",
|
|
144
|
-
"runtime-upsert",
|
|
145
|
-
"default-lookup"
|
|
146
|
-
],
|
|
141
|
+
"evidenceRefs": ["rpc-forward", "runtime-upsert", "default-lookup"],
|
|
147
142
|
"impact": {
|
|
148
143
|
"level": "medium",
|
|
149
144
|
"why": "Later commands and filesystem requests selected for `local` can be routed to the attacker-controlled remote executor."
|
|
@@ -20,7 +20,7 @@ The adapter:
|
|
|
20
20
|
|
|
21
21
|
Lifecycle, rich validation evidence, attack-path context, and coverage are lossy or omitted in SARIF. Preserve them in semantic JSON.
|
|
22
22
|
|
|
23
|
-
SARIF `executionSuccessful`
|
|
23
|
+
SARIF `executionSuccessful` reflects whether the scan reached a successful terminal status, not whether coverage is complete. Incomplete scans retain findings, set `codexSecurityCoverageCompleteness`, and include warnings. Integrations must read the coverage file referenced by `scan.coverageRef` before treating the results as exhaustive.
|
|
24
24
|
|
|
25
25
|
Automatic SARIF export during finalization is best-effort so projection errors cannot invalidate a canonical seal. Use the strict adapter entry point when a consumer requires SARIF and should surface export errors.
|
|
26
26
|
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://openai.com/codex-security/schemas/patch-risk-assessment.schema.json",
|
|
4
|
+
"title": "Patch risk assessment",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"patch",
|
|
10
|
+
"recommendation",
|
|
11
|
+
"workflowLabel",
|
|
12
|
+
"impact",
|
|
13
|
+
"regressionLikelihood",
|
|
14
|
+
"regressionProtection",
|
|
15
|
+
"recoverability",
|
|
16
|
+
"confidence",
|
|
17
|
+
"applicability",
|
|
18
|
+
"statusQuoRisk",
|
|
19
|
+
"autoMergeExclusions",
|
|
20
|
+
"affectedRuntimeRoots",
|
|
21
|
+
"materialBoundaries",
|
|
22
|
+
"validation",
|
|
23
|
+
"unknowns",
|
|
24
|
+
"evidencePlan"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"schemaVersion": {
|
|
28
|
+
"const": 1
|
|
29
|
+
},
|
|
30
|
+
"patch": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": [
|
|
34
|
+
"repository",
|
|
35
|
+
"sourceType",
|
|
36
|
+
"base",
|
|
37
|
+
"head",
|
|
38
|
+
"changedFiles",
|
|
39
|
+
"sha256"
|
|
40
|
+
],
|
|
41
|
+
"properties": {
|
|
42
|
+
"repository": {"$ref": "#/$defs/nonEmptyString"},
|
|
43
|
+
"sourceType": {
|
|
44
|
+
"enum": ["pull_request_diff", "patch_file", "commit_range"]
|
|
45
|
+
},
|
|
46
|
+
"base": {"$ref": "#/$defs/nonEmptyString"},
|
|
47
|
+
"head": {"$ref": "#/$defs/nonEmptyString"},
|
|
48
|
+
"changedFiles": {"$ref": "#/$defs/stringList"},
|
|
49
|
+
"sha256": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"recommendation": {"$ref": "#/$defs/recommendation"},
|
|
56
|
+
"workflowLabel": {
|
|
57
|
+
"enum": [
|
|
58
|
+
"auto_merge_candidate",
|
|
59
|
+
"human_review_required",
|
|
60
|
+
"revise",
|
|
61
|
+
"no_op",
|
|
62
|
+
"block",
|
|
63
|
+
"hold_for_evidence"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"impact": {"$ref": "#/$defs/riskRating"},
|
|
67
|
+
"regressionLikelihood": {"$ref": "#/$defs/riskRating"},
|
|
68
|
+
"regressionProtection": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": ["rating", "rationale", "exactHeadChecksPassed"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"rating": {"enum": ["strong", "partial", "none", "unknown"]},
|
|
74
|
+
"rationale": {"$ref": "#/$defs/nonEmptyString"},
|
|
75
|
+
"exactHeadChecksPassed": {"type": "boolean"}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"recoverability": {
|
|
79
|
+
"$ref": "#/$defs/recoveryRating"
|
|
80
|
+
},
|
|
81
|
+
"confidence": {
|
|
82
|
+
"$ref": "#/$defs/confidenceRating"
|
|
83
|
+
},
|
|
84
|
+
"applicability": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": ["status", "rationale"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"status": {
|
|
90
|
+
"enum": [
|
|
91
|
+
"confirmed",
|
|
92
|
+
"no_live_effect",
|
|
93
|
+
"wrong_owner",
|
|
94
|
+
"duplicate",
|
|
95
|
+
"superseded",
|
|
96
|
+
"unknown"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"rationale": {"$ref": "#/$defs/nonEmptyString"}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"statusQuoRisk": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": ["rating", "rationale"],
|
|
106
|
+
"properties": {
|
|
107
|
+
"rating": {"enum": ["low", "moderate", "high", "critical", "unknown"]},
|
|
108
|
+
"rationale": {"$ref": "#/$defs/nonEmptyString"}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"autoMergeExclusions": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": {
|
|
114
|
+
"enum": [
|
|
115
|
+
"privileged_boundary",
|
|
116
|
+
"migration",
|
|
117
|
+
"persistent_state",
|
|
118
|
+
"public_contract",
|
|
119
|
+
"architecture_specific_rollout",
|
|
120
|
+
"broad_shared_default",
|
|
121
|
+
"other"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"uniqueItems": true
|
|
125
|
+
},
|
|
126
|
+
"affectedRuntimeRoots": {"$ref": "#/$defs/stringList"},
|
|
127
|
+
"importantCallers": {"$ref": "#/$defs/stringList"},
|
|
128
|
+
"riskDrivers": {"$ref": "#/$defs/stringList"},
|
|
129
|
+
"protectiveFactors": {"$ref": "#/$defs/stringList"},
|
|
130
|
+
"materialBoundaries": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"required": [
|
|
136
|
+
"id",
|
|
137
|
+
"invariant",
|
|
138
|
+
"runtimeRoot",
|
|
139
|
+
"counterexample",
|
|
140
|
+
"legitimateControl",
|
|
141
|
+
"result"
|
|
142
|
+
],
|
|
143
|
+
"properties": {
|
|
144
|
+
"id": {"$ref": "#/$defs/identifier"},
|
|
145
|
+
"invariant": {"$ref": "#/$defs/nonEmptyString"},
|
|
146
|
+
"runtimeRoot": {"$ref": "#/$defs/nonEmptyString"},
|
|
147
|
+
"counterexample": {"$ref": "#/$defs/nonEmptyString"},
|
|
148
|
+
"legitimateControl": {"$ref": "#/$defs/nonEmptyString"},
|
|
149
|
+
"result": {"enum": ["supported", "contradicted", "unresolved"]}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"validation": {
|
|
154
|
+
"type": "array",
|
|
155
|
+
"minItems": 1,
|
|
156
|
+
"items": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"additionalProperties": false,
|
|
159
|
+
"required": ["name", "status", "protects"],
|
|
160
|
+
"properties": {
|
|
161
|
+
"name": {"$ref": "#/$defs/nonEmptyString"},
|
|
162
|
+
"status": {"enum": ["passed", "failed", "skipped", "unavailable"]},
|
|
163
|
+
"protects": {"$ref": "#/$defs/nonEmptyString"}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"unknowns": {
|
|
168
|
+
"type": "array",
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"additionalProperties": false,
|
|
172
|
+
"required": ["summary", "decisionCritical"],
|
|
173
|
+
"properties": {
|
|
174
|
+
"summary": {"$ref": "#/$defs/nonEmptyString"},
|
|
175
|
+
"decisionCritical": {"type": "boolean"}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"evidencePlan": {
|
|
180
|
+
"type": "array",
|
|
181
|
+
"maxItems": 3,
|
|
182
|
+
"items": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": ["question", "action", "outcomes"],
|
|
186
|
+
"properties": {
|
|
187
|
+
"question": {"$ref": "#/$defs/nonEmptyString"},
|
|
188
|
+
"action": {"$ref": "#/$defs/nonEmptyString"},
|
|
189
|
+
"outcomes": {
|
|
190
|
+
"type": "object",
|
|
191
|
+
"additionalProperties": {"$ref": "#/$defs/recommendation"},
|
|
192
|
+
"minProperties": 2
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"$defs": {
|
|
199
|
+
"nonEmptyString": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"minLength": 1
|
|
202
|
+
},
|
|
203
|
+
"identifier": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"pattern": "^[a-z0-9][a-z0-9_-]*$"
|
|
206
|
+
},
|
|
207
|
+
"stringList": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"items": {"$ref": "#/$defs/nonEmptyString"},
|
|
210
|
+
"uniqueItems": true
|
|
211
|
+
},
|
|
212
|
+
"recommendation": {
|
|
213
|
+
"enum": ["merge", "revise", "no_op", "block", "hold_for_evidence"]
|
|
214
|
+
},
|
|
215
|
+
"riskRating": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"additionalProperties": false,
|
|
218
|
+
"required": ["rating", "rationale"],
|
|
219
|
+
"properties": {
|
|
220
|
+
"rating": {"enum": ["low", "moderate", "high", "critical"]},
|
|
221
|
+
"rationale": {"$ref": "#/$defs/nonEmptyString"}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"recoveryRating": {
|
|
225
|
+
"type": "object",
|
|
226
|
+
"additionalProperties": false,
|
|
227
|
+
"required": ["rating", "rationale"],
|
|
228
|
+
"properties": {
|
|
229
|
+
"rating": {"enum": ["easy", "managed", "hard"]},
|
|
230
|
+
"rationale": {"$ref": "#/$defs/nonEmptyString"}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"confidenceRating": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"additionalProperties": false,
|
|
236
|
+
"required": ["rating", "rationale"],
|
|
237
|
+
"properties": {
|
|
238
|
+
"rating": {"enum": ["high", "moderate", "low"]},
|
|
239
|
+
"rationale": {"$ref": "#/$defs/nonEmptyString"}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -538,12 +538,7 @@ def resolve_multi_agent_context(
|
|
|
538
538
|
effective_config=effective_config,
|
|
539
539
|
config_profile=config_profile,
|
|
540
540
|
)
|
|
541
|
-
if
|
|
542
|
-
owner != "codex-bridge"
|
|
543
|
-
and ((feature_found and enabled) or (owner == "native" and version == "v2"))
|
|
544
|
-
and agent_threads_found
|
|
545
|
-
and (validate_multi_agent_config or runtime_facts_supplied)
|
|
546
|
-
):
|
|
541
|
+
if owner != "codex-bridge" and feature_found and enabled and agent_threads_found:
|
|
547
542
|
raise ValueError("agents.max_threads cannot be set when multi_agent_v2 is enabled")
|
|
548
543
|
|
|
549
544
|
if version == "v1":
|
|
@@ -806,8 +801,7 @@ def profile_requires_multi_agent_config(
|
|
|
806
801
|
return True
|
|
807
802
|
remediation = profile.get("remediation", {})
|
|
808
803
|
return bool(remediation.get("variants")) or any(
|
|
809
|
-
is_runtime_path(patch.get("path"))
|
|
810
|
-
for patch in remediation.get("patches", [])
|
|
804
|
+
is_runtime_path(patch.get("path")) for patch in remediation.get("patches", [])
|
|
811
805
|
)
|
|
812
806
|
|
|
813
807
|
|