GPT WORLD / INDEPENDENT CODEX FIELD MANUAL Source review · 2026-07-26

Field guide / 19 min

Scale from subagents to safe automation

Parallelize independent evidence, then move stable workflows into codex exec and CI.

Track
Codex CLI core
Level
Automation
Maturity
Stable core; custom-agent authoring may evolve

Subagents protect the main thread from noisy exploration and can run independent read-heavy work in parallel. For non-interactive workflows, codex exec defaults to a read-only sandbox, streams progress to stderr, and prints the final message to stdout; JSONL and output schemas support machine consumers. GitHub Actions should use the official action and narrow privileges.

CLI

Verified terminal sequence

TERMINAL / COPY WITH INTENT
  1. /agent
  2. $codex exec "summarize the repository structure"
  3. $codex exec --ephemeral "triage this repository"
  4. $codex exec --json "summarize the repo structure" | jq
  5. $codex exec resume --last "continue the task"
A

Working principles

01

Parallelize independence

Start with exploration, tests, triage, and review; simultaneous writes need explicit file ownership and coordination.

02

Children inherit boundaries

Subagents inherit the parent sandbox and live runtime overrides, so permission design happens before spawning.

03

Automate stable contracts

Move a workflow into codex exec only after prompts, inputs, permissions, output shape, and failure handling are repeatable.

B

Field procedure

  1. 01

    Delegate bounded reads

    Ask for one agent per independent concern, wait for them, and require concise evidence summaries.

  2. 02

    Inspect agent threads

    Use /agent to review status and results rather than flooding the main context with raw logs.

  3. 03

    Prototype with codex exec

    Begin read-only and ephemeral; pipe bounded context and keep instructions in the prompt argument.

  4. 04

    Add machine output

    Use --json for event streams or --output-schema for a stable final object. Resume only when repository state remains compatible.

  5. 05

    Harden CI

    Use openai/codex-action@v1, trusted triggers, minimal permissions, isolated secrets, and a separate job for repository writes.

PASS / FAIL

Acceptance checklist

  • Subtasks are independent and bounded.
  • Parent permissions are least privilege.
  • Automation handles non-zero exit and malformed output.
  • Repository write credentials are isolated from the Codex job.

WATCH / REJECT

Failure patterns

  • Spawning agents for tightly coupled writes.
  • Using deprecated --full-auto in new scripts.
  • Exposing API keys job-wide to repository-controlled code.