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
- ChatGPT Plus / Pro / Business / Enterprise plans
- Or use an OpenAI API Key
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
- Connect a GitHub account
- Select a repository
- Configure setup scripts and environment variables
- Select a network access policy
Task Execution Flow
Cloud tasks are executed in the following flow:
- Create a container and clone the repository to the selected branch
- Run the setup script to install dependencies
- Apply network access settings
- The Agent executes the task (editing code, running commands, verifying results)
- Display results and file changes
Default Image
The cloud uses a default container image named universal as its default:
- Preinstalled common languages: Python, Node.js, Go, Rust
- Includes common tools: npm, pip, cargo, git
- Runtime versions can be pinned
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:
- Node.js: automatically runs npm install / yarn / pnpm
- Python: automatically runs pip install / poetry install
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:
- Used to update dependencies or rebuild
- Faster than a full setup
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:
- Additional encrypted storage
- Only decrypted during task execution
- Only available in setup scripts
- Automatically removed during the Agent phase
| 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:
- Prompt injection (obtaining instructions from malicious web pages)
- Data leakage (sending code or keys to external parties)
- Downloading malicious dependencies
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:
- Cached for up to 12 hours
- Automatically invalidated when setup scripts or environment variables change
- New tasks start faster
Cloud Task Management
Create a Task
- Select an Environment
- Enter a Task Description
- Select the Model and Configuration
- Start the Task
Task Monitoring
- View progress in real time
- View file changes
- Check command output
Result Handling
- View the Diff of Changes
- Create a Pull Request
- Download changed files
Parallel Tasks
The cloud supports running multiple tasks in parallel:
- Work on different features simultaneously
- Multiple environments work independently
- Improve overall efficiency
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.