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: preserve Deep Scan worker context limits (#1417)
mldangelo-oaiacb8eac250b7
diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.ts b/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.tsindex 1de08a563..4d5afafe5 100644--- a/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.ts+++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.ts@@ -1440,6 +1440,9 @@ env_key = "SYNTHETIC_GATEWAY_KEY"`,serviceTier,instructionsFile,verbosity,+ modelContextWindow: index === 0 ? undefined : 32_000 * (index + 1),+ autoCompactTokenLimit:+ index === 0 ? undefined : 24_000 * (index + 1),windowsSandbox,webSearch,features,@@ -1479,6 +1482,9 @@ env_key = "SYNTHETIC_GATEWAY_KEY"`,: {model_instructions_file: entry.instructionsFile,model_verbosity: entry.verbosity,+ model_context_window: entry.modelContextWindow,+ model_auto_compact_token_limit:+ entry.autoCompactTokenLimit,web_search: entry.webSearch,model_provider: entry.provider,native_profile: entry.nativeProfile,@@ -1661,6 +1667,10 @@ env_key = "SYNTHETIC_GATEWAY_KEY"`,model_instructions_file:workerConfigurations[index].instructionsFile,model_verbosity: workerConfigurations[index].verbosity,+ model_context_window:+ workerConfigurations[index].modelContextWindow,+ model_auto_compact_token_limit:+ workerConfigurations[index].autoCompactTokenLimit,web_search: workerConfigurations[index].webSearch,"windows.sandbox": workerConfigurations[index].windowsSandbox,});@@ -1800,6 +1810,9 @@ env_key = "SYNTHETIC_GATEWAY_KEY"`,assertConfigOverrides(preflight.argv, {model_instructions_file: selectedProvider.instructionsFile,model_verbosity: selectedProvider.verbosity,+ model_context_window: selectedProvider.modelContextWindow,+ model_auto_compact_token_limit:+ selectedProvider.autoCompactTokenLimit,web_search: selectedProvider.webSearch,"windows.sandbox": selectedProvider.windowsSandbox,});@@ -1879,7 +1892,7 @@ env_key = "SYNTHETIC_GATEWAY_KEY"`,),writeFile(entry.deepPath,- '[worker_runtime.features]\nshell_tool = true\nunified_exec = true\nview_image = true\n[worker_runtime]\nweb_search = "live"\nmodel_provider = "changed"\nnative_profile = "changed"\nmodel_instructions_file = "changed-instructions.md"\nmodel_verbosity = "changed"\n[worker_runtime.windows]\nsandbox = "changed"\n[worker_runtime.environment]\nSYNTHETIC_GATEWAY_KEY = "changed"\nSYNTHETIC_HEADER_VALUE = "changed"\n',+ '[worker_runtime.features]\nshell_tool = true\nunified_exec = true\nview_image = true\n[worker_runtime]\nweb_search = "live"\nmodel_provider = "changed"\nnative_profile = "changed"\nmodel_instructions_file = "changed-instructions.md"\nmodel_verbosity = "changed"\nmodel_context_window = 999000\nmodel_auto_compact_token_limit = 888000\n[worker_runtime.windows]\nsandbox = "changed"\n[worker_runtime.environment]\nSYNTHETIC_GATEWAY_KEY = "changed"\nSYNTHETIC_HEADER_VALUE = "changed"\n',),]),),diff --git a/sdk/typescript/src/api.ts b/sdk/typescript/src/api.tsindex 35ee2413f..a08a97d22 100644--- a/sdk/typescript/src/api.ts+++ b/sdk/typescript/src/api.ts@@ -4895,6 +4895,8 @@ function selectedWorkerRuntimeConfig(...Object.fromEntries(["features",+ "model_auto_compact_token_limit",+ "model_context_window","model_instructions_file","model_verbosity","web_search",diff --git a/sdk/typescript/tests-ts/api.test.ts b/sdk/typescript/tests-ts/api.test.tsindex f117a9a28..027df380b 100644--- a/sdk/typescript/tests-ts/api.test.ts+++ b/sdk/typescript/tests-ts/api.test.ts@@ -1635,6 +1635,8 @@ describe("CodexSecurity orchestration", () => {{model_reasoning_summary: "auto",service_tier: "flex",+ model_context_window: 64_000,+ model_auto_compact_token_limit: 48_000,windows: { sandbox: "unelevated" },},"auto",@@ -1643,10 +1645,14 @@ describe("CodexSecurity orchestration", () => {[{profile: "cloud",+ model_context_window: 64_000,+ model_auto_compact_token_limit: 48_000,profiles: {cloud: {model_reasoning_summary: "concise",service_tier: "fast",+ model_context_window: 96_000,+ model_auto_compact_token_limit: 72_000,windows: { sandbox: "elevated" },},},@@ -1657,6 +1663,8 @@ describe("CodexSecurity orchestration", () => {[{profile: "cloud.production",+ model_context_window: 128_000,+ model_auto_compact_token_limit: 96_000,windows: { sandbox: "elevated" },profiles: {"cloud.production": {@@ -1664,6 +1672,7 @@ describe("CodexSecurity orchestration", () => {service_tier: "fast",model_instructions_file: "profile-instructions.md",model_verbosity: "high",+ model_auto_compact_token_limit: 112_000,windows: { sandbox: "unelevated" },},},@@ -1748,6 +1757,15 @@ describe("CodexSecurity orchestration", () => {windows,);expect(options.config?.["windows"]).toEqual(windows);+ for (const key of [+ "model_context_window",+ "model_auto_compact_token_limit",+ ]) {+ const value = resolveCodexProfile(overrides)[key] as+ number | undefined;+ expect(options.config?.[key]).toBe(value);+ expect(workerConfig[key]).toBe(value);+ }expect(workerConfig["model_verbosity"]).toBe(resolveCodexProfile(overrides)["model_verbosity"],);