OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security
TypeScript ai-securityapplication-securityclicode-scanningcodexcodex-securitycybersecuritydevsecopsnodejsnpmopenaisdksecuritytypescriptvulnerability-scanning
fix(cli): add Cyber pricing and hide unavailable costs (#1336)
ianw-oai3aa071c83287
diff --git a/sdk/typescript/src/cost-model.ts b/sdk/typescript/src/cost-model.tsindex 20fc85077..dd0506d78 100644--- a/sdk/typescript/src/cost-model.ts+++ b/sdk/typescript/src/cost-model.ts@@ -96,6 +96,7 @@ const MODEL_PRICING_NANODOLLARS: Readonly<Record<string, ModelPricing>> = {"gpt-5.6-terra": [2_000, 200, 2_500, 12_000],"gpt-5.6-luna": [200, 20, 250, 1_200],// https://developers.openai.com/api/docs/pricing#cyber-models+ "gpt-5.6-cyber": [12_500, 1_250, 15_625, 75_000],"gpt-daybreak-blue-latest": [4_000, 400, 5_000, 20_000],"gpt-daybreak-red-latest": [12_500, 1_250, 15_625, 75_000],};@@ -247,9 +248,11 @@ export function estimateScanCost(: "https://developers.openai.com/api/docs/pricing",asOf: bedrockPricing? bedrockPricing.asOf- : pricingModel === "gpt-6.1-sol" || pricingModel === "gpt-6-luna"- ? "2026-09-30"- : "2026-09-14",+ : pricingModel === "gpt-5.6-cyber"+ ? "2026-10-06"+ : pricingModel === "gpt-6.1-sol" || pricingModel === "gpt-6-luna"+ ? "2026-09-30"+ : "2026-09-14",serviceTier: "standard",context: "short",usdPerMillionTokens: usdPerMillionTokens(pricing, unitsPerUsd),diff --git a/sdk/typescript/src/scan-dashboard.ts b/sdk/typescript/src/scan-dashboard.tsindex b6edbf7ef..b14281cb4 100644--- a/sdk/typescript/src/scan-dashboard.ts+++ b/sdk/typescript/src/scan-dashboard.ts@@ -839,15 +839,20 @@ export class ScanDashboard {#costLines(): string[] {if (!this.#showCost) return [];+ if (+ this.#cost === null &&+ this.#options.maxCostUsd === undefined &&+ estimateScanCost(this.#options.model?.model, {+ input_tokens: 0,+ output_tokens: 0,+ }) === null+ ) {+ return [];+ }const cost =this.#cost === null? this.#options.maxCostUsd === undefined- ? estimateScanCost(this.#options.model?.model, {- input_tokens: 0,- output_tokens: 0,- }) === null- ? "unavailable (model pricing missing)"- : "waiting for usage"+ ? "waiting for usage": `— / ${formatUsd(this.#options.maxCostUsd)}`: `${formatScanCost(this.#cost)}${this.#options.maxCostUsd === undefined ? "" : `; short-context budget baseline: ${formatUsd(this.#cost.estimatedUsd)} / ${formatUsd(this.#options.maxCostUsd)} · ${budgetBar(this.#cost.estimatedUsd, this.#options.maxCostUsd)}`}`;return wrapActivity(" COST ", cost, this.#width());diff --git a/sdk/typescript/tests-ts/api.test.ts b/sdk/typescript/tests-ts/api.test.tsindex cb143e3b8..59ea106da 100644--- a/sdk/typescript/tests-ts/api.test.ts+++ b/sdk/typescript/tests-ts/api.test.ts@@ -3879,6 +3879,7 @@ describe("CodexSecurity orchestration", () => {"gpt-5.5","gpt-6-astra","gpt-5.6-terra",+ "gpt-5.6-cyber","gpt-daybreak-blue-latest","gpt-daybreak-red-latest",];diff --git a/sdk/typescript/tests-ts/cost-context.test.ts b/sdk/typescript/tests-ts/cost-context.test.tsindex d146df0b0..6d0346367 100644--- a/sdk/typescript/tests-ts/cost-context.test.ts+++ b/sdk/typescript/tests-ts/cost-context.test.ts@@ -74,6 +74,33 @@ test("prices the exact Bedrock Daybreak Blue ID with AWS short and long contextexpect(estimateScanCost("gpt-daybreak-blue-5.6-sol", usage)).toBeNull();});+test("prices the exact OpenAI Cyber ID without inventing long-context rates", () => {+ const cost = estimateScanCost("gpt-5.6-cyber", {+ input_tokens: 1_000_000,+ cached_input_tokens: 200_000,+ cache_write_input_tokens: 300_000,+ output_tokens: 100_000,+ })!;+ expect(cost).toMatchObject({+ model: "gpt-5.6-cyber",+ estimatedUsd: 18.6875,+ estimatedUsdRange: { min: 18.6875, max: null, context: "unknown" },+ pricing: {+ source: "https://developers.openai.com/api/docs/pricing",+ asOf: "2026-10-06",+ serviceTier: "standard",+ context: "short",+ usdPerMillionTokens: {+ input: 12.5,+ cacheRead: 1.25,+ cacheWrite: 15.625,+ output: 75,+ },+ },+ });+ expect(cost.pricing).not.toHaveProperty("longContextUsdPerMillionTokens");+});+test("prices the exact Bedrock Daybreak Red ID without inventing long-context rates", () => {const usage = {input_tokens: 1_000_000,@@ -101,7 +128,6 @@ test("prices the exact Bedrock Daybreak Red ID without inventing long-context ra},});expect(cost.pricing).not.toHaveProperty("longContextUsdPerMillionTokens");- expect(estimateScanCost("gpt-5.6-cyber", usage)).toBeNull();});test.each([1, 3])(diff --git a/sdk/typescript/tests-ts/scan-dashboard.test.ts b/sdk/typescript/tests-ts/scan-dashboard.test.tsindex eb6dccf67..d8c756630 100644--- a/sdk/typescript/tests-ts/scan-dashboard.test.ts+++ b/sdk/typescript/tests-ts/scan-dashboard.test.ts@@ -53,6 +53,23 @@ class DashboardTestInput extends EventEmitter {}describe("live scan dashboard", () => {+ test.each([+ ["unknown-model", false],+ ["gpt-5.6-cyber", true],+ ] as const)("shows a cost row only when %s has pricing", (model, priced) => {+ const stderr = capture(true);+ const dashboard = createDashboard(stderr.stream, {+ model: { model, reasoningEffort: "xhigh" },+ showCost: true,+ });+ dashboard.start();+ const frame = lastFrame(stderr);+ expect(/^\s*COST\b/m.test(frame)).toBe(priced);+ if (priced) expect(frame).toMatch(/COST\s+waiting for usage/);+ expect(frame).not.toContain("model pricing missing");+ dashboard.stop();+ });+test("keeps cost bounds and assumptions readable on a narrow terminal", () => {const stderr = capture(true);const dashboard = createDashboard(