llm.guideChapter 32Building and Leading an AI Engineering Team

Building and Leading an AI Engineering Team

Hiring, team shape, coding agents in your own workflow, and roadmaps.

Part 7: Product, business and team. 9 sections, about 15 minutes.

Every changeevals in CI, a human reviewEvery weekread traces, error analysisEvery model releasererun the watch list and evalsEvery quarterroadmap review, migrations plannedEvery launcha responsible AI reviewmore oftenless oftenThe same eval suite and traces are the instrument at every cadence
Every changeevals in CI, a human reviewEvery weekread traces, error analysisEvery model releasererun the watch list and evalsEvery quarterroadmap review, migrationsEvery launcha responsible AI reviewone eval suite, used at every cadence
An AI team’s operating rhythm. The highlighted cadence is the one most teams lack: a routine for every model release, which sections 32.7 and 32.8 describe.

The earlier chapters describe what an AI engineering team has to do. This one is about the team itself: whom to hire and how to tell, how to divide the work so that evals have owners, how to use coding agents without trading speed for breakage, and how to plan when the underlying technology changes every quarter.

The experiments are a simulation of a review queue as coding agents raise the number of pull requests, and published results from a randomized trial and two industry reports. Management advice is easy to state and hard to test; where a claim rests on evidence, the evidence is named.

32.1What to hire for

Hire software engineers who measure, not people who know the most model names.

Section 1.9 sized the role: an AI engineer is a backend or product engineer whose core dependency is a nondeterministic model. The skills that predict success follow from that, and most of them are not specific to AI.

SignalWhy it matters
Solid software engineeringMost of the work is the harness, data plumbing, testing and operations around the model (chapter 19)
A measuring habitReads outputs, builds a test set before arguing about prompts, and distrusts a single good example (chapter 23)
Product judgmentKnows what an error costs the user and designs for it (chapter 30)
Comfort with dataCan sample, label, clean and query traces without a data team (chapter 25)
Clear writingPrompts, guidelines for labelers and incident reviews are all writing

Some common signals are mostly noise: the number of models someone has fine-tuned, familiarity with the latest framework, prompt tricks, or a list of papers read. Each is easy to acquire and goes stale in months. A research background helps on teams that train models, and is rarely required on teams that build products on top of them.

Common take“We need people with deep LLM experience.”

Sharper take“We need strong software engineers who measure before they argue and care what an error costs the user. Model-specific knowledge goes stale in months and is the easiest part to learn.”

32.2Interviewing with work samples

Test the job: reading traces, designing an eval and reasoning about cost.

The best predictor of how someone will do the work is watching them do a small piece of it. For AI engineering, four exercises cover most of the job, each about an hour, and each works with or without AI tools in the room, as long as the policy is stated in advance.

ExerciseWhat the candidate getsWhat a strong candidate does
Debug from tracesTen traces from a RAG assistant, three of them wrongReads before guessing; locates each failure as retrieval or generation (section 15.9); proposes a test for each
Design an evalA feature description and twenty example outputsWrites failure modes first, chooses code checks over judges where possible, sizes the test set (sections 23.2 to 23.4)
Review an agent’s changeA pull request written by a coding agent, with one subtle bug and one security problemRuns or reasons about tests, finds the issues, and says what they would ask the agent to do next
System design with numbersA product brief and traffic estimatesDoes capacity and cost math (chapter 28), names failure modes and a degradation path

Score each exercise against a written rubric agreed before the interview, which is the same discipline as calibrating a judge (section 23.7): two interviewers who disagree about what good looks like will measure their disagreement, not the candidate.

Common take“We ask candidates to explain how attention works.”

Sharper take“We give candidates traces to debug, a feature to write an eval for and an agent’s pull request to review, scored against a rubric we wrote in advance. That is the job.”

32.3Team shape and who owns evals

A platform team owns the shared machinery; product teams own their test sets.

Once more than one team builds with models, two kinds of work separate. Shared machinery, the gateway to providers, the harness, tracing, the eval runner, caching and cost attribution, should be built once. Judgment about whether a feature is good, its test set, its failure modes, its prompts, belongs with the people who know its users.

Support assistantowns its test sets, failuremodes, prompts andfeature metricsSearchowns its test sets, failuremodes, prompts andfeature metricsDocument extractionowns its test sets, failuremodes, prompts andfeature metricsProduct teams own judgment about their featuresPlatform team: builds once, makes evals cheap and impossible to skipGateway, routingHarnessTracing, costEval runner, CI gateCachingevery product team uses the same machinery; each owns its own evals
Figure 32.1 The split that keeps evals owned: judgment sits with the teams that know the users, machinery with one team that builds it once.

The most common failure is unowned evals. A central team cannot write good test cases for features it does not understand, and a product team will not maintain an eval suite that someone else built. Make each test set belong to the team that owns the feature, and make the platform team responsible for making evals cheap to write, fast to run and impossible to skip in CI (section 23.8).

WorkProduct teamPlatform team
Test sets, failure modes, rubricsOwnsProvides tooling
Prompts and feature logicOwnsReviews on request
Provider gateway, routing, cachingUsesOwns
Tracing, cost attribution, dashboardsUses, defines feature metricsOwns
Model migrationsSigns off on its slicesRuns the process (section 32.8)
IncidentsOwns its features’ incidentsOwns shared-infrastructure incidents

Small companies do not need two teams, but they still need the split in responsibilities: someone owns the shared machinery even if it is a part of their job.

Common take“We’ll have a central AI team that builds all the AI features.”

Sharper take“A central team builds the machinery once; product teams build features and own their test sets. Evals without an owner who knows the users rot within a quarter.”

32.4Coding agents in your own workflow

How fast a tool feels is not how fast the team ships, so measure it.

Coding agents are now part of most engineers’ work: the 2025 DORA report, from a survey of nearly 5,000 technology professionals, put AI use among software professionals at about 90%. The evidence on what it does to speed is more mixed than the adoption suggests.

Forecast before the tasks24% fasterDevelopers’ estimate afterward20% fasterMeasured in the trial19% slowerfasterslowerchange in time to complete a task with AI tools allowed
Figure 32.2 Published figures from METR’s randomized trial with sixteen experienced open-source developers and early-2025 tools. The gap between the blue bars and the orange one is the lesson that has outlasted the tools.

In a randomized trial run by METR in the first half of 2025, sixteen experienced open-source developers completed 246 real tasks in their own repositories, each randomly assigned to allow or forbid AI tools. They expected AI to cut their time by 24%, and afterward believed it had cut it by 20%. It had increased it by 19%. Tools have improved since: METR’s February 2026 update saw signs of speedup with late-2025 tools, but judged its own new data unreliable, because many developers declined to take part if it meant working without AI. The lasting finding is the gap between perception and measurement.

The DORA report adds the team-level view: AI adoption was now associated with higher delivery throughput, and also with higher instability, more change failures and rework. More code arrives faster, and the parts of the system that check it come under strain. Practices that help:

  • Small changes. Ask agents for changes a person can review in one sitting; break large tasks into steps with a plan first.
  • Tests as the contract. Have the agent write or extend tests first, and treat passing tests in CI as necessary, not sufficient.
  • Instructions in the repository. A checked-in file with conventions, commands and boundaries gives every agent session the same context, and is versioned like code (section 13.8).
  • Sandboxed, least-privilege agents. No production credentials, network allow-lists, and changes through pull requests only (sections 19.6 and 26.6).
  • Authorship stays human. The engineer who merges the change owns it, whoever typed it.

Common take“Our developers say the agents make them twice as fast.”

Sharper take“In the one randomized trial, developers felt 20% faster while measuring 19% slower. We keep changes small, make tests the contract, and judge the tools by delivery metrics, not by how fast they feel.”

32.5The security of generated code

Generated code is fluent, plausible and often insecure, so check it the way you would check a stranger’s.

Veracode’s 2025 study gave more than 100 language models 80 coding tasks designed around known weakness types, and ran the results through static analysis. About 45% of the generated code contained a security flaw from the OWASP Top 10, and newer, larger models did no better on security than older ones, even as their code became more often correct. Agents also introduce risks of their own: a dependency name that sounds right but does not exist, which an attacker can then publish, and instructions hidden in files or issues that an agent reads (chapter 26).

An agentwrites a small changeAutomated, every changeTestsStatic analysisSecret scanningDependency checknew, unknown or unpinned packages blockedA person reviewsattention on:authentication, inputhandling, cryptography,money, personal dataMerge, deploybehind a flag
Figure 32.3 The pipeline that makes generated code safe enough to merge: machines catch the routine problems on every change, so people can spend their attention where models most often get security wrong.

The defense is the pipeline, not a promise from the model. Static analysis and secret scanning on every change, a dependency check that blocks packages that are new, unknown or unpinned, tests for the security properties that matter (authorization on every endpoint, parameterized queries), and human review focused where generated code is most often wrong: authentication, input handling, cryptography and anything that touches money or personal data.

Common take“The model writes secure code if we ask it to.”

Sharper take“A large study found security flaws in about 45% of generated code, with no improvement from bigger models. Every change goes through static analysis, secret scanning and a dependency check, and reviewers spend their attention on authentication, input handling and data.”

32.6Measuring real velocity

When code gets cheap, review becomes the bottleneck, and the metrics have to follow it.

Lines of code and pull requests per engineer were never good measures, and coding agents make them worse: both can rise while the team ships less. The DORA metrics measure the system instead: lead time from commit to production, deployment frequency, change failure rate and time to recover. Add the queue that agents create, time waiting for review.

The simulation shows why. A team of six reviews pull requests in a pooled 9 hours a day, 40 minutes per review on average. Pull requests arrive at random through the day.

02 h4 h6 h8 h0246810121416average wait for a first reviewpull requests opened per daycapacityat 40 minbefore agentstwice the pull requestssmallerchanges
02 h4 h6 h8 h0246810121416average wait for a first reviewpull requests opened per day
  • 40 minutes per review
  • 25 minutes per review
Figure 32.4 Simulation: pull requests arrive at random through an 8-hour day; the team has 9 hours of review a day in total; 120 working days, five runs per point. Waits grow sharply as review approaches capacity (the dashed line). Real teams, where specific people must review specific changes, wait longer.

At 6 pull requests a day, reviewers are busy 44% of their review time and a pull request waits about 18 minutes for a first review. If agents double that to 12 a day, reviewers are busy 89% of it and the wait grows to about 3.3 working hours, more than ten times longer, because waiting grows sharply as any queue approaches full. Cutting review time to 25 minutes, with smaller changes and automated checks that catch the routine problems before a person looks, brings the wait at 12 a day back to about 20 minutes.

So when agents raise output, invest in the checking: smaller changes, faster CI, automated review for routine issues, and explicit time for review in everyone’s week. Track the wait for review and the change failure rate next to throughput, and treat a rise in either as a cost of the speed.

Common take“Pull requests per engineer doubled after we adopted agents.”

Sharper take“Doubling pull requests can push review to the edge of capacity, where waits explode. We watch lead time, review wait and change failure rate, and spend part of the gain on making review faster.”

32.7Roadmaps when capabilities shift every quarter

Plan for models to get better, and keep a list of what they cannot do yet.

A twelve-month roadmap written against today’s model capabilities will be wrong in both directions: some planned work will be done for free by a model release, and some features that were impossible will become possible. Three habits keep a roadmap useful.

  • Prefer bets that improve with the model. Data, evals, integration and trust compound; workarounds for a model’s current weaknesses decay (sections 1.7 and 31.7).
  • Keep a capability watch list. Tasks your product needs that today’s models fail, each with a small test set. Run it at every major release; when a task starts passing, the roadmap item behind it moves up.
  • Plan in short horizons with a standing review. Commit firmly to a quarter, loosely beyond it, and hold a short review after each major model release: what got easier, what got cheaper, what should be cancelled.

The eval suite is the instrument for all three. A team that can measure a new model on its own tasks in an afternoon (section 23.5) can act on a release the week it lands; a team that relies on announcements and benchmarks waits for the industry’s opinion.

Common take“We can’t plan; the technology changes too fast.”

Sharper take“We plan for change: commit a quarter at a time, prefer work that improves as models do, and rerun a watch list of tasks today’s models fail at every release.”

32.8Model migrations as a team process

Every model your product depends on will be retired, so make migration a routine.

Providers retire models on published schedules, usually with months of notice, and new models arrive that are cheaper or better. A team that treats each change as a one-off project loses weeks to it each time; a team with a routine does it in a predictable few weeks, with the same steps and owners every time.

0wk 2wk 4wk 6wk 8wk 10wk 12wk 14wk 16Evals on the replacementplatformPort prompts that regressproduct teamsShadow production trafficplatformCanary, a small shareplatformRoll out; slices signed offproduct teamsRemove the old modelplatformbuffer for surprisesthe provider retires the old model
Figure 32.5 A migration routine for a retirement four months away: done in eight weeks, with half the time left as buffer. Each product team signs off on its own slices before the rollout.

The platform team runs the process, and each product team signs off on its own slices, which is the ownership split of section 32.3. Keep a register of every model in use, with its retirement date and owner, so no deprecation arrives as a surprise. Plan to finish well before the retirement date: the last weeks before a provider switches a model off are the worst time to discover that one slice regressed.

Common take“We’ll migrate when the provider forces us to.”

Sharper take“We keep a register of every model we use and its retirement date, and migrate with a fixed routine: evals, ported prompts, shadow traffic, canary, rollout, with each product team signing off on its slices.”

32.9Owning responsible AI

Responsible AI is a set of named owners and routines, not a statement of values.

Every chapter of Part 6 contains a piece of responsible practice: evals that include harmful and unfair outcomes (chapter 23), traces that make behavior inspectable (chapter 24), security against misuse (chapter 26) and the legal obligations of chapter 27. What turns them into a program is ownership and cadence.

  • A launch review for any new AI feature or major change: its risk tier, its failure modes and how the design handles them (chapter 30), its eval results by slice, and its data flows (section 27.2). Proportionate: an hour for a low-risk feature, more for one that makes decisions about people.
  • Red-teaming before launch and on a schedule after it (section 23.11), with findings tracked like bugs.
  • Blameless incident reviews for harmful outputs as well as outages, ending in a test that keeps the failure from returning (section 23.12).
  • Documentation that stays current: what each system is for, what it should not be used for, and how it was evaluated.
  • One accountable person with the authority to delay a launch, and a way for any engineer to raise a concern without going through their manager.

None of this needs a large team. It needs names next to each routine, and the authority to say no.

Common take“We have published our responsible AI principles.”

Sharper take“Principles without owners change nothing. We have a launch review, scheduled red-teaming, blameless incident reviews that end in tests, and one person who can delay a launch.”

Key takeaways

  • Hire strong software engineers who measure and care what errors cost users; model-specific knowledge is the easiest part to learn.
  • Interview with the job: debugging traces, designing an eval, reviewing an agent’s change, and design with numbers, scored against a rubric.
  • A platform team owns shared machinery; product teams own their test sets. Unowned evals rot.
  • In the one randomized trial, developers felt 20% faster with AI tools and measured 19% slower. Judge tools by delivery metrics.
  • About 45% of generated code had a security flaw in a large study. Static analysis, secret scanning, dependency checks and focused review on every change.
  • When agents raise output, review becomes the bottleneck: in simulation, doubling pull requests multiplied the wait for review by more than ten.
  • Plan a quarter at a time, prefer work that improves with models, and rerun a watch list of failing tasks at every release.
  • Make migration a routine with a register of models and retirement dates, finishing well before the deadline.
  • Responsible AI is owners and routines: launch reviews, red-teaming, incident reviews that end in tests, and someone who can say no.

Check your understanding

  1. You are hiring your first two AI engineers for a product team. One candidate has fine-tuned dozens of models and knows every new framework; another is a strong backend engineer who, in your exercise, read all ten traces before proposing anything and wrote a test for each failure. Whom do you hire, and why?

    Answer outline

    For a product team, the second candidate (section 32.1). Reading traces before guessing and turning failures into tests are the habits that make AI features work (chapters 23 and 24), and backend skill covers the harness and operations that are most of the job. Fine-tuning experience and framework knowledge are useful but easy to acquire and quick to go stale. The first candidate might fit a team that trains models.

  2. Six months after rolling out coding agents, pull requests per engineer are up 80%, but lead time to production has grown and incidents caused by changes have risen. What is happening, and what do you do?

    Answer outline

    Output rose faster than the capacity to check it: review is near saturation, so waits grow sharply (section 32.6), and changes are reviewed in a hurry, which matches the higher instability DORA associates with AI adoption (section 32.4). Measure review wait, change size and change failure rate. Then ask for smaller changes, strengthen automated checks (tests, static analysis, dependency checks) so routine problems never reach a person, set aside explicit review time, and judge progress by lead time and change failure rate rather than pull request counts.

  3. Your provider announces that the model behind three of your features will be retired in four months. Outline the process and who does what.

    Answer outline

    The platform team runs the routine of section 32.8: run every feature’s eval suite on the candidate replacement in the first week, port and tune prompts where slices regress (section 13.9), shadow production traffic and compare outputs, canary a small share, then roll out, finishing well before the retirement date. Each product team signs off on its own slices (section 32.3). Track cost and latency alongside quality, update the model register, and turn any regression found along the way into a permanent test.

Further reading

  • Joel Becker, Nate Rush, Beth Barnes and David Rein, “Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity” (METR, 2025), and METR’s February 2026 update.
  • DORA, State of AI-assisted Software Development (Google Cloud, 2025): AI as an amplifier of a team’s existing strengths and weaknesses.
  • Veracode, 2025 GenAI Code Security Report: the security of code from more than 100 models.
  • Chip Huyen, Designing Machine Learning Systems (O’Reilly, 2022), chapter 11: the human side of ML.
  • Chip Huyen, AI Engineering (O’Reilly, 2025), chapters 1 and 10.
  • Nicole Forsgren, Jez Humble and Gene Kim, Accelerate (2018): the research behind the delivery metrics of section 32.6.

↑↓ to move↵ to openesc to close