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(plugin): keep unavailable Daybreak advisories quiet (#878)

Soyeon Park11f4c015980c
diff --git a/plugins/codex-security/mcp-app/server.ts b/plugins/codex-security/mcp-app/server.ts
index 52367ccff..8ae80712c 100644
--- a/plugins/codex-security/mcp-app/server.ts
+++ b/plugins/codex-security/mcp-app/server.ts
@@ -428,9 +428,9 @@ export function createCodexSecurityServer(): McpServer {
stale: snapshot.stale,
...(snapshot.enrollmentUrl ? { enrollmentUrl: snapshot.enrollmentUrl } : {})
};
- const warning = access.status === "granted"
- ? ""
- : " This check is advisory: a scan may run, but protected results may not be displayable.";
+ const warning = access.status === "not_granted"
+ ? " This check is advisory: a scan may run, but protected results may not be displayable."
+ : "";
return {
content: [{
type: "text" as const,
diff --git a/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs b/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
index 5cdaef7cd..35cb053d1 100644
--- a/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
@@ -1130,6 +1130,7 @@ try {
Date.parse(unknownTrustedAccess.result.structuredContent.checkedAt),
),
);
+ assert.doesNotMatch(unknownTrustedAccess.result.content[0].text, /protected results may not be displayable/);
const grantedTrustedAccess = {
schemaVersion: 1,
@@ -1225,7 +1226,7 @@ try {
checkedAt: grantedTrustedAccess.checkedAt,
stale: true,
});
- assert.match(staleGrantedAccess.result.content[0].text, /protected results may not be displayable/);
+ assert.doesNotMatch(staleGrantedAccess.result.content[0].text, /protected results may not be displayable/);
const untrustedReplay = await requestAndWait(9603, "tools/call", {
name: "get_codex_security_daybreak_access",
@@ -1271,6 +1272,7 @@ try {
},
);
assert.doesNotMatch(JSON.stringify(refreshedTrustedAccess.result), /\btac(?:[123])?\b/i);
+ assert.match(refreshedTrustedAccess.result.content[0].text, /protected results may not be displayable/);
const timestampedTrustedAccess = await requestAndWait(9608, "tools/call", {
name: "get_codex_security_daybreak_access",
diff --git a/plugins/codex-security/references/config-preflight.md b/plugins/codex-security/references/config-preflight.md
index c1d5dde3b..3147bc2a7 100644
--- a/plugins/codex-security/references/config-preflight.md
+++ b/plugins/codex-security/references/config-preflight.md
@@ -88,4 +88,8 @@ Codex CLI and other hosts use the same prompt-based preflight before substantive
## Daybreak Access Advisory
-After capability preflight is `ready` and immediately before the workflow's first substantive scan action, call the plugin's `get_codex_security_daybreak_access` tool exactly once when available as the automatic pre-scan advisory. ChatGPT-authenticated desktop and CLI sessions both support this advisory; API-key-only sessions cannot verify account access. For Deep Security Scan, make this call immediately before `start_codex_security_deep_scan`. If this scan already performed the automatic advisory in an earlier continuation, reuse that result instead of calling it again. Report its exact `status` and available Daybreak programs. When `status` is `not_granted`, before any other scan-start progress, present a separate, prominent warning that Daybreak access is not granted for this account and protected scan outputs may not be displayable. Include the returned `enrollmentUrl` as a clickable application link; if that field is absent, use `https://chatgpt.com/cyber`. Do not bury this warning in a routine status summary. When `status` is `unknown`, `stale` is `true`, or the tool is unavailable or fails, instead warn that Daybreak access could not be verified and protected scan outputs may not be displayable. Then continue regardless. This result is advisory and must never authorize or gate the scan. Do not poll it or repeat it between scan phases. If the user explicitly asks to re-check after an account or Daybreak access change, call the tool again when available for a fresh result; this user-requested refresh is the only repeat.
+After capability preflight is `ready` and immediately before the workflow's first substantive scan action, call the plugin's `get_codex_security_daybreak_access` tool once only if it is available in the current session. If the tool is unavailable, skip the advisory silently: do not attempt a call, probe for it, or use a replacement access tool or connector. ChatGPT-authenticated desktop and CLI sessions support this advisory; skip it silently in known API-key-only sessions, which cannot verify account access. For Deep Security Scan, make the call immediately before `start_codex_security_deep_scan`. Reuse an existing result when continuing the same scan.
+
+If the call fails, returns `status: "unknown"`, or returns `stale: true`, continue silently. Do not expose the unavailable check, unknown status, empty program list, or a speculative protected-output warning in progress messages or the final response. For a fresh `granted` result, report the exact status and available Daybreak programs. For a fresh `not_granted` result, before any other scan-start progress, present a separate, prominent warning that Daybreak access is not granted for this account and protected scan outputs may not be displayable. Include the returned `enrollmentUrl` as a clickable application link, falling back to `https://chatgpt.com/cyber` when absent.
+
+Continue regardless: this advisory never authorizes or gates the scan. Do not retry, poll, or repeat it between phases. If the user explicitly asks about Daybreak access, report the result or explain that it could not be verified; an unavailable or unknown result does not establish that access is denied. Recheck only when the user explicitly requests a fresh result after an account or Daybreak access change, and only when the tool is available.
diff --git a/plugins/codex-security/skills/deep-security-scan/SKILL.md b/plugins/codex-security/skills/deep-security-scan/SKILL.md
index d9f8e9e10..a6112ac36 100644
--- a/plugins/codex-security/skills/deep-security-scan/SKILL.md
+++ b/plugins/codex-security/skills/deep-security-scan/SKILL.md
@@ -39,7 +39,11 @@ After preserving any native continuation's scan context and applying its one-tim
## Daybreak Access Advisory
-Immediately before the first `start_codex_security_deep_scan` call, the top-level parent calls the plugin's `get_codex_security_daybreak_access` tool once when available; workers never perform this advisory. ChatGPT-authenticated desktop and CLI sessions both support this advisory; API-key-only sessions cannot verify account access. Reuse an existing result when continuing the same scan. Report the exact `status` and available Daybreak programs. If `status` is `not_granted`, prominently warn before scan-start progress that Daybreak access is not granted and protected outputs may not be displayable, and include the returned `enrollmentUrl` as a clickable application link, falling back to `https://chatgpt.com/cyber` when it is absent. If `status` is `unknown`, `stale` is `true`, or the tool is unavailable or fails, warn that access could not be verified and protected outputs may not be displayable. Then continue regardless: the advisory never authorizes, gates, or becomes a capability preflight for the scan. Do not poll or repeat it between phases; recheck only when the user explicitly requests a fresh result after an account or Daybreak access change.
+Immediately before the first `start_codex_security_deep_scan` call, the top-level parent calls the plugin's `get_codex_security_daybreak_access` tool once only if it is available in the current session; workers never perform this advisory. If the tool is unavailable, skip the advisory silently: do not attempt a call, probe for it, or use a replacement access tool or connector. ChatGPT-authenticated desktop and CLI sessions support this advisory; skip it silently in known API-key-only sessions, which cannot verify account access. Reuse an existing result when continuing the same scan.
+
+If the call fails, returns `status: "unknown"`, or returns `stale: true`, continue silently. Do not expose the unavailable check, unknown status, empty program list, or a speculative protected-output warning in progress messages or the final response. For a fresh `granted` result, report the exact status and available Daybreak programs. For a fresh `not_granted` result, prominently warn before scan-start progress that Daybreak access is not granted and protected outputs may not be displayable, and include the returned `enrollmentUrl` as a clickable application link, falling back to `https://chatgpt.com/cyber` when absent.
+
+Continue regardless: the advisory never authorizes, gates, or becomes a capability preflight for the scan. Do not retry, poll, or repeat it between phases. If the user explicitly asks about Daybreak access, report the result or explain that it could not be verified; an unavailable or unknown result does not establish that access is denied. Recheck only when the user explicitly requests a fresh result after an account or Daybreak access change, and only when the tool is available.
## Run Independent Standard Scans