# openai-harness-engineering-codex-agent-first-2026-02-13

## Veille

OpenAI harness engineering: 1M lines of code, zero manual writing, Codex agents, agent-first environment engineering

## Titre Article

Harness engineering: leveraging Codex in an agent-first world

## Date

2026-02-13

## URL

https://openai.com/index/harness-engineering/

## Keywords

harness engineering, Codex, coding agents, zero manual code, context engineering, architectural constraints, garbage collection, custom linters, Tests structurels, dependency layers, structured documentation, feedback loops, agent-first, CI/CD, automated pull requests

## Authors

OpenAI

## Ton

**Profile**: Internal engineering perspective, high technical register, factual experience-report tone. Publication by an OpenAI engineering team.

**Description**: The tone is that of an internal engineering report, factual and ambitious. The article adopts a "show, don't tell" posture by presenting the results of a radical internal experiment (zero manually written code) with concrete figures. The style is direct, practice-oriented, with a structure that progresses from "what broke" to "what worked" and "what compounded." The article assumes an audience of developers and software architects familiar with coding agents, CI/CD pipelines, and large-scale engineering practices. The central message is provocative: the engineer's job is no longer to write code but to design environments for agents.

## Pense-betes

- **Radical experimentation**: a team of 3 engineers (then 7) produced approximately 1 million lines of code in 5 months without ever writing a single line manually, solely via Codex agents. Approximately 1,500 PRs merged, i.e. ~3.5 PRs per engineer per day
- **"No manually-written code" philosophy**: founding principle of the team — humans never contribute directly to the code. Engineering focuses on systems, scaffolding, and leverage
- **Definition of the harness**: the complete environment of scaffolding, constraints, and feedback loops surrounding an AI agent (repo structure, CI config, formatting rules, package manager, frameworks, project instructions, tool integration, linters)
- **Three pillars**: (1) Context engineering, (2) Architectural constraints, (3) Entropy management (garbage collection)
- **Context engineering**: structured documentation within the repo with system maps, execution plans, design specifications. Architecture decisions from Slack must be encoded as versioned artifacts within the repo. "From the agent's point of view, what is not in context does not exist"
- **Architectural constraints**: strict layered model with validated dependency direction: Types → Config → Repo → Service → Runtime → UI. Mechanical enforcement via custom linters (generated by Codex) and Tests structurels in CI
- **Smart linters**: linter error messages are designed to inject correction instructions directly into the agent's context, not simply block the code
- **Garbage collection**: recurring background Codex tasks that identify deviations from the "golden principles," update quality grades, and open refactoring PRs for auto-merge
- **Fundamental shift in role**: the engineer moves from writing code to designing environments, specifying intent, and building feedback loops
- **Martin Fowler quote**: describes harness engineering as a "valuable framing" for AI-assisted development
- **The bottleneck**: agent performance often depends more on environment design than on model intelligence

## RésuméDe400mots

OpenAI publishes an account of an internal methodology called "harness engineering" applied to agent-first development with Codex. Over five months, a team of three engineers (later expanded to seven) produced an internal beta product containing approximately one million lines of code, with zero lines written manually. Codex agents opened, evaluated, and merged approximately 1,500 pull requests, an average of 3.5 PRs per engineer per day.

The harness is defined as the complete environment of scaffolding, constraints, and feedback loops surrounding an AI agent: repository structure, CI configuration, formatting rules, application frameworks, project instructions, external tool integration, and linters. The first commit into an empty repository was generated by Codex CLI with GPT-5, guided by templates.

The approach rests on **three pillars**. **Context engineering** relies on structured documentation within the repository, organized into directories containing system maps, execution plans, and design specifications. Architecture decisions made in Slack must be encoded as versioned artifacts accessible within the repo, since from the agent's point of view, what is not in context does not exist.

**Architectural constraints** are enforced mechanically through a strict dependency-layer model (Types → Config → Repo → Service → Runtime → UI), custom linters generated by Codex, and ArchUnit-style Tests structurels run in CI. Linter error messages are designed to inject correction instructions directly into the agent's context, turning constraints into active guidance.

**Entropy management** (garbage collection) consists of recurring Codex tasks that scan the code for deviations from established principles, update quality grades, and open auto-merged refactoring PRs.

The article asserts a fundamental shift in the engineer's role: the engineer no longer codes but designs environments, specifies intent, and builds feedback loops for agents. The greatest challenge identified concerns the design of these environments, feedback loops, and control systems. The bottleneck in agent performance often lies in environment design rather than model intelligence. Martin Fowler described this approach as a "valuable framing" for AI-assisted development.

## GrapheDeConnaissance

- OpenAI —publie→ Harness engineering: leveraging Codex in an agent-first world (DOCUMENT, 0.99)
- OpenAI —mesure→ 1 million de lignes de code produites sans écriture manuelle en 5 mois (MESURE, 0.95)
- Codex —mesure→ 1500 pull requests fusionnées en 5 mois (MESURE, 0.93)
- Harness engineering —est_basé_sur→ Ingénierie de contexte (CONCEPT, 0.97)
- Harness engineering —est_basé_sur→ Contraintes architecturales (CONCEPT, 0.97)
- Harness engineering —est_basé_sur→ Garbage collection (code) (CONCEPT, 0.95)
- Contraintes architecturales —utilise→ Couches de dépendances Types→Config→Repo→Service→Runtime→UI (CONCEPT, 0.92)
- Linters custom —permet→ Instructions de correction dans contexte agent (CONCEPT, 0.9)
- Garbage collection (code) —permet→ PRs de refactoring auto-mergées (CONCEPT, 0.88)
- Martin Fowler —affirme_que→ Harness engineering est un cadrage précieux (AFFIRMATION, 0.9)
- Codex —utilise→ GPT-5 (TECHNOLOGIE, 0.85)
- Conception d'environnements pour agents —remplace→ écriture manuelle de code par l'ingénieur (CONCEPT, 0.92)

---
Canonical: https://www.thekb.eu/en/fiches/openai-harness-engineering-codex-agent-first-2026-02-13/
