Answer: You define profiles by creating a separate TOML file for each profile and using top-level config keys in the profile file (not nested under `[profiles.profile-name]`). You use a profile by passing `--profile profile-name` to the CLI, which loads `~/.codex/config.toml` and then overlays `~/.codex/profile-name.config.toml`. Status: Confirmed Entry: tool/codex/settings/config-profiles Revision: 3 Digest: sha256:4d35a60d4ef2b1da (changes whenever the content changes) Timeline: Created: 2026-11-13T03:48:17Z Last changed: 2026-11-18T13:30:00Z (Key placement: — → top-level config keys) Last verified: 2026-11-20T13:35:56Z Next check: 2026-11-21T13:35:56Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of CLI flag | --profile profile-name | [1] | 2026-11-20 Base config file | ~/.codex/config.toml | [1] | 2026-11-20 Profile overlay file | ~/.codex/profile-name.config.toml | [1] | 2026-11-20 Allowed profile name characters | letters, numbers, hyphens, and underscores | [1] | 2026-11-20 Key placement | top-level config keys | [1] | 2026-11-20 Sources: [1] OpenAI. "Advanced Configuration". https://learn.chatgpt.com/docs/config-file/config-advanced.md Role: primary. Accessed: 2026-11-20T13:35:56Z Quote: "When you pass `--profile profile-name`, Codex loads" (Supports: CLI flag) Quote: "`~/.codex/config.toml`, then overlays `~/.codex/profile-name.config.toml`." (Supports: Base config file) Quote: "then overlays `~/.codex/profile-name.config.toml`." (Supports: Profile overlay file) Quote: "Profile names can contain letters, numbers, hyphens, and underscores." (Supports: Allowed profile name characters) Quote: "Use top-level config keys in the profile file; don't nest them under `[profiles.profile-name]`." (Supports: Key placement) Snapshot SHA-256: 509cb889c8d02037082a87c240864f0e2618d38ab224c28b562712b2744fbd65 (captured 2026-11-17T13:59:29Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T13:59:30Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:35:56Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:35:56Z Last attempt: 2026-11-20T13:35:56Z Notes and limitations: Extracted automatically from a single official source (section "Profiles"). Related: https://latestn.com/tool/codex/settings/config-toml-settings What settings can I configure in Codex config.toml? https://latestn.com/tool/codex/settings/configure-aws-credentials-bedrock How do I configure AWS credentials for Codex to connect to Amazon Bedrock? https://latestn.com/tool/codex/settings/configure-cli-notifications How do I configure CLI notifications in Codex? https://latestn.com/tool/codex/settings/common-config-options How do I change the default model, approval prompts, or sandbox level in Codex? https://latestn.com/tool/codex/settings/config-file-location Where is the Codex configuration file located and how do I open it? https://latestn.com/tool/codex/settings/config-precedence How does Codex decide which configuration value to use when settings conflict? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T13:30:00Z | changed | Key placement: — → top-level config keys | [1] 2026-11-18T13:30:00Z | changed | Key placement rule: top-level config keys → — | [1] 2026-11-15T13:42:54Z | changed | Key placement rule: — → top-level config keys | [1] 2026-11-15T13:42:54Z | changed | Allowed profile name characters: — → letters, numbers, hyphens, and underscores | [1] 2026-11-15T13:42:54Z | changed | Profile overlay file: — → ~/.codex/profile-name.config.toml | [1] 2026-11-15T13:42:54Z | changed | Base config file: — → ~/.codex/config.toml | [1] 2026-11-15T13:42:54Z | changed | key placement: top-level config keys → — | [1] 2026-11-15T13:42:54Z | changed | allowed profile name characters: letters, numbers, hyphens, and underscores → — | [1] 2026-11-15T13:42:54Z | changed | profile overlay file: ~/.codex/profile-name.config.toml → — | [1] 2026-11-15T13:42:54Z | changed | base config file: ~/.codex/config.toml → — | [1] 2026-11-13T03:48:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/settings/config-profiles/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/codex/settings/config-profiles POST: https://latestn.com/dispute/tool/codex/settings/config-profiles with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/settings/config-profiles?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I define and use profiles in Codex's config.toml? Revision 3, last verified 2026-11-20T13:35:56Z. https://latestn.com/tool/codex/settings/config-profiles (accessed 2026-11-21T09:53:01Z). @misc{LatestN_tool_codex_settings_config_profiles_r3, title = {How do I define and use profiles in Codex's config.toml?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/settings/config-profiles}}, note = {Revision 3; digest sha256:4d35a60d4ef2b1da; last verified 2026-11-20T13:35:56Z; accessed 2026-11-21T09:53:01Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/codex/settings/config-profiles