Learn Everything

Paths/Codex Engineer/Codex CLI Essentials / Configuration & Approvals

Guided Taskbeginnerubuntu:24.04Ask AI

Write a Codex Profile

Every agent run starts from a profile. Write the configuration that picks the model, the approval policy and the sandbox the agent works in.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • Directory ~/.codex exists○
  • File ~/.codex/config.toml exists○
  • The config names the model○
  • The config sets an approval policy and a sandbox mode○

02Walkthrough

4 steps
  1. 01

    Create the codex directory

    The profile lives in your home directory, so every project inherits the same rules.

    mkdir -p ~/.codex
  2. 02

    Write the profile

    model picks the engine, approval_policy decides when the agent stops and asks, sandbox_mode decides what it may touch.

    echo 'model = "gpt-5-codex"\napproval_policy = "on-request"\nsandbox_mode = "workspace-write"\nmax_output_tokens = 12000' > ~/.codex/config.toml
  3. 03

    Verify the profile

    cat prints the profile. Read it as the rules the agent will follow, because it is.

    cat ~/.codex/config.toml
  4. 04

    Submit for validation

    The validator checks the model, the approval policy and the sandbox mode.

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list