Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Codex Cloud Version

Codex Cloud Version

Codex Web is the cloud version, letting you access Codex from any device and run tasks in isolated environments.


Access Codex Web

Access cloud Codex:



https://chatgpt.com/codex

Prerequisites

When using an API Key, some cloud features may be unavailable.


Cloud Environments

Environment is a core concept of Codex Web; each environment is an isolated workspace.

Create environment

  1. Connect a GitHub account
  2. Select a repository
  3. Configure setup scripts and environment variables
  4. Select a network access policy

Task Execution Flow

Cloud tasks are executed in the following flow:

  1. Create a container and clone the repository to the selected branch
  2. Run the setup script to install dependencies
  3. Apply network access settings
  4. The Agent executes the task (editing code, running commands, verifying results)
  5. Display results and file changes

Default Image

The cloud uses a default container image named universal as its default:

Version Pinning

Pin a version

Environment Settings

Pin the Python Version

python_version = "3.11"

Pin the Node.js Version

node_version = "20"


Setup scripts

Setup scripts run automatically when the container is created:

Auto-detect

Codex automatically detects the project type and performs the appropriate installation:

Manual Scripts

Custom Setup Scripts

Setup Script

Configure in Environment Settings

npm

install

npm run build

pip

install

-r

requirements.txt

Maintenance Scripts

Maintenance scripts run when a cached container starts:

Setup scripts and the Agent run in different Bash sessions, so export commands do not persist.


Environment variables and Secrets

Environment Variables

Environment variables are available throughout the task:

Set environment variables

Environment Variables

NODE_ENV

=production

DEBUG

=

false

API_ENDPOINT

=https:

//

api.example.com

Secrets

Secrets are used to store sensitive information:

Type Visibility scope Purpose
Environment Variables Setup script + Agent Regular configuration
Secrets Setup script only API Keys, passwords

Network access control

Network access in cloud environments is restricted by default:

The default setting

Stage Network access
Setup scripts Allowed (needed to install dependencies)
Agent Prohibited (default)

Agent Network Access Options

Settings Description
Off Completely disable network access
On Allow network access (domains can be restricted)

Domain Whitelist

Domain Configuration

Network configuration

Whitelist Presets

domain_allowlist = "common-dependencies"

Includes: github.com, npmjs.com, pypi.org, etc.

Custom Domains

domain_allowlist = [

    "github.com",

    "api.mycompany.com"

]

Restrict HTTP Methods

allowed_methods = ["GET", "HEAD", "OPTIONS"]

Security Risks

Enabling Agent network access increases risks:

Only enable Agent network access when necessary, and restrict it with a domain whitelist.


Container Caching

The cloud caches container state to speed up subsequent tasks:


Cloud Task Management

Create a Task

  1. Select an Environment
  2. Enter a Task Description
  3. Select the Model and Configuration
  4. Start the Task

Task Monitoring

Result Handling


Parallel Tasks

The cloud supports running multiple tasks in parallel:

Avoid having multiple tasks modify the same file at the same time, otherwise conflicts will occur.


Common questions

Q: What is the difference between Cloud and local?

Cloud runs on remote servers, suitable for parallel tasks and remote access; local operates directly on your files.

Q: How is it priced?

Cloud tasks consume quota, and charges are calculated based on the model and usage.

Q: Can it access local files?

The cloud cannot access local files, but they can be synced via Git.

Q: When is network access needed?

Only when the Agent needs real-time data or external APIs; setup scripts are usually sufficient.