Run Codex CLI in an isx sandbox

This guide takes you from an installed isx to Codex CLI at work on your project, in a machine of its own. Codex runs there with full access to the machine and no approval prompts, and your OpenAI credential stays on your host. The first build takes a few minutes, and every machine after it is instant.

Before you start

You need isx installed: the Quick Start has the command for your system. You also need an OpenAI credential: an API key, which needs billing credits, or a ChatGPT plan. Signing in with a ChatGPT plan is experimental: A ChatGPT plan, experimental says what that means before you choose it.

Set up the host

Run init, and choose Codex CLI when it asks which coding agent you use:

isx init

Init then asks for your OpenAI credential, and for a GitHub account, which you may skip. If you skip GitHub, answer yes when init asks whether the agent's commits carry your name, or the agent cannot commit.

Init sets up the host and builds a template called tpl-agent: a machine image with Codex installed. The Quick Start says what init does on each system.

Give the template your project

Open ~/.config/incus-spawn/images/tpl-agent.yaml, which init wrote. Uncomment its repos: and workdir: lines, and put your repository's URL in them:

repos:
  - url: https://github.com/myorg/myproject.git
    path: ~/myproject
workdir: ~/myproject

Keep the lines init wrote, such as tools: and default-action: codex.

Then rebuild the template, which clones the repository into it:

isx build tpl-agent

Write an isx template for your project goes further, with the packages your project builds with. Codex CLI on the Agents page sets its model and reasoning effort in the same file.

Branch a machine for one task

A branch is an instant copy-on-write machine made from the template. Make one for the task, named after it:

isx branch fix-login --from tpl-agent

Codex opens inside it, in ~/myproject, with no sign-in and no approval prompts. Give it the task. isx shell fix-login opens a shell in the same machine later, from any terminal.

Check that it works

Codex's footer reads Running unconstrained in isx, followed by the isx version and the machine's name. That is the name of its permission profile, which gives it full access to the machine's files and network.

Codex answering your first message shows that the proxy signed its requests. On the host, isx proxy activity lists fix-login with the model calls it made. Inside the machine, no variable or file holds your credential: Credential Isolation says what it holds in its place.

Take the work back

The agent's work reaches your host as commits. In your checkout of the project on the host, add the machine as a git remote, fetch, and list its branches:

git remote add fix-login isx://fix-login/~/myproject
git fetch fix-login
git branch -r --list 'fix-login/*'

Compare the branch the agent used with yours, here fix-login/main, then take what you like with git cherry-pick or git merge:

git diff HEAD...fix-login/main

Review and take an agent's commits covers the rest, such as letting isx add this remote on every branch.

Clean up

Destroy the machine once you took its work:

isx destroy fix-login

The template stays, so the next task is one isx branch away.

Next steps