Skip to content

Commit dd74cdb

Browse files
fix: support managed Codex credential keyrings (#101)
* fix: support managed Codex credential keyrings * fix: address managed keyring review feedback * fix: preserve stored credentials during ambient import * fix: secure Windows credentials without PowerShell modules
1 parent 4357b1e commit dd74cdb

12 files changed

Lines changed: 2125 additions & 152 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ npx @openai/codex-security scan .
1717
npx @openai/codex-security scan . --model gpt-5.6-terra --effort high
1818
```
1919

20-
For CI, set `OPENAI_API_KEY` or `CODEX_API_KEY` instead of signing in.
20+
For CI, set `OPENAI_API_KEY` or `CODEX_API_KEY` instead of signing in. Environment API keys are
21+
passed directly to the current scan and are never stored in Codex's credential
22+
home or system keyring.
23+
24+
Local sign-in honors Codex's configured credential backend, including a system
25+
keyring required by a managed device. Codex Security keeps login and scan
26+
credentials in the same private, persistent state directory.
2127

2228
If both a ChatGPT sign-in and an API key are available, interactive scans ask
2329
which credential to use. CI and other noninteractive scans keep the existing

sdk/typescript/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ pass it on stdin:
111111
printenv OPENAI_API_KEY | npx @openai/codex-security login --with-api-key
112112
```
113113

114+
Environment API keys are supplied directly to the current scan and are never
115+
saved to the Codex credential home or system keyring. Only an explicit
116+
`login --with-api-key` stores an API key.
117+
114118
To pass a Codex access token explicitly, use
115119
`login --with-access-token` and provide the token on stdin. An access token
116120
environment variable is not automatically used as a scan API key.
@@ -122,10 +126,16 @@ $env:OPENAI_API_KEY = "<your-api-key>"
122126
npx @openai/codex-security scan C:\code\repository
123127
```
124128

125-
Check or remove the stored sign-in with `npx @openai/codex-security login status` and
126-
`npx @openai/codex-security logout`. Codex Security reuses an existing file-based Codex
127-
sign-in. If Codex stores credentials in the system keyring, run
128-
`npx @openai/codex-security login` once before scanning.
129+
Check or remove the stored sign-in with `npx @openai/codex-security login status`
130+
and `npx @openai/codex-security logout`. Codex Security keeps its sign-in in a
131+
private, stable Codex home at `$CODEX_SECURITY_STATE_DIR/codex-home`, or at
132+
`$CODEX_HOME/state/plugins/codex-security/codex-home` when no state directory is
133+
configured. Login, status, logout, and scans use the same home. Codex manages
134+
credentials using its configured file or system-keyring backend and honors
135+
managed-device policies. An existing file-based Codex sign-in is imported only
136+
when the dedicated home does not already contain stored credentials. Logging
137+
out prevents later scans from automatically reimporting that ambient sign-in
138+
until you explicitly log in again.
129139

130140
An environment API key takes precedence over a stored sign-in by default.
131141
When both a stored ChatGPT sign-in and an environment API key are available, an

0 commit comments

Comments
 (0)