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

docs(providers): clarify API-key model and access-program selection (#1037)

Michael D'Angelod0c92d56195d
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.ts
index a8f58d8b0..5e4e0837e 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
@@ -1220,6 +1220,7 @@ env_key = "CODEX_API_KEY"
`CAPTURE_SYNTHETIC_OPENAI_AUTH\n${virtualenv === undefined ? "" : "CAPTURE_SYNTHETIC_PYTHON\n"}`,
);
const executor = new CodexSdkWorkerExecutor({
+ model: "gpt-daybreak-blue-latest",
parentSandbox: trustedParentSandbox,
});
for (const kind of ["discovery", "dedup"] as const) {
@@ -1242,6 +1243,11 @@ env_key = "CODEX_API_KEY"
runtimeEnvironment.LD_LIBRARY_PATH,
);
assert.equal(invocation.codexHome, fixture.root);
+ assertFlagPair(
+ invocation.argv,
+ "--model",
+ "gpt-daybreak-blue-latest",
+ );
assert.deepEqual(invocation.runtimeEnvironment, runtimeEnvironment);
if (virtualenv !== undefined) {
assert.equal(invocation.pythonPrefix, virtualenv);
@@ -1253,6 +1259,7 @@ env_key = "CODEX_API_KEY"
for (const [name, value] of Object.entries(runtimeEnvironment)) {
assert.equal(process.env[name], value);
}
+
assert.equal(
invocation.openaiAuthentication.CODEX_API_KEY,
entry.expected,
diff --git a/sdk/typescript/docs/cli.md b/sdk/typescript/docs/cli.md
index c11e715fd..5c44ccfd0 100644
--- a/sdk/typescript/docs/cli.md
+++ b/sdk/typescript/docs/cli.md
@@ -98,6 +98,33 @@ changed; otherwise run `logout`, then `login`.
Some cybersecurity requests and protected findings require
[Trusted Access for Cyber](https://chatgpt.com/cyber).
+### Daybreak Blue with an API key
+
+The [Responses API defaults](https://developers.openai.com/api/docs/guides/daybreak#understand-defaults-when-omitted)
+can apply Daybreak Blue to compatible mainline models when the API organization
+and project have access. An omitted `access_programs.cyber` field does not by
+itself mean that Daybreak treatment is disabled.
+
+Choose a compatible model available to your project and select Daybreak Blue
+explicitly:
+
+```bash
+codex-security scan /path/to/repository \
+ --auth api-key --model "<model>" --cyber-access-program daybreak_blue
+```
+
+In the SDK, select your model through `codexOverrides.model` and pass
+`auth: "api-key"` and `cyberAccessProgram: "daybreak_blue"` in the scan options.
+Use `--mode deep` in the CLI or `mode: "deep"` in SDK scan options for Deep Scan.
+The selection reaches discovery and reducer workers, including resumed workers. See [Select a Cyber access program](#select-a-cyber-access-program)
+for configuration precedence and the API-key feature setting.
+
+The previously documented `gpt-daybreak-blue-latest` alias is
+[deprecated](https://developers.openai.com/api/docs/models/gpt-daybreak-blue-latest).
+Use a current model available to your project. `access_programs.cyber` is a
+Responses API field; use the supported selector instead of passing it as a
+`--codex` configuration key.
+
### Select a Cyber access program
For the built-in OpenAI provider, choose `standard`, `daybreak_blue`, or
diff --git a/sdk/typescript/tests-ts/api-attribution-concurrency.test.ts b/sdk/typescript/tests-ts/api-attribution-concurrency.test.ts
index dfbce95a2..dc9f5e414 100644
--- a/sdk/typescript/tests-ts/api-attribution-concurrency.test.ts
+++ b/sdk/typescript/tests-ts/api-attribution-concurrency.test.ts
@@ -18,16 +18,19 @@ afterEach(fixtures.cleanup);
describe("delegated scan attribution", () => {
test.each([
- ["standard", true, "root"],
- ["deep", true, "profile-override"],
- ["standard", false, "unset"],
- ["deep", false, "profile-only"],
- ["deep", true, "root"],
- ["deep", true, "profile-fallback"],
- ["deep", true, "unset"],
+ ["standard", true, false, "root"],
+ ["deep", true, false, "profile-override"],
+ ["standard", false, false, "unset"],
+ ["deep", false, false, "profile-only"],
+ ["deep", true, false, "root"],
+ ["deep", true, false, "profile-fallback"],
+ ["deep", true, false, "unset"],
+ ["standard", true, false, "unset"],
+ ["standard", false, true, "unset"],
+ ["deep", false, true, "unset"],
] as const)(
- "keeps overlapping CLI and SDK %s scans attributed with Cyber selection %p and %s endpoint",
- async (mode, selectProgram, endpointSource) => {
+ "keeps overlapping CLI and SDK %s scans attributed with Cyber selection %p, explicit models %p and %s endpoint",
+ async (mode, selectProgram, selectModel, endpointSource) => {
const root = await fixtures.temporaryDirectory();
const repository = join(root, "repository");
const ambientHome = join(root, "ambient-home");
@@ -45,6 +48,11 @@ describe("delegated scan attribution", () => {
const clients = await Promise.all(
(["cli", "sdk"] as const).map(async (surface) => {
+ const model = selectModel
+ ? surface === "cli"
+ ? "gpt-daybreak-blue-latest"
+ : "gpt-5.6-sol"
+ : undefined;
const program = surface === "cli" ? programs[0] : programs[1];
const endpoint =
endpointSource === "unset"
@@ -110,6 +118,7 @@ describe("delegated scan attribution", () => {
}
: {}),
...(surface === "sdk" ? { features } : {}),
+ ...(model === undefined ? {} : { model }),
},
},
{
@@ -128,8 +137,14 @@ describe("delegated scan attribution", () => {
runWorkbench: async (
_options: unknown,
args: readonly string[],
+ input?: string,
) => {
if (args[0] === "register-cli-scan") {
+ if (model !== undefined) {
+ expect(JSON.parse(input!).recipe).toMatchObject({
+ config: { model },
+ });
+ }
return {
scanId: `scan_${surface}`,
targetId: `target_${surface}`,
@@ -186,6 +201,7 @@ describe("delegated scan attribution", () => {
);
expect(options.config).toMatchObject({
features,
+ ...(model === undefined ? {} : { model }),
analytics: { enabled: surface === "sdk" },
responses_api_metadata: {
custom_attribution: surface,
@@ -210,6 +226,11 @@ describe("delegated scan attribution", () => {
});
}
expect(threadOptions.threadSource).toBe("security_scan");
+ if (model !== undefined) {
+ expect(
+ threadOptions.model ?? options.config?.["model"],
+ ).toBe(model);
+ }
const configPath =
options.env?.["CODEX_SECURITY_CONFIG_PATH"];
expect(configPath).toBeString();
@@ -235,7 +256,10 @@ describe("delegated scan attribution", () => {
endpoint,
);
}
- expect(runtimeConfig).toMatchObject({ features });
+ expect(runtimeConfig).toMatchObject({
+ features,
+ ...(model === undefined ? {} : { model }),
+ });
expect(initialConfig).not.toContain("openai_base_url");
expect(initialConfig).not.toContain("synthetic-password");
if (program === undefined) {
@@ -262,6 +286,7 @@ describe("delegated scan attribution", () => {
expect(sharedConfig).not.toHaveProperty(
"responses_api_metadata",
);
+ expect(sharedConfig).not.toHaveProperty("model");
expect(sharedConfig).not.toHaveProperty("codex_security");
expect(sharedConfig).not.toHaveProperty("analytics");
expect(JSON.stringify(sharedConfig)).not.toContain(
@@ -305,6 +330,18 @@ describe("delegated scan attribution", () => {
);
try {
+ if (selectModel) {
+ await Promise.all(
+ clients.map(async (client, index) => {
+ expect(
+ await client.preflight(repository, { mode }),
+ ).toMatchObject({
+ model: index === 0 ? "gpt-daybreak-blue-latest" : "gpt-5.6-sol",
+ authentication: { method: "api_key", verified: false },
+ });
+ }),
+ );
+ }
const results = await Promise.allSettled(
clients.map((client, index) =>
client