'Where does the agent work' is a question you must answer even earlier than 'which model does it use', because it directly decides the data boundary, cost structure, and parallelism. Codex's Environments section offers three modes: Local environments let the agent run on your own machine, keeping files, terminal, and login state local — the closest fit to 'data never leaves this machine'; Cloud environment hands execution to a hosted environment, for scenarios where you want to decouple from local resources or need stronger scheduling; Git worktrees provide a different axis of isolation — each task proceeds in its own worktree branch, so multiple tasks run in parallel without stepping on each other and converge at merge time. The three modes aren't mutually exclusive; you switch by task nature.
For Zero to Codex learners, this step is the most practical choice in 'environment setup': beginners should start local, for the same reason FIIT.AI makes 'local execution' a product principle — files and terminal stay on your machine, with the least risk and the most observability. Once the workflow matures and you need parallelism or decoupling, bring in Git worktrees and the cloud environment. For Zero to Pro Agent Harness learners, the three modes map to the harness's 'execution-layer abstraction': a well-designed harness should make 'which environment to run in' a pluggable decision rather than hardcoding it into core logic — which is exactly what Codex's unified Modes expresses.