techlist.io
OpenAI2026-02-106 min read

Curated summary

Harness engineering: leveraging Codex in an agent-first world

Read original(opens in new tab)

Harness Engineering: Building a Product with Zero Hand-Written Code

OpenAI's team spent five months building an internal beta product in which every line, including application logic, tests, CI configuration, documentation, and observability, was written by Codex agents. The result is roughly a million lines of code and about 1,500 merged pull requests, produced by a team of three growing to seven engineers, at an estimated tenth of the hand-coded time. The authors conclude that the scarce resource is human time and attention, so engineering effort shifts from writing code to designing environments, specifying intent, and building feedback loops that let agents work reliably.

Starting from an Empty Repository

  • The repository was scaffolded by Codex CLI using GPT-5, guided by a few existing templates, and even the initial AGENTS.md was agent-written.
  • Early progress was slow because the environment was underspecified, not because the model was incapable. Missing tools, abstractions, and structure were the real blockers.
  • The team worked depth-first: they broke large goals into building blocks (design, code, review, test), had the agent construct each one, and then used them for more complex tasks.

Redefining the Engineer's Role

  • Humans interact mainly through prompts. Codex reviews its own changes, requests agent reviews locally and in the cloud, responds to feedback, and loops until all reviewers are satisfied, a pattern the authors compare to a "Ralph Wiggum Loop."
  • Codex uses standard tools (gh, local scripts, repository-embedded skills) to gather context directly, without humans pasting output into the CLI.
  • Human review is optional, and most review effort has moved to agent-to-agent.

Making the Application Legible to Agents

  • As code throughput grew, human QA became the bottleneck, so the team made the app itself observable to the agent.
  • The app boots per git worktree, so Codex can run one isolated instance per change. The Chrome DevTools Protocol is wired into the runtime, with skills for DOM snapshots, screenshots, and navigation, letting the agent reproduce bugs and validate fixes.
  • Each worktree gets an ephemeral observability stack (logs, metrics, traces) queryable with LogQL and PromQL, torn down when the task ends.
  • With this in place, performance-style prompts such as "service startup under 800ms" become tractable. Single Codex runs often work for six hours or more while humans sleep.

Repository Knowledge as the System of Record

  • A single large AGENTS.md failed predictably: it crowded out task context, made everything seem important (so nothing was), rotted quickly, and was hard to verify mechanically.
  • Instead, AGENTS.md (about 100 lines) acts as a table of contents pointing into a structured docs/ directory. It contains design docs with verification status and core beliefs, an architecture map of domains and layering, product specs, generated schemas, reference material in LLM-friendly formats, quality grades per domain, and versioned execution plans with progress and decision logs.
  • Progressive disclosure lets agents start from a small, stable entry point and navigate onward.
  • Linters and CI jobs check that the knowledge base is current, cross-linked, and well-formed. A recurring "doc-gardening" agent finds stale documentation and opens fix-up PRs.

Agent Legibility Drives Design Choices

  • Anything the agent cannot access in context effectively does not exist. Decisions made in Slack, Google Docs, or people's heads must be pushed into the repository.
  • The team favored dependencies that can be fully internalized and reasoned about in-repo, and "boring" technology with stable APIs and strong training-set representation.
  • In some cases it was cheaper to have the agent reimplement functionality. Instead of a generic p-limit-style package, they wrote a map-with-concurrency helper tightly integrated with their OpenTelemetry setup and covered by 100% tests.

Enforcing Architecture and Taste Mechanically

  • The team enforces invariants rather than implementations. For example, data shapes must be parsed at the boundary, but the choice of library is left open (the model tends to pick Zod).
  • Each business domain has a fixed layer sequence (Types → Config → Repo → Service → Runtime → UI), with dependencies allowed only in the forward direction. Cross-cutting concerns such as auth, connectors, telemetry, and feature flags enter through a single Providers interface.
  • Custom linters and structural tests enforce these rules, along with structured logging, naming conventions, and file size limits. Lint error messages include remediation instructions, so the agent can fix violations itself.
  • Human taste is captured continuously: review comments and user-facing bugs become documentation updates or tooling rules, and when docs fall short, the rule is promoted into code.

Changing Merge Norms

  • Gates are minimal, PRs are short-lived, and flaky tests are usually rerun rather than blocking progress indefinitely.
  • The authors argue this is only appropriate because agent throughput far exceeds human attention, which makes corrections cheap and waiting expensive.

Autonomy and Entropy

  • Agents now generate everything in the codebase: product code, CI, internal tools, docs, evaluation harnesses, review comments, repo maintenance scripts, and dashboard definitions.
  • Given one prompt, Codex can reproduce a bug, record a video, implement a fix, validate it by driving the app, record a second video, open a PR, handle feedback and build failures, escalate only when judgment is needed, and merge.
  • Full autonomy brings drift, since agents replicate existing patterns, including suboptimal ones. The team initially spent every Friday cleaning up "AI slop," which did not scale.
  • The replacement is a set of "golden principles" encoded in the repo, such as preferring shared utilities over hand-rolled helpers and validating data at boundaries rather than probing it "YOLO-style." Background Codex tasks scan for deviations and open small refactoring PRs, most reviewable in under a minute and auto-mergeable. The authors describe this as garbage collection, paying down technical debt in small continuous increments.

Open Questions

  • The strategy has worked through internal launch and adoption, but how architectural coherence holds up over years in a fully agent-generated system is unknown.
  • The authors are still working out where human judgment adds the most leverage and how to encode it so it compounds.

Practical Takeaway

The post's central lesson is that discipline moves from the code into the scaffolding: tooling, abstractions, mechanical constraints, and feedback loops. Teams adopting agent-driven development should invest in making their repository legible and enforceable for agents before expecting autonomous output, and should treat every agent failure as a prompt to add a missing capability to the repo.

Continue with another curated summary.