Engineering for Agents: Building a Million-Line Codebase with Zero Manual Code
Discover how OpenAI built and shipped an internal beta of a software product with zero lines of manually written code, shifting the engineer's role from writing syntax to designing high-leverage agent environments.
Tecyfy · Published · Updated · 6 min read
Written in February 2026, when this was news. Models and prices have moved on since: today's are on Model prices.
Introduction
Imagine starting a new software project where your primary rule is that you are forbidden from writing a single line of code. No boilerplate, no feature logic, no unit tests, and no CI/CD configuration. Instead, your job is to design the environment, specify the intent, and build the feedback loops that allow an AI agentAgentA model that uses tools in a loop, deciding each next step from what the last one returned, until the task is done. to do the heavy lifting for you.
In February 2026 OpenAI described a five-month project where they built and shipped an internal software product with zero lines of human-written code. The resulting repository contains on the order of a million lines of application logic, infrastructure, and tooling, all generated by Codex.
What matters here isn’t just the speed, though a million lines in about 5 months is a lot, but the fundamental shift in what it means to be an engineer. When you move to an agent-first world, your value moves from the keyboard to the architecture. You stop being a writer and start being a harness designer.
The Shift: From Writing to Steering
In a traditional workflow, you spend the bulk of your day translating requirements into syntax. In an agent-first workflow, the syntax is a commodity. The OpenAI team found that their primary role shifted toward three core activities: designing environments, specifying intent, and building feedback loops.
Early on, progress was slower than expected. This wasn't because Codex could not code (the first scaffold was itself generated by Codex CLI using GPT-5), but because the environment provided to it was underspecified. The agent didn't have the right tools or abstractions to make progress on high-level goals.
When a task failed, the fix was almost never to simply "try harder." Instead, the engineers asked: "What capability is missing, and how do we make it both legible and enforceable for the agent?" This is the essence of harness engineering. You aren't fixing the code; you are fixing the system that produces the code.
The Throughput Revolution
To understand the scale of this shift, consider the numbers. A team of just three engineers (later growing to seven) managed a throughput of roughly 3.5 pull requests (PRs) per engineer, per day. This wasn't output for its own sake: the product has been used by hundreds of people inside OpenAI, some of them every day.
As the team grew, throughput per engineer went up, not down.
Making the Repository Legible to Agents
If an agent is going to maintain a million lines of code, the codebase must be optimized for the agent’s eyes, not just yours. This concept is called agent legibility.
For a human, code legibility often means clean variable names and helpful comments. For an agent, legibility means that the entire business domain can be reasoned about directly from the repository. If a decision is made in a Slack thread or a Google Doc, it effectively doesn't exist for the agent.
The "Map vs. Manual" Philosophy
One of the most practical lessons learned was how to handle context. If you give an agent a 1,000-page instruction manual, the context windowContext WindowEverything a model can see at once while it writes an answer, counted in tokens. When the window is full, something has to be left out. gets crowded. The agent starts pattern-matching locally and loses sight of the broader architecture.
OpenAI moved to a "Table of Contents" approach. They used a single, short file (AGENTS.md) of about 100 lines that acted as a map. This file contained pointers to deeper sources of truth within a structured docs/ directory.
| Context Strategy | Why it Matters |
|---|---|
| Progressive Disclosure | Agents start with a small entry point and fetch more context only when needed. |
| Versioned Artifacts | All plans, architectural decisions, and technical debt are kept in the repo so the agent can "see" them. |
| Mechanical Validation | Linters and CI jobs check the docs are up to date, cross-linked and well structured; a recurring agent looks for docs that no longer match the code and opens fix-up PRs. |
Enforcing Architecture and "Taste"
In an agent-first world, you cannot micromanage every implementation. If you try to tell the agent exactly how to write every function, you become the bottleneck. Instead, you must enforce invariants.
OpenAI used a rigid architectural model where each business domain was divided into fixed layers. Code could only depend "forward" through these layers. For example:
- Types (The foundation)
- Config
- Repo (Data access)
- Service (Business logic)
- Runtime
- UI (The surface)
This structure was enforced mechanically by custom, agent-generated linters. If an agent tried to make a UI component depend directly on a database repo, the linter would fail the PR and provide the agent with the exact instructions needed to fix the architectural violation. This is how you scale "taste" without being in every code review.
Parse, Don’t Validate
The team also leaned heavily into the "parse, don't validate" pattern. By requiring the agent to parse data into strict shapes at the boundaries of the system (the team did not pick a library; the model tended to use Zod), they ensured that the internal logic was always dealing with valid data. This reduces the number of cases the agent has to reason about, which leaves fewer places for mistakes.
The Ralph Wiggum Loop: Feedback as a Tool
How do you ensure quality when humans aren't writing the code? You build a recursive feedback loop. OpenAI refers to this as the "Ralph Wiggum Loop," where the agent is instructed to:
- Execute the task and open a PR.
- Review its own changes locally.
- Request specific agent reviews from other instances of Codex.
- Respond to feedback (human or agent-led).
- Iterate until all agent reviewers are satisfied.
Humans may review these PRs, but they aren't required to. Most of the "nitpicking" happens agent-to-agent. This allows the human engineer to stay at a high level of abstraction, focusing on the product's direction rather than syntax errors.
Observability for Agents
One of the most innovative moves was making the application's runtime legible to the agent. If an agent is fixing a UI bug, it needs to see the UI.
OpenAI wired the Chrome DevTools Protocol into the agent's runtime. This allowed the agent to take DOM snapshots, screenshots, and navigate the app autonomously. They also provided the agent with a local observability stack (using LogQL and PromQL) for every worktree.
Imagine an agent running for six hours straight while you sleep. It launches a version of the app, queries the logs to find a service startup delay, identifies a bottleneck in a trace, writes a fix, and validates that the startup time is now under 800ms. This is the real value of harness engineering: you provide the eyes and ears, and the agent provides the labor.
Tecyfy Takeaway
The transition to agent-first engineering isn't about replacing engineers; it's about upgrading their toolkit. 3 things carry over to any team using a coding agent today:
- Build the Harness, Not the Feature: Spend your time creating the linters, schemas, and test environments that keep the agent's code consistent and catch bad patterns early.
- Prioritize Repository Legibility: Treat your documentation as the system of record; a short instructions file that points to the rest is what our guide to project instructions for Claude Code recommends too. If an architectural decision isn't in a markdown file in the repo, it doesn't exist for the agent.
- Enforce Strict Boundaries: Use rigid layering and "parse, don't validate" patterns. Enforce boundaries centrally and let the agent choose freely how it solves problems inside them.
What matters most is recognizing that human time and attention are your only truly scarce resources. By shifting from writing code to engineering the harness that produces it, you can get far more done with the same engineers; OpenAI estimates its team built this in about a tenth of the time hand-written code would have taken.
Questions
- What is harness engineering?
- Designing the environment, tools and feedback loops that let a coding agent do the work, instead of writing code yourself. When a task fails, you ask what capability is missing and make it legible and enforceable for the agent, rather than prompting harder.
- How did OpenAI build a million lines of code with no manual code?
- Over about 5 months, a team of 3 and later 7 engineers had Codex write all the application, infrastructure and tooling code, at roughly 3.5 pull requests per engineer per day. The engineers designed the environment, specified intent and built feedback loops.
- What is agent legibility?
- Making the whole business domain understandable from the repository itself. A decision made in a chat thread or an outside document does not exist for the agent, so plans, architecture decisions and known debt are kept as files in the repo.
- How long should an AGENTS.md file be?
- OpenAI kept it to about 100 lines that act as a map, pointing to deeper documents in a docs folder. A long manual crowds the context window, so the agent starts small and reads more only when it needs to.
- How do you enforce architecture when an agent writes the code?
- With mechanical checks rather than reviews: fixed layers that may only depend forward, enforced by custom linters whose errors tell the agent how to fix the violation, and parsing data into strict shapes at the system's boundaries.
Sources