{
  "slug": "codex-exec-full-auto-removed",
  "url": "https://insidetheloop.dev/fixes/codex-exec-full-auto-removed",
  "markdown_url": "https://insidetheloop.dev/fixes/codex-exec-full-auto-removed.md",
  "title": "Codex CLI: \"error: unexpected argument '--full-auto' found\"",
  "description": "Codex CLI 0.147.0 removed the hidden codex exec --full-auto flag. Use codex exec --sandbox workspace-write instead.",
  "tool": {
    "id": "codex",
    "name": "Codex CLI",
    "long_name": "OpenAI Codex CLI (codex)",
    "url": "https://insidetheloop.dev/tools/codex",
    "latest_version": "0.160.1"
  },
  "error": "error: unexpected argument '--full-auto' found",
  "variants": [],
  "output": "error: unexpected argument '--full-auto' found\n\n  tip: to pass '--full-auto' as a value, use '-- --full-auto'\n\nUsage: codex exec [OPTIONS] [PROMPT]\n       codex exec [OPTIONS] <COMMAND> [ARGS]\n\nFor more information, try '--help'.",
  "exit_code": 2,
  "command": "codex exec --full-auto --skip-git-repo-check \"say hi\" </dev/null",
  "versions": {
    "affected": "0.147.0 and later",
    "first_bad": "0.147.0",
    "last_good": "0.146.1",
    "fixed_in": null,
    "tested": [
      "0.146.1",
      "0.147.0",
      "0.160.1"
    ]
  },
  "cause": "Codex CLI 0.147.0 (released 2026-08-07) removed the hidden, deprecated `--full-auto` flag from `codex exec`, so the argument parser now rejects it.",
  "fix": {
    "summary": "Replace `--full-auto` with `--sandbox workspace-write`.",
    "commands": [
      "# before (0.146.1 and older)",
      "# codex exec --full-auto \"<prompt>\"",
      "codex exec --sandbox workspace-write \"<prompt>\""
    ],
    "note": "`--full-auto` never appeared in `codex exec --help`, so a diff of the help text does not show its removal. 0.146.1 printed a deprecation warning pointing to `--sandbox workspace-write` and ran with `sandbox: workspace-write`; with the replacement flag 0.160.1 prints the same `sandbox: workspace-write [workdir, /tmp, $TMPDIR]` header (see the reproduction below)."
  },
  "reproduction": {
    "ran_at": "2026-10-07T14:10:55Z",
    "environment": "A fresh Debian 13 VM from `bin/sandbox-run` (Node.js 24, root, online, no credentials for any service), destroyed after the run. Without an OpenAI login the model request itself fails, so the fix is verified by the session header Codex prints before it calls the API.",
    "steps": [
      {
        "label": "Before: deprecated but accepted",
        "version": "0.146.1",
        "command": "codex exec --full-auto --skip-git-repo-check \"say hi\" </dev/null",
        "output": "warning: `--full-auto` is deprecated; use `--sandbox workspace-write` instead.\nReading additional input from stdin...\nOpenAI Codex v0.146.1\n--------\nworkdir: /root/work\nmodel: gpt-5.6-sol\nprovider: openai\napproval: never\nsandbox: workspace-write [workdir, /tmp, $TMPDIR]\n[… trimmed 26 lines …]",
        "exit": 1
      },
      {
        "label": "After: rejected by the argument parser",
        "version": "0.147.0",
        "command": "codex exec --full-auto --skip-git-repo-check \"say hi\" </dev/null",
        "output": "error: unexpected argument '--full-auto' found\n\n  tip: to pass '--full-auto' as a value, use '-- --full-auto'\n\nUsage: codex exec [OPTIONS] [PROMPT]\n       codex exec [OPTIONS] <COMMAND> [ARGS]\n\nFor more information, try '--help'.",
        "exit": 2
      },
      {
        "label": "Same in the latest release",
        "version": "0.160.1",
        "command": "codex exec --full-auto --skip-git-repo-check \"say hi\" </dev/null",
        "output": "error: unexpected argument '--full-auto' found\n\n  tip: to pass '--full-auto' as a value, use '-- --full-auto'\n\nUsage: codex exec [OPTIONS] [PROMPT]\n       codex exec [OPTIONS] <COMMAND> [ARGS]\n\nFor more information, try '--help'.",
        "exit": 2
      },
      {
        "label": "Fix verified: the replacement flag parses and selects the same sandbox (the run then fails on the network, since the VM has no OpenAI login)",
        "version": "0.160.1",
        "command": "codex exec --sandbox workspace-write --skip-git-repo-check \"say hi\" </dev/null",
        "output": "Reading additional input from stdin...\nOpenAI Codex v0.160.1\n--------\nworkdir: /root/work\nmodel: gpt-6.1-sol\nprovider: openai\napproval: never\nsandbox: workspace-write [workdir, /tmp, $TMPDIR]\n[… trimmed 23 lines …]",
        "exit": 124
      }
    ]
  },
  "why": {
    "text": "Pull request #36054 (merged 2026-07-30, shipped in 0.147.0) stops \"accepting the hidden, deprecated `--full-auto` flag in `codex exec`\" and removes \"its implicit mapping to the `workspace-write` sandbox. Callers must now select the sandbox mode explicitly with `--sandbox workspace-write`.\"",
    "url": "https://github.com/openai/codex/pull/36054",
    "source": "openai/codex PR #36054"
  },
  "tool_page": "https://insidetheloop.dev/tools/codex#gotcha-codex-exec-full-auto-fails-with-unexpected-argument",
  "related": [
    {
      "slug": "codex-exec-not-inside-trusted-directory",
      "error": "Not inside a trusted directory and --skip-git-repo-check was not specified.",
      "url": "https://insidetheloop.dev/fixes/codex-exec-not-inside-trusted-directory"
    }
  ],
  "sources": [
    {
      "title": "Remove legacy --full-auto handling from codex exec (PR #36054)",
      "url": "https://github.com/openai/codex/pull/36054",
      "read": "2026-10-07"
    },
    {
      "title": "Codex CLI 0.147.0 release notes",
      "url": "https://github.com/openai/codex/releases/tag/rust-v0.147.0",
      "read": "2026-10-07"
    }
  ],
  "date_published": "2026-10-07T14:15:32Z",
  "date_modified": "2026-10-07T14:15:32Z",
  "verified": {
    "date": "2026-10-07",
    "versions": [
      "0.146.1",
      "0.147.0",
      "0.160.1"
    ]
  }
}
