Paths/Codex Engineer/Codex CLI Essentials / Configuration & Approvals
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
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- 01
Create the codex directory
The profile lives in your home directory, so every project inherits the same rules.
mkdir -p ~/.codex - 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 - 03
Verify the profile
cat prints the profile. Read it as the rules the agent will follow, because it is.
cat ~/.codex/config.toml - 04
Submit for validation
The validator checks the model, the approval policy and the sandbox mode.
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — ubuntu:24.04
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list