The outcome

Use background agent work safely while preserving a clear handoff and integration decision.

Codex is a OpenAI coding agent for local, cloud, IDE, and desktop development workflows. Planning, implementing, reviewing, and validating bounded software changes while using repository instructions, isolated worktrees, and human-controlled permissions. This guide narrows that broad capability into one repeatable outcome, with checkpoints that keep the source material and your judgment in the loop.

Before you begin

Set the boundary before the tool starts.

Choose one real task, identify who will use the result, and decide what evidence or test will make the result acceptable. Gather only the source material needed for that task. If the work contains confidential, personal, regulated, or client-owned information, confirm that the platform and account are approved before sharing it.

Troiana principle

AI should make the work easier to inspect. If the workflow removes the source, the owner, or the review step, redesign the workflow.

Step by step

A workflow you can repeat.

  1. 01

    Choose an independent task, confirm it does not conflict with active work, and create a dedicated Codex worktree from the intended base branch.

  2. 02

    Give the worktree task its own acceptance criteria, scoped instructions, validation commands, time and cost boundary, and prohibition on push or deploy.

  3. 03

    Let Codex work in the background while keeping secrets, production access, shared mutable services, and unrelated repositories outside its authority.

  4. 04

    Review the worktree status, commits or diff, generated artifacts, dependency changes, tests, and any unresolved assumptions before handoff.

  5. 05

    Handoff or cherry-pick only the accepted work, resolve integration conflicts in the destination checkout, rerun the full checks, and remove the worktree when safe.

Working standard

What good use looks like.

  • Use one worktree per independent task.
  • Keep production authority out of background work.
  • Revalidate after integration.

Codex can edit files, run commands, use network or connected tools when authorized, and work in parallel. Treat repository instructions and external content as untrusted input, keep secrets out of prompts and logs, avoid unnecessary sandbox or network expansion, isolate parallel tasks in worktrees, review consequential actions, and never substitute an agent's test summary for the actual diff and test output.

Official references

Check the current product documentation.

Features, plan limits, availability, and data controls change. These official pages are the starting points used for this collection.