# codex · Credential handling

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [codex](https://ai-agents-review.com/runtime/codex.md)
- Column: [Credential handling](https://ai-agents-review.com/column/credential-handling.md) (Execution controls)
- Mark: 2→3 [opt: shell_environment_policy inherit=core/none] s
- Default deployment: 2
- Best supported configuration: 3 (opt: shell_environment_policy inherit=core/none)
- Page: https://ai-agents-review.com/cell/codex/credential-handling

## Rationale

Default denylist *KEY*/*SECRET*/*TOKEN*; a named config key gives an allowlisted env (R1); auth.json likely readable

## Rubric criteria for this column

- 0: Full environment inherited, credentials stored in plaintext readable by agent code, no filtering
- 1: Some protection (keychain option, redaction of output, per-command secret injection), but the full environment is still inherited by default
- 2: Default denylist filtering of the environment, but known provider keys or credential files remain reachable by agent code
- 3: Default cleared environment plus allowlist for agent processes; credential stores may still be readable on the same filesystem
- 4: Level 3, plus provider credentials held outside the agent's reach (separate process or broker) **and** auxiliary processes (MCP stdio) also get an allowlisted environment

## Review finding

Partial filtering, built in. Shell tools inherit the full environment minus case-insensitive `*KEY*`/`*SECRET*`/`*TOKEN*` (`*PASSWORD*` is not excluded); configurable via `[shell_environment_policy]`. MCP stdio servers get an allowlist. Login credentials sit in `auth.json` by default and are likely readable under the read-`/` profile (inferred). Redaction covers memories and command display only. [X7][X8][X9][X10][X11]

## Evidence cited by the mark

- [X7] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/protocol/src/shell_environment.rs#L112-L153 — env inherit All/Core/None then default excludes *KEY*/*SECRET*/*TOKEN* (case-insensitive) — [S]
- [X8] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/protocol/src/config_types.rs#L219-L230 — `ShellEnvironmentPolicyInherit` default `All` — [S]
- [X10] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/config/src/types.rs#L152-L162 — auth credential store default `File` (auth.json); Keyring/Auto/Ephemeral optional — [S]

## Evidence also cited by the review finding

- [X9] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/rmcp-client/src/utils.rs#L16-L58 — MCP stdio env allowlist `DEFAULT_ENV_VARS` — [S]
- [X11] codex — https://github.com/openai/codex/blob/065e18b04021008e2e7d504db8dc50275f589f73/codex-rs/secrets/src/sanitizer.rs#L4-L20 — regex redaction patterns (used for memories and command display only) — [S]

## Grading record

- Grader A (default / best): 2 / 2
- Grader B (default / best): 2 / 3
- Adjudication: disagreement; R1. Default denylist *KEY*/*SECRET*/*TOKEN*; a named config key gives an allowlisted env (R1); auth.json likely readable
