OpenAI Codex is a cloud-based AI coding agent that writes features, fixes bugs, runs tests, and opens pull requests -- all inside an isolated sandbox you never have to configure. You describe a task, Codex spins up a container, clones your repo, does the work, and presents a diff for your review. No local setup. No terminal babysitting. Just results waiting in a queue.
That pitch is compelling. It is also only half the story. Codex makes bold trade-offs -- cloud-only execution, no internet access during tasks, subscription-gated usage -- that make it ideal for certain workflows and frustrating for others. This guide covers what Codex actually is, how it works under the hood, what it costs, where it excels, and where the limitations start to matter.
If you are evaluating Codex against the broader landscape, our guide to AI agent systems maps every major platform.
How OpenAI Codex Works
OpenAI Codex is a software engineering agent that operates entirely in the cloud. When you submit a task -- through the ChatGPT web interface, the Codex macOS app, or the Codex CLI -- the system provisions a sandboxed container, clones the specified GitHub repository, installs dependencies, and turns the agent loose on your request.
The execution model has three defining characteristics.
Sandboxed Cloud Execution
Every Codex task runs inside a secure, isolated container. During execution, internet access is disabled entirely. The agent can only interact with the code explicitly provided via your GitHub repository and any dependencies pre-installed through a setup script you configure. This is a deliberate security decision: it prevents the agent from hitting external APIs, leaking code, or downloading arbitrary packages mid-task.
The sandbox approach means Codex cannot browse documentation, fetch remote data, or interact with running services during a task. Everything it needs must already exist in the repo or the pre-configured environment. For self-contained coding work, this is fine. For tasks requiring external context -- checking an API response format, reading live documentation, testing against a staging server -- it is a real constraint.
The GPT-5.2-Codex Model
Codex runs on GPT-5.2-Codex, a model specifically optimized for agentic coding. It is not just GPT-5.2 with a coding prompt -- it is a dedicated variant tuned for multi-step software engineering tasks. Key improvements over its predecessors include context compaction (intelligently discarding stale context rather than summarizing it), stronger performance on large code changes, and improved handling of complex repository structures.
GPT-5.3-Codex, released in February 2026, pushes performance further: 56.8% on SWE-bench Pro and 77.3% on Terminal-Bench 2.0. The Terminal-Bench score is particularly notable -- it reflects the model's ability to work effectively in terminal-based workflows, which is exactly what a coding agent spends most of its time doing.
Parallel Task Execution
Unlike interactive coding assistants that handle one conversation at a time, Codex can run multiple tasks simultaneously. You can deploy several agents across different tasks in the same repository or across different projects. Each gets its own sandbox, its own worktree, and its own execution thread. This is where the cloud model genuinely shines -- you can kick off a feature implementation, a bug fix, and a documentation update at the same time and review the results when they are all done.
Key Features
Codex has evolved well beyond its initial launch. The current feature set reflects a platform that is trying to be a full software engineering partner, not just a code generator.
Multi-File Editing and Refactoring
Codex can navigate a codebase, understand the relationships between files, and make coordinated changes across multiple files in a single task. It reads your project structure, follows imports and references, and produces diffs that account for cross-file dependencies. For refactoring work -- renaming a type used in 30 files, extracting a shared utility, migrating to a new API pattern -- this is where autonomous agents save the most time.
Test Running and Validation
Before presenting results, Codex can run your test suite inside the sandbox. If tests fail, it reads the failure output, diagnoses the issue, and iterates on its solution. This feedback loop is what separates an agent from an autocomplete engine. The agent does not just write code that looks right -- it writes code that passes your existing quality gates.
Pull Request Generation
When a task completes, Codex can open a pull request on GitHub with a clear description of what changed and why. The PR includes the diff, a summary of the approach, and any relevant context. You review it like you would review any human-authored PR. This workflow integration is smooth -- Codex fits into your existing code review process rather than requiring a new one.
Skills
Codex Skills are reusable bundles of instructions, scripts, and resources that teach the agent how to perform specific tasks reliably. You can define skills for your team's conventions -- how to set up a development environment, how to run specific workflows, what coding standards to follow -- and Codex will apply them automatically or on request. Skills are available in both the CLI and IDE extensions.
This is functionally similar to how Claude Code uses CLAUDE.md files for project-specific instructions, but Skills are more structured, with explicit script execution capabilities.
Automations
Automations let Codex work without being prompted. You configure triggers -- a new issue, a CI failure, a monitoring alert -- and Codex picks up the work automatically. Issue triage, alert response, CI/CD maintenance, routine dependency updates. This is where the cloud-based model offers a genuine advantage over local agents: the agent is always running, always available, and does not need your machine to be on.
The Codex App
The Codex macOS app, launched in February 2026, provides a dedicated interface for managing multiple agent sessions. You can monitor running tasks, review completed work, and manage projects without switching to a browser. It functions as a mission control for parallel agent work -- seeing five tasks in progress across three repos, each with its own status and output.
Pricing
Codex is available through ChatGPT subscription plans. There is no standalone Codex subscription -- you pay for ChatGPT and Codex comes bundled.
Plan Tiers
Go ($8/month): Limited Codex access. Suitable for occasional, light usage. Good for trying the product, not for daily development work.
Plus ($20/month): 30-150 local tasks and generous cloud sessions per five-hour window, with weekly limits. This is the entry point for regular development use. The variable range (30-150) depends on task complexity -- simple tasks count as less, complex tasks count as more.
Pro ($200/month): 300-1,500 local tasks per five-hour window. Designed for heavy, full-time usage. If you are running Codex as your primary coding partner throughout a workday, this is the tier that will not run out on you.
Business and Enterprise: Team-oriented plans with additional administrative controls, user management, and compliance features. Pricing varies.
API Pricing
For developers building on the Codex model directly via the API (without the agent scaffolding): GPT-5.2-Codex runs $1.25 per million input tokens and $10.00 per million output tokens. GPT-5.1-Codex-Mini is significantly cheaper for simpler tasks like code completion.
Strengths
Codex does several things genuinely well.
Zero-configuration parallel work. Spinning up five tasks simultaneously and reviewing them all when done is a workflow that local agents cannot match without significant setup. The cloud sandbox handles all the isolation.
Security model. No internet access during execution means your code cannot be exfiltrated mid-task, and the agent cannot introduce dependencies you did not pre-approve. For security-conscious teams, this is a real feature, not a limitation.
Low barrier to entry. If you already pay for ChatGPT Plus, you have Codex. No API keys, no terminal setup, no CLI installation. Open ChatGPT, describe a task, and the agent starts working.
Automations. The ability to run without human prompting -- responding to issues, CI failures, and alerts automatically -- is a capability that most competing agents do not offer out of the box.
Speed. Codex on Cerebras hardware runs at 1,000+ tokens per second. Combined with GPT-5.3's 25% speed improvement over 5.2, task completion is fast.
Limitations
Every tool has trade-offs, and Codex's are worth understanding before you commit.
No internet during execution. The agent cannot check documentation, verify API response formats, or test against external services. If the answer is not in your repo or the pre-installed environment, Codex cannot find it. This is the single biggest limitation for many real-world tasks.
Cloud dependency. Your code goes to OpenAI's servers for execution. For open-source projects, this is a non-issue. For companies with strict data residency requirements or proprietary codebases, it is a dealbreaker. You need to trust OpenAI's security infrastructure with your source code.
Subscription-gated limits. Even on the Pro plan, you hit rate limits during heavy usage. The five-hour window resets, but during crunch periods, waiting for limit refreshes breaks flow. API-rate overflow purchases are available, but they add cost complexity.
No local execution option for the full agent. The Codex CLI runs locally, but the full agent experience -- parallel tasks, automations, the management app -- is cloud-only. If you want everything Codex offers, you are in the cloud.
Context window limitations. While GPT-5.2-Codex handles context compaction well, it does not match the raw context window sizes available in competing systems. Large monorepo navigation can hit ceiling constraints.
Codex vs Claude Code
The most common comparison developers draw is between Codex and Claude Code. They solve the same fundamental problem -- autonomous coding -- but with radically different architectural philosophies.
Execution model. Codex runs in the cloud; Claude Code runs locally in your terminal. This single difference cascades into everything: privacy, speed, tool access, and workflow integration.
Privacy. Claude Code keeps your code on your machine. Codex sends it to OpenAI's servers. For many developers and enterprises, this distinction alone determines the choice.
Tool ecosystem. Claude Code uses MCP (Model Context Protocol) to connect to external tools, databases, and APIs -- an open standard with hundreds of community-built integrations. Codex uses Skills and function calling, which are more structured but less extensible.
Context window. Claude Code supports up to 200K tokens natively (1M in beta). Codex's context compaction is smart, but the raw capacity is smaller.
Benchmarks. Codex leads Terminal-Bench 2.0 (77.3% vs 65.4%). Claude leads SWE-bench Pro (59% vs 56.8%) and SWE-bench Verified (80.8%). Different benchmarks measure different capabilities -- neither tool "wins" across the board.
Pricing model. Codex bundles with ChatGPT subscriptions. Claude Code charges per API token or through Claude Max subscriptions ($100-$200/month for heavy usage). Codex gives you more sessions per dollar at the $20 tier; Claude Code offers more predictable costs for heavy API users.
For a detailed head-to-head breakdown, read our full comparison: Claude Code vs OpenAI Codex.
Who Should Use Codex?
Codex is strongest for developers who want autonomous coding without infrastructure management. Specifically:
Solo developers and small teams who do not want to manage local agent setups, configure environments, or deal with terminal-based workflows. Codex's browser-based interface is the lowest-friction path to agent-assisted development.
Teams that value parallel execution. If your workflow involves kicking off multiple independent tasks -- feature branches, bug fixes, documentation -- and reviewing the results asynchronously, Codex's cloud model is purpose-built for this.
Organizations already invested in OpenAI's ecosystem. If you use ChatGPT Plus or Pro, Codex is already available to you. The marginal cost is zero.
Teams doing greenfield development. For new projects where the agent does not need extensive existing context or external service interaction, Codex's sandbox model works well.
For developers who need deep codebase integration, local execution, or extensive tool connectivity, alternatives like Claude Code may be a better fit. For a broader view of the options, see our guide to AI agent systems.
Where Codex Fits in the AI Agent Landscape
Codex represents one pole of the AI coding agent spectrum: fully managed, cloud-based, subscription-included, and optimized for parallel autonomous work. It is OpenAI's answer to the question of how to make AI coding accessible to the widest possible audience.
The alternative pole -- local-first, developer-controlled, extensible -- is occupied by tools like Claude Code. Neither approach is universally better. The right choice depends on your privacy requirements, your workflow preferences, and how deeply you want to customize the agent's behavior.
What both approaches share is a direction: coding agents are becoming teammates, not just tools. They take tasks, do work, and present results. Codex does this with the convenience of cloud infrastructure. Others do it with the control of local execution. The gap between these approaches will likely narrow as both models mature, but for now, understanding the trade-offs is what separates a productive choice from a frustrating one.
For the foundational concepts behind all of these systems, start with our guide: What Are AI Agents?
For a deep dive into OpenAI's full agent ecosystem beyond Codex, see our guide: OpenAI AI Agents
Frequently Asked Questions
What is OpenAI Codex?
OpenAI Codex is a cloud-based AI coding agent that autonomously writes code, fixes bugs, runs tests, and creates pull requests inside a sandboxed cloud environment. It is powered by the GPT-5.2-Codex model (with GPT-5.3-Codex now available) and is included with ChatGPT Plus, Pro, Business, and Enterprise subscriptions.
How does OpenAI Codex differ from GitHub Copilot?
GitHub Copilot provides inline code suggestions and completions as you type. Codex is a full autonomous agent -- you give it a task description and it plans, implements, tests, and delivers the complete solution. Copilot assists while you code. Codex codes while you do other things.
Is OpenAI Codex free?
Codex is included with ChatGPT subscriptions. The Go tier ($8/month) provides limited access. Plus ($20/month) and Pro ($200/month) provide progressively more generous usage limits. There is no free tier for sustained development use, though limited-time promotional access has been offered to Free and Go users.
What is the difference between Codex and Claude Code?
Codex runs in the cloud with sandboxed execution and no internet access during tasks. Claude Code runs locally in your terminal with full access to your development environment, external tools via MCP, and no data leaving your machine. Codex favors parallel autonomous work; Claude Code favors deep, interactive, privacy-first development. For a full comparison, see our guide: Claude Code vs OpenAI Codex.
Can Codex access the internet while coding?
No. During task execution, internet access is completely disabled. The agent can only work with the code in your GitHub repository and dependencies pre-installed through a setup script. This is a security feature, but it means Codex cannot browse documentation, check API endpoints, or fetch external resources during a task.