Speaker Notes

Building Codex with Tibo Sottiaux

Building OpenAI's Codex involved choosing Rust for structural correctness, open-sourcing for community feedback, scaling execution to the cloud, and continuously shrinking harness complexity as base models advance.

The Pragmatic Engineer · 1:14:23 · YouTube ↗

Podcast episode · host and guest  Intermediate · architectural strategy and language choice

Highlights

10 clips · 15 min of 74 min
    • Always question the true impact and product-market fit of a project rather than relying solely on product manager reassurance.
    • A lack of proper feedback loops and low user scale will inevitably doom an internal initiative.
    • Experiencing early project failures instills a lifelong habit of critically evaluating the importance of what you build.
    • Rust was chosen for Codex to prioritize robustness, security, and compile-time verification from first principles.
    • Statically verified code provides structural advantages and reliability when building autonomous agents.
    • Building the core agent in a distinct language enforced a clean architectural separation from the product interface.
    • Rust provided static validation and compile-time correctness for the agent.
    • A separate language boundary prevented sloppy code intertwining with the main product.
    • Clean separation between the agent and product codebase enables long-term innovation.
    • Open-sourcing Codex streamlined team onboarding since new hires were already familiar with the public repository.
    • Building in the open fostered community energy, feedback, and valuable external contributions.
    • The downsides included managing feature noise, maintaining artificial repo boundaries, and having unreleased features copied by competitors.
    • Open-sourcing the repo makes employee onboarding nearly instant using Codex itself.
    • Downsides include managing a tsunami of noisy contributions and competitors copying unreleased work.
    • Building in the open fosters strong community energy and direct engagement.
    • Coupling an agent harness to a single model provider creates unnecessary friction and forks.
    • Supporting multiple model providers grants users essential optionality and feedback.
    • Winning on product merit rather than vendor lock-in attracts top-tier engineering talent.
    • Local execution ties agents to limited local CPU and resource availability.
    • Cloud execution via managed VMs scales compute and spares developer hardware.
    • Future agents will require massive cloud compute that exceeds local laptop capacity.
    • The harness is always slightly ahead, using crutches and prompts to enforce reliability.
    • Guardrails and developer messages guide model behavior until the model natively learns the task.
    • As base models improve through training, the harness code naturally shrinks over time.
    • Models can spot deep logic and dependency bugs that take humans hours to find.
    • Automated security checks now block pull requests with critical vulnerabilities across OpenAI.
    • Code review is shifting from syntax verification to evaluating high-level intent.
    • Specialized code review models can spot complex logic and dependency errors beyond human reach.
    • Automated verification handles deep dependency tracking that would take humans hours to audit.
    • Security checks run automatically, blocking pull requests with critical vulnerabilities.
    • The merge combined a fully local coding agent with a managed cloud stack for massive scale.
    • Cloud Codex runs in a powerful environment with internet access and broad tool permissions.
    • Merging disparate systems required unifying plugins, libraries, and architectures rapidly.
    • Deep curiosity and the ability to grok new systems quickly are vital traits.
    • Clear intent and strong product taste matter more than ever.
    • Understanding the needs of the community you build for drives great work.

Questions this video answers

7 · every answer cites the moment it was said
01 Why did the team choose Rust to build Codex when models weren't yet optimized for it? 2 sources · 19:06

The team chose Rust from first principles to ensure the agent's core was robust, secure, and engineered for high scale and efficiency. Although the model wasn't initially well-optimized for Rust, they believed compile-time validation would benefit agents and that Rust would quickly become viable with effort. They prioritized structural correctness and clean architectural boundaries over immediate language convenience.

02 Why did OpenAI decide to open-source the Codex CLI, SDK, and app server? 2 sources · 21:57

Open-sourcing allowed the team to build a coding agent while actively pointing it at itself to gather direct community feedback and contributions. They recognized that open source and the role of code were changing, making direct participation in the developer community essential. It also provided a level playing field that encouraged widespread tinkering and exploration during the early days of coding agents.

03 Why does Codex support other model providers instead of just OpenAI? 2 sources · 26:24

Codex supports multiple model providers to give users optionality and avoid artificial vendor lock-in. Forcing users onto a single model would create unnecessary forks and prevent the team from learning from other models.

04 How are AI models changing the role of code reviews? 2 sources · 48:39

Automated code review models now handle deep logic verification and security checks that previously required hours of human effort. This shifts human discussion away from syntax and toward high-level intent and architecture. Pull requests flagged with security vulnerabilities are now blocked automatically.

05 How does AI impact the cost and process of software maintenance? 2 sources · 52:45

Routine maintenance tasks like dependency upgrades are now fully automated by models that can read change logs and update codebases. Rearchitecting systems also happens much faster because models reduce the friction of rewriting legacy code. Consequently, the maintenance tax on software projects is significantly lowered.

06 When are rigid harnesses like slash goal no longer needed? 2 sources · 1:01:54

Rigid harnesses were originally necessary as a crutch to keep models on track for multi-day tasks. With newer, more advanced generations of models, these explicit goal harnesses are no longer required. Developers can simply instruct the model to work independently for a week without extra constraints.

07 What were the main engineering challenges when merging Codex and ChatGPT? 2 sources · 1:03:33

The merge required combining completely different stacks, moving from a fully local coding agent to a managed cloud-based system. The team had to build a cloud environment capable of running the full Codex harness alongside a powerful cloud computer. This unified product allows tens of millions of users to access the same advanced intelligence efficiently.

Section-by-section summary

15 parts

Foundational background in applied mathematics and optimization

Tibo started his tech journey by founding an applied mathematics startup focused on complex supply chain optimization problems. Using traditional non-ML methods like Monte Carlo simulations, the company solved large-scale industrial problems across pharmaceuticals and steel. This deep foundational background in mathematical modeling shaped his systematic approach to software engineering.

Early insights from Google, DeepMind, and internal chatbots

Working at Google on web performance and later Google Maps provided a front-row seat to massive scale and organizational constraints. At DeepMind, he witnessed early large language model experiments and built an internal chatbot that spread virally before ChatGPT. However, Google's rigid production machinery made launching external products difficult, prompting a desire for a more agile environment.

Transitioning to OpenAI to build internal agent tooling

Drawn to OpenAI's clear mission and remarkably small, autonomous engineering teams, he joined to work on cutting-edge reasoning and research infrastructure. He quickly pivoted to building internal agent tools trained on OpenAI's codebase to accelerate researchers. Encouraged by leadership, this internal productivity experiment evolved into the Codex product sprint.

Enforcing architectural boundaries with Rust for Codex

The decision to build Codex in Rust was driven by a first-principles focus on security, scale, and compile-time correctness, even though models weren't initially optimized for the language. Establishing a strict Rust boundary separated the core agent from the product interface. This architectural choice prevented tight coupling and enabled robust, scalable agent execution.

Navigating the benefits and costs of open-sourcing Codex

Open-sourcing the Codex CLI, SDK, and app server created powerful community engagement and simplified new hire onboarding since the codebase was already familiar. While it fostered direct collaboration, it also introduced downsides like maintaining multi-repo boundaries and dealing with competitors copying unreleased features. Despite these costs, building in the open aligned with the evolving nature of software development.

Permissive model support prevents vendor lock-in

Allowing Codex to run with third-party models rather than just OpenAI's ensures users retain optionality and forces the team to compete on merit. Forcing a proprietary stack would alienate users and discourage top engineering talent from joining.

Execution shifts from local sandboxes to cloud environments

Codex runs locally in a sandboxed environment by default to leverage local tools and databases, but is shifting toward cloud VMs. Cloud execution reduces laptop resource strain and allows agents to leverage significantly more compute.

Harnesses act as crutches until models catch up

The harness is always slightly ahead of the model, providing guardrails, safety measures, and developer prompts to ensure reliable behavior. As underlying models improve, both the developer message and the harness code naturally shrink.

Internal culture relies heavily on Codex for daily workflows

New engineers at OpenAI use Codex to query internal Slack, documents, and codebases to get up to speed immediately. Teams ship code rapidly to billions of users by instilling a strong sense of ownership and automating deployments.

AI-driven code review automates deep correctness checks

Automated code review models now surpass humans at spotting complex logic errors and security vulnerabilities across deep dependencies. Consequently, human involvement in reviews is shifting from line-by-line correctness checking to discussing high-level intent.

Automated maintenance dramatically lowers technical debt

Routine maintenance tasks like dependency upgrades and large-scale refactoring are now fully automated by models. This drastically reduces the long-term tax of keeping systems running, though good modular architecture remains crucial.

Software engineering shifts from craft to problem-solving

While losing manual coding rituals can sting, engineers rapidly adapt to using agents to solve vastly more problems. The focus moves away from tedious debugging toward rapid prototyping and system-level outcomes.

Advanced models eliminate the need for rigid harnesses

Earlier agent workflows required strict harnesses like goal-tracking commands to keep models on track. Newer model generations are capable of autonomous long-running tasks for days or weeks without specialized scaffolding.

Merging local Codex with cloud ChatGPT

Bringing Codex into ChatGPT required bridging local coding agents with a managed cloud stack to serve hundreds of millions. Interestingly, Codex itself acted as a journalist, logging all internal debates and Slack discussions during the merge.

Essential skills for the AI software era

Succeeding as a modern developer requires deep curiosity, rapid system comprehension, and strong product taste. Engineers must focus on clear intent and understanding the community they build for rather than just low-level coding.

0:00 / 1:14:23
k play/pause · f fullscreen · m mute
n next · p previous clip · t highlights/full
< > slower/faster · / search what was said
  • Codex31× · first 0:14

    An AI coding harness and agent built by OpenAI to help developers and researchers write software.

  • Rust5× · first 0:14

    A systems programming language chosen for Codex to enforce correctness, safety, and scalability.

  • Kata container1× · first 33:19

    A secure container environment used for running cloud-based agent executions.

  • Slash goal2× · first 1:01:46

    A command used to keep models on track for long-running, multi-day tasks.