Project permissions control what Codex CLI can edit and run automatically. Auto mode pairs workspace-write with on-request to let Codex edit the project and run permitted commands while requesting broader access when needed.

The working directory supplies the main writable root, alongside temporary directories. Ordinary files elsewhere can still be readable, but writes outside those roots and commands requiring network access normally need approval; protected paths inside the workspace also remain restricted.

Codex CLI must already be installed and signed in. A version-controlled project makes its changes reviewable; a clean working tree or separate branch helps distinguish those changes from earlier work.

Steps to run Codex CLI in auto mode:

  1. Change to the trusted project that should be writable by Codex.
    $ cd ~/projects/example-app

    The path represents your own project. A narrow project root limits which ordinary files the session can change automatically.
    Related: How to set the working directory for Codex

  2. Check the working tree for existing changes.
    $ git status --short

    No output means there are no tracked modifications or untracked files; existing changes remain part of the workspace.

  3. Start Codex with the Auto sandbox and approval settings.

    Auto can edit workspace files and run local commands without individual confirmations. Repository content may also be sent to the selected model provider; only trusted projects and suitable data belong in the session. Trusting a folder also allows its project settings to run code automatically.

    $ codex --sandbox workspace-write --ask-for-approval on-request

    The explicit settings are workspace-write and on-request. Interactive Codex CLI 0.166.0 rejects the older --full-auto shortcut. These options select its workspace sandbox and approval policy.

  4. Confirm trust in the project if the folder-access prompt appears.

    The trust choice is saved, so the prompt may be absent for a project already marked trusted.
    Related: How to fix the Codex trusted-directory error

  5. Check the active permissions in the session status.
    /status

    The Permissions line should show Workspace (Ask for approval). Ordinary project edits are allowed, while protected paths such as .git and .codex remain restricted. Command network access is disabled by default; existing configuration can enable it. A different permissions label means the session needs checking before you give it an editing task.

Share this guide