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