🤖 AI Hot

Codex Cloud Reusable Environments: A Practical Guide

A
Alex Chen

Among the best AI tools 2026 has added for software engineers, Codex Cloud’s reusable environments are one of the few that change how you actually work rather than just how fast a model answers. Announced at DevDay on September 29, 2026, they let you publish a prepared development environment once and reuse it as the starting point for every new task, from the web, your phone, or the desktop app — while the work keeps running in the cloud even when your laptop is closed.

The shift matters because of what it replaces. Before this update, a Codex Cloud task was essentially an isolated remote sandbox: you prepared a container, the task ran, and that was it. The new model makes environments persistent and configurable, so a setup that took an hour to get right does not have to be redone for every task.

What a cloud environment actually is

A cloud environment is the reusable setup that a task runs against: the repositories, dependencies, tools, and access settings. Codex inspects your repositories, prepares the setup, and tests it with you. Once you publish it, each new task starts from its own isolated workspace built from that published environment.

There is a clean separation between the environment and the task. The environment is the verified, shared starting point. The task is a working copy: uncommitted changes, installed tools, and anything the agent does live only in that task, and they do not flow back into the environment automatically.

How to create and publish an environment

The flow is a conversation rather than a script. From a new task in the web or desktop app, choose Work in > Cloud, open Select environment, and select Create environment. Pick the GitHub repositories to check out, then select Get started.

From there Codex inspects the repositories, installs dependencies and tools, and tests the workflow. When it hits something it cannot infer — a missing access token, a required version, a service that needs to exist — it asks instead of guessing. You can steer it in plain language, for example:

Set up this repository for development and testing. Use Node 22.
Run npm ci, copy .dev.vars.example to .dev.vars, and apply the
local D1 migrations. Then run npm run check, npm test and npm run build.
Don't create Cloudflare resources and don't deploy anything.

When the setup looks right, you review the report, save changes, and select Publish. After that, every new task starts from the published filesystem.

Install script and start skill

Codex records the tested setup in two fields, and understanding them is the key to maintaining an environment over time:

  • Install script — commands to install dependencies and prepare development assets.
  • Start skill — instructions to start services and confirm they are ready.

You do not write a full setup script yourself; Codex consolidates what it tested into these two records. When you want to change the reusable setup, you edit the environment, describe the change, let Codex prepare and test it, then republish. Existing tasks keep their own state, so updating a shared environment does not break work in progress.

The base image and CODEX_ENV variables

Every Codex Cloud container starts from codex-universal, an Ubuntu 24.04 polyglot image that OpenAI maintains as an open-source reference implementation. It ships with pre-installed runtimes for eight languages, and you pin versions with CODEX_ENV_* variables rather than editing the install script:

# Pin runtimes for the environment
CODEX_ENV_NODE_VERSION = "22"
CODEX_ENV_PYTHON_VERSION = "3.12"

Supported ranges cover Python 3.10 through 3.14, Node 18/20/22, Rust 1.83.0–1.95.0, Go 1.22–1.25, Swift 5.10–6.2, Ruby 3.2–3.4, PHP 8.2–8.4, and Java 11/17/21–25. One gotcha worth internalizing: environment variables you export inside a setup script do not persist into the agent phase, because the two phases run in separate shell sessions. If the agent needs a variable at runtime, set it through the environment configuration or write it to ~/.bashrc.

Environment variables vs. network secrets

This is the part most people get wrong, so it is worth spelling out. Codex Cloud distinguishes two kinds of configuration:

ConfigurationUse it forDelivery
Environment variableA value a program must read directlyPassed directly to programs in the environment
Network secretA credential sent to a specific HTTPS servicePrograms get a placeholder; a proxy swaps in the real value for allowed destinations

For a network secret you set a key, value, and allowed domains. Substitution works for HTTPS on port 443 during setup and tasks, and the raw credential never lands in a local process or file. The catch, flagged in the docs and worth repeating: even when the credential is hidden from the agent, the permissions the service granted to that credential are not narrowed. A secret the agent can trigger is still a secret the agent can use.

VPN access

For reaching internal services, Tailscale is currently the only supported VPN provider. When you create a Tailscale auth key, enable both Reusable and Ephemeral — Reusable lets new cloud task VMs join your network, and Ephemeral makes Tailscale remove devices automatically after they go offline. Support for other VPN providers is planned but not yet shipped.

VM specifications

Each cloud task runs in its own VM, and the defaults depend on your ChatGPT plan:

ChatGPT planvCPUsMemoryDisk
Plus, Edu Plus28 GiB8 GiB
Pro, Business, Enterprise416 GiB32 GiB
Edu, Edu Pro416 GiB32 GiB

By default a task’s saved VM state is recoverable for up to seven days after you last start a turn or resume it. Larger VMs and custom specs are available for Enterprise through your OpenAI account team.

The codex cloud CLI

The codex cloud subcommand bridges your terminal to cloud task management. It is still marked experimental, but the basics work as of the late-September 2026 release:

# Interactive picker for tasks and environments
codex cloud

# Submit a task against a specific environment
codex cloud exec --env "$ENV_ID" "Add pagination to the /users endpoint"

# Best-of-N: submit 3 parallel attempts and keep the best
codex cloud exec --env "$ENV_ID" --attempts 3 "Improve the empty state of the dashboard"

# List recent tasks (20 at a time)
codex cloud list

Environment IDs come from your Codex Cloud configuration — check the interactive picker or the web dashboard for the exact value. The task runs on your current Git branch by default, with --branch to override.

Codex Cloud as an Enterprise AI Adoption Guide

For teams rather than individuals, the reusable environment is quietly the most important announcement in the Codex update. It is a governance primitive, not just a convenience feature.

Think about what a published environment actually encodes: the approved repositories, the pinned dependency versions, the access settings, and the permissions a task is allowed to use. When a team publishes an environment and points its engineers at it, everyone starts from the same verified baseline instead of their own local machine state. That is the difference between “the AI happened to work on one developer’s laptop” and “the AI runs against a configurable, auditable standard.”

OpenAI’s positioning supports this reading. The company described the environments as helping tasks start faster and giving teams a shared workspace with approved settings and permissions. For enterprises evaluating an AI adoption path, the practical checklist is short: define the baseline environment once, publish it, and let tasks inherit the approved configuration rather than each engineer configuring their own. The security side of the same story is Codex Security Cloud, which can scan entire repositories on demand, on a schedule, or on every commit, then investigate findings and prepare fixes in the cloud.

There is also a real cost angle. Cloud tasks draw from the same usage allowance as local Codex chats, but a cloud task can use more of it than a local message. The usage page in ChatGPT shows where you stand. For a team, that means budgeting is visible in one place rather than scattered across laptops.

Legacy mode and migration

The previous Codex Cloud remains available as “Codex Cloud (Legacy),” and it keeps support for Code Review, Linear, and GitHub integrations. OpenAI says it plans to retire the legacy approach eventually, but the current documentation gives no specific end date. If you are already using legacy, the new environments are additive — you can migrate repositories over without a hard cutover.

One detail that trips people up: skills stored in a repository can be used from cloud tasks, but personal skills saved only on your local PC are not automatically synced to Codex Cloud. If a workflow depends on a personal skill, make sure it lives in the repository.

Who should use Codex Cloud environments

Use them if you run tasks that are long-running, self-checking, and do not need anything that only exists on your machine — the classic “close the laptop and let it finish” workflow. They are also the right fit for teams that want a shared, approved baseline rather than per-developer setup drift, and for anyone who wants to kick off work from a phone while away from their desk.

Who should NOT use them

Skip them if your tasks depend on local state the cloud cannot see — a database running on your machine, local .env files, personal tools, or a specific hardware setup. A cloud task sees only what the environment gives it, and if that is not enough, the cloud is the wrong place. Also skip them for quick, interactive work where the overhead of environment setup outweighs the benefit; local Codex is still faster for a five-minute edit.

Limitations and caveats

The main caveat is the permission model’s reach. Hiding a credential from the agent does not reduce what the credential itself can do, and a published environment is only as safe as the permissions baked into it. Teams should review environment configuration as carefully as they would a production IAM policy.

The feature is also new enough that the CLI is still marked experimental, the VPN support is limited to Tailscale, and larger VMs require an Enterprise conversation rather than self-service. Personal skills do not sync, which will surprise anyone moving from a heavily customized local setup.

Finally, saved state is a convenience, not a backup. The docs are explicit that saved state does not replace source control — commit important work or save the output you need, because a task’s VM state is recoverable for only about seven days.

Bottom line

Codex Cloud’s reusable environments turn environment setup from a per-task chore into a published, shared asset. For individuals, that means long-running work that survives a closed laptop. For teams, it means a configurable, auditable baseline that makes the AI adoption question easier to answer. It is not a replacement for local Codex, and it will not fix a workflow that depends on local state — but for the growing share of agent work that fits the cloud, it is the feature that makes the rest of Codex worth using.

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen