@@ -86,11 +86,36 @@ Check or remove the stored sign-in with `npx codex-security login status` and
8686sign-in. If Codex stores credentials in the system keyring, run
8787` npx codex-security login ` once before scanning.
8888
89- An environment API key takes precedence over a stored sign-in. Unset both
90- ` OPENAI_API_KEY ` and ` CODEX_API_KEY ` to use your ChatGPT sign-in. When an
91- environment key is configured, ` codex-security login status ` identifies the
92- effective credential source without printing its value, including when no
93- stored sign-in exists.
89+ An environment API key takes precedence over a stored sign-in by default.
90+ When both a stored ChatGPT sign-in and an environment API key are available, an
91+ interactive scan asks which credential to use. JSON output, dry runs, CI, and
92+ other noninteractive scans never prompt and retain automatic API-key
93+ precedence. Select the credential source explicitly with ` --auth ` :
94+
95+ ``` bash
96+ npx codex-security scan . --auth chatgpt
97+ npx codex-security scan . --auth api-key
98+ ```
99+
100+ ` --auth chatgpt ` uses the stored sign-in and ignores ` OPENAI_API_KEY ` and
101+ ` CODEX_API_KEY ` . ` --auth api-key ` requires one of those environment variables.
102+ Omit ` --auth ` , or pass ` --auth auto ` , to preserve automatic API-key precedence
103+ for existing CI and unattended scans. The SDK accepts the same selection as
104+ ` security.run(repository, { auth: "chatgpt" }) ` and
105+ ` security.preflight(repository, { auth: "chatgpt" }) ` .
106+
107+ To make the stored ChatGPT sign-in the automatic default instead, unset any
108+ configured API-key variables:
109+
110+ ``` bash
111+ unset OPENAI_API_KEY CODEX_API_KEY
112+ ```
113+
114+ The interactive choice applies only to the current scan and is not persisted.
115+
116+ When an environment key is configured, ChatGPT login and
117+ ` codex-security login status ` identify the effective scan credential source
118+ without printing its value, including when no stored sign-in exists.
94119
95120## CLI
96121
@@ -216,6 +241,14 @@ Scan history uses the existing Codex Security workbench database at
216241` CODEX_SECURITY_STATE_DIR ` to place the database elsewhere. Scan credentials
217242are never stored in the scan configuration.
218243
244+ The scan sandbox permits writes to the selected state directory so SQLite can
245+ maintain its database and journal files. If the host itself cannot write to the
246+ default directory, select a writable directory outside the scanned repository:
247+
248+ ``` bash
249+ export CODEX_SECURITY_STATE_DIR=/path/to/writable/codex-security-state
250+ ```
251+
219252` scans rerun SCAN_ID ` repeats the original configuration against the current
220253checkout so a fixed vulnerability can be checked again.
221254
@@ -291,10 +324,11 @@ method and, for an environment API key, its variable name. Authentication and
291324model access remain unverified until a real scan starts.
292325
293326Scan progress identifies the selected credential source before Codex starts.
294- Interactive terminals also show how to retry with ChatGPT when an environment
295- API key overrides the stored sign-in. Progress remains on stderr so JSON output
296- stays machine readable. Recoverable failures include safe retry causes and,
297- when available, the server-provided retry delay.
327+ Terminals and noninteractive CI logs also show how to retry with
328+ ` --auth chatgpt ` when an environment API key overrides the stored sign-in.
329+ Progress remains on stderr so JSON output stays machine readable. Network
330+ failures and rate limits remain retryable; definitive authentication and model
331+ authorization failures stop immediately.
298332
299333## Documentation and security
300334
0 commit comments