Layered TOML, with profiles for switchable defaults
Codex's config is layered: ~/.codex/config.toml (user), .codex/config.toml in repo (project, only if trusted), /etc/codex/config.toml (system, always trusted). Precedence: CLI flags + -c key=value overrides → profile (--profile NAME) → project file → user file → system file → built-in defaults.
Profiles are named groups of settings within config.toml. --profile secure swaps in tighter defaults; --profile fast swaps in looser ones for trusted automation. Same config file, multiple operating modes.