Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(sdk): preserve Deep Scan coordinator artifacts (#459)

Dane Schneider204b5e184644
diff --git a/sdk/typescript/src/api.ts b/sdk/typescript/src/api.ts
index 3173ce202..fd60107e5 100644
--- a/sdk/typescript/src/api.ts
+++ b/sdk/typescript/src/api.ts
@@ -2454,9 +2454,13 @@ function scanPrompt(
? [
"Write the complete canonical scan-manifest.json, findings.json, and coverage.json, but do not finalize or seal them; the SDK workbench owns authoritative metadata, finalization, report generation, and sealing.",
]
- : [
- "Use record_codex_security_scan_draft and complete_codex_security_scan as directed by the selected skill; the workbench owns authoritative metadata, finalization, report generation, and sealing.",
- ]),
+ : skillName === "deep-security-scan"
+ ? [
+ "The Deep Scan coordinator already wrote the canonical scan artifacts. Call complete_codex_security_scan exactly once without submitting another semantic draft; the workbench owns authoritative metadata, finalization, report generation, and sealing.",
+ ]
+ : [
+ "Use record_codex_security_scan_draft and complete_codex_security_scan as directed by the selected skill; the workbench owns authoritative metadata, finalization, report generation, and sealing.",
+ ]),
...(additionalPrompt?.trim()
? ["Additional scan instructions:", additionalPrompt]
: []),
diff --git a/sdk/typescript/tests-ts/api.test.ts b/sdk/typescript/tests-ts/api.test.ts
index a400e9b3d..a8d6233c0 100644
--- a/sdk/typescript/tests-ts/api.test.ts
+++ b/sdk/typescript/tests-ts/api.test.ts
@@ -5187,6 +5187,7 @@ describe("CodexSecurity orchestration", () => {
`Scan target: Git diff from ${revision} to ${revision}.`,
);
expect(prompt).toContain("$codex-security:security-diff-scan");
+ expect(prompt).toContain("record_codex_security_scan_draft");
expect(prompt).toContain("complete_codex_security_scan");
expect(prompt).not.toContain("do not finalize or seal them");
expect(prompt).toContain(
@@ -5199,6 +5200,7 @@ describe("CodexSecurity orchestration", () => {
"prompt captured",
);
expect(prompt).toContain("$codex-security:deep-security-scan");
+ expect(prompt).not.toContain("record_codex_security_scan_draft");
expect(prompt).toContain("complete_codex_security_scan");
expect(prompt).not.toContain("do not finalize or seal them");
expect(prompt).toContain(