On May 16, 2025, OpenAI announced the research preview of Codex, a cloud-based software engineering agent1. This represents the next generation of AI coding tools following the original Codex first announced in 2021. This new Codex is designed as an advanced AI agent capable of handling multiple tasks in parallel, aiming to dramatically improve developer productivity. This article explores both the technical foundations of the 2021 original Codex and the evolution to the 2025 version, explaining how each generation generates code.
The 2025 Codex is built on the codex-1 model, a version of OpenAI’s latest reasoning model o3, optimized for software engineering1. This new model produces cleaner code than o3, adheres more precisely to instructions, and iteratively runs tests until achieving passing results1.
Technical Foundation of Original Codex (2021): Transformer Architecture
The original OpenAI Codex from 2021 was built on the same transformer architecture as GPT-32. Transformers use a technique called “attention mechanism” to understand the context of input text or code and predict what code should come next.
How Transformer-Based Code Generation Works (2021 Version)
The original Codex code generation process operated as follows:
-
Tokenization: The input prompt (natural language descriptions or partial code) is broken down into small units called tokens. Tokens can represent individual characters, words, or parts of words2.
-
Context Understanding: Through the attention mechanism, each token calculates its relationship with all other tokens to understand the overall context of the code.
-
Pattern Prediction: Based on patterns learned from 54 million GitHub repositories containing 159 gigabytes of Python code, it predicts the most likely next token3.
-
Code Generation: Predicted tokens are generated sequentially to build complete code fragments.
Evolution from 2021 Original Codex to 2025 New Codex
2021 Version Codex (GPT-3 Based)
The original Codex announced in August 2021 was developed based on GPT-3 and primarily functioned as the backend for GitHub Copilot3. Features of this original version included:
- Support for over 12 programming languages (Go, JavaScript, Perl, PHP, Ruby, Shell, Swift, TypeScript, etc.)
- Highest performance with Python
- Generated working solutions for 70.2% of prompts across 100 attempts3
2025 Version New Codex (o3 Based)
The new Codex announced on May 16, 2025, is based on the o3 architecture and has been significantly improved in the following ways:
- Multi-task Processing: Capable of processing multiple coding tasks in parallel
- Cloud Sandbox Environment: Each task runs in an independent, secure environment
- Real-time Progress Monitoring: Task progress can be monitored in real-time
- Optimization for Human Preferences: Generates more human-like code styles through reinforcement learning using actual pull requests1
Codex Operating Environment and Security
Secure Execution Environment
The Codex agent operates entirely within a secure, isolated container in the cloud1. This design ensures:
- Internet access is disabled during task execution
- Access only to code explicitly provided via GitHub repositories
- Use of only pre-installed dependencies
Abuse Prevention Mechanisms
Codex implements the following security measures to prevent malicious use such as malware development1:
- Identification and rejection of malicious software development requests
- Clear distinction between legitimate and malicious tasks
- Implementation of strict security assessments and policy frameworks
Codex CLI and Integration Tools
Codex CLI
OpenAI also provides Codex CLI, a lightweight open-source coding agent that runs in the terminal1. Features of this tool include:
- Access to o3 and o4-mini capabilities in local environments
- Optimized for low-latency code Q&A and editing
- Support for signing in with ChatGPT account
Integration into Development Workflows
Codex can be integrated into developer workflows in the following ways:
- ChatGPT Sidebar: Assignment of new coding tasks
- GitHub Integration: Creation of pull requests and integration of changes
- AGENTS.md Files: Setting project-specific instructions and guidelines1
Actual Performance and Benchmarks
In OpenAI’s internal benchmarks, codex-1 shows the following performance1:
- Achieved high success rates on SWE-Bench Verified
- Tested with maximum context length of 192,000 tokens
- Accurately reflects human coding styles and PR preferences
According to feedback from early testers, Codex is particularly effective for the following tasks1:
- Repetitive tasks such as refactoring and renaming
- Test creation and execution
- Bug fixing and debugging
- Drafting documentation
Transformer Limitations and Future Outlook
Current Limitations
Codex has the following limitations3:
- Performance degradation with multi-step prompts
- Generation of inefficient or quirky code samples
- Need for human verification and trial-and-error
- Influence of training data biases
Future Development Directions
OpenAI has outlined the following vision for Codex’s future1:
- More interactive and flexible agent workflows
- Guidance features during task execution
- Deeper integration with existing development tools
- Collaboration with issue tracking tools and CI systems
With further integration and feature expansion, a new standard for software development through AI collaboration is expected to be established.
Sources
- Introducing Codex - OpenAI Official Announcement (May 16, 2025)
- How does OpenAI Codex work? - Milvus AI Technical Explanation
- OpenAI Codex - Wikipedia - Wikipedia (Technical Specifications and History)