Agents Guide 13 of 25

Coding agents: how AI writes production software

Google says three-quarters of its new code is now AI-generated, then approved by engineers. The hard work has moved to specifying tasks, checking results, and reviewing what ships.

  • 9 min read
  • Updated 
  • 8 sources

Key takeaways

  • A coding agent is a model working in a loop with your repository, a shell, and your tests. What it returns is a diff with evidence, not a suggestion.
  • Public benchmarks flatter agents. In Scale AI’s 2025 tests, GPT-5 resolved 41.8% of public SWE-Bench Pro tasks but only 15.7% of tasks from private startup codebases.
  • Productivity gains are real but uneven, and developers’ own estimates are unreliable. Measure lead time, review wait, and change failure rate on your own repositories.
  • When agents write more code, review becomes the bottleneck. Invest in tests, precise AI review, and reviewer capacity before scaling agent output.
  • Treat an agent like a contractor with a shell: least-privilege credentials, its own branch, restricted network access, and no approving its own work.
On this page 7 sections

On 22 April 2026, Google’s chief executive, Sundar Pichai, wrote in a post for the Cloud Next conference that “75% of all new code at Google is now AI-generated and approved by engineers.” The previous fall, the figure had been 50%. Two months earlier, the independent research nonprofit METR (Model Evaluation and Threat Research) reported that its latest attempt to measure how much AI speeds up developers had produced unreliable data. The main reason: many developers declined to take part if it meant working without AI.

Both facts describe the same shift. Coding agents — AI systems that read a codebase, change it, run it, and propose the change for review — have gone from novelty to everyday tooling at many companies. The open question for engineering leaders is no longer whether agents can write code. It is where the work goes once they do.

The short answer is that it moves to specification, verification, and review. This guide covers how coding agents work, what the benchmarks do and don’t tell you, what the productivity evidence actually says, and how to adopt agents without trading stability for speed.

What is a coding agent, and how is it different from autocomplete?

Autocomplete predicts the next few lines in your editor. A chat assistant answers a question and hands you a snippet to paste. A coding agent is given a goal and pursues it in a loop. It searches the repository, reads and edits files, runs commands, reads the output, and tries again until the task passes or it gives up.

What comes back is a diff, ideally with the test output that shows it works. The loops are getting longer. In Anthropic’s internal usage data, published on 2 December 2025, the longest run of tool calls its Claude Code agent made without human input averaged 9.8 per session in February 2025 and 21.2 by August.

Coding agents come in three working shapes, and most teams end up using all three:

ShapeWhere it runsHuman roleBest forMain risk
InteractiveA developer’s terminal or editor, on a local checkoutWatches, steers, and approves risky actionsExploration, debugging, changes that need judgmentApproving prompts on autopilot
BackgroundAn isolated cloud environment: task in, pull request outWrites the task and reviews the resultWell-specified tickets, migrations, test backfillsPlausible pull requests piling up unreviewed
ReviewInside the code review system, on every changeAccepts or dismisses commentsCatching bugs and policy breaches at volumeNoisy comments that teach people to skim

GitHub’s Copilot cloud agent is a background agent: it opens draft pull requests that a human must review and merge. Uber’s uReview, covered below, is a review agent.

How does a coding agent actually do the work?

Every coding agent runs a version of the same cycle. Our guide to the agent harness covers the general machinery; here is the version specific to code.

  1. Orient. Read the task and any repository instructions file, then search the code for the relevant modules. Agents search rather than read everything: most real repositories exceed the model’s context window, and padding it with irrelevant code costs money and dilutes the model’s focus.
  2. Plan. Decide which files change and how the result will be checked. For ambiguous work, a human glance at the plan is the cheapest correction you will ever make.
  3. Edit. Change the files, usually with targeted replacements rather than full rewrites.
  4. Check. Build, run the tests, run linters and type checkers, or start the app and look at it.
  5. Iterate. Read the failures, fix them, and check again. This is the step that separates an agent from a chat assistant.
  6. Hand off. Present the diff with evidence: the commands run, their output, and anything still uncertain.

Step 4 sets the ceiling. An agent decides it is done when the code seems right, and without a test, build, or screenshot that can fail, seeming right is all it has to go on. Then your reviewers become the test suite. A repository with fast, trustworthy tests gets a far better agent than one without them, whichever model sits underneath.

The instructions file is the other cheap lever. Agents begin each session knowing nothing about your conventions, so a short checked-in file with build commands, test commands, and house rules pays for itself quickly. Keep it short; a rule buried in a long file is a rule the agent will miss.

What do coding benchmarks measure — and where do they stop?

SWE-bench (SWE stands for software engineering), published by researchers at Princeton and the University of Chicago on 10 October 2023, turned real GitHub issues into a test. It gathered 2,294 issues, and the pull requests that resolved them, from 12 popular Python projects. A task counts as solved only if tests that failed before the original fix now pass and existing tests still do. The best model at the time, Anthropic’s Claude 2, solved 1.96%.

SWE-bench Verified, a 500-task subset that OpenAI had expert engineers screen in 2024, became the industry’s headline coding number. On 23 February 2026, OpenAI explained why it had stopped reporting it. The top score had crept from 74.9% to 80.9% in six months. When OpenAI audited 138 problems its o3 model could not solve reliably, it found flawed tests or task descriptions in 59.4% of them.

Some of those tests rejected correct fixes; others demanded behavior the issue never asked for. OpenAI also found that every frontier model it checked could, for some tasks, reproduce the original human fix or details of the problem statement word for word. That is strong evidence the answers had leaked into training data.

OpenAI now recommends reporting the public set of SWE-Bench Pro, released by Scale AI on 21 September 2025. Its 1,865 tasks come from 41 actively maintained repositories in Python, Go, TypeScript, and JavaScript. The reference fixes average 107.4 lines across 4.1 files, far closer to a real ticket than a one-line patch.

The public tasks come from projects under copyleft licenses, chosen because those licenses discourage use in commercial training data. A separate commercial set comes from 18 private startup codebases. That split produces the most useful number in the paper: in its November 2025 revision, GPT-5 at high reasoning effort resolved 41.8% of public tasks but only 15.7% of the commercial ones.

Some of that gap may reflect harder tasks, but the direction is the lesson. Code no model has seen, written to someone else’s conventions, is harder than public leaderboards suggest — and your repository is exactly that kind of private set. Scores also depend on the harness. The paper ran every model through one open-source scaffold, SWE-agent, capped at 50 turns, after finding that another, Agentless, struggled with multi-file edits.

What does the productivity evidence say?

The strongest claims come from companies that build the tools. Google’s 75% counts code that engineers approved, and Pichai also said one complex migration finished six times faster than engineers alone managed a year earlier. Note what a share-of-new-code metric measures: volume, not outcomes.

Anthropic surveyed 132 of its engineers and researchers in August 2025. They reported using Claude in 59% of their work, up from 28% a year earlier, and an average self-reported productivity gain of 50%. Merged pull requests per engineer per day rose 67% after the company adopted Claude Code across engineering.

Yet more than half said they could fully delegate only 0–20% of their work; the rest needed active supervision and checking. Anthropic itself notes its engineers are unusually well placed, with early access to the newest tools.

Independent evidence is more mixed. In METR’s randomized trials, experienced open-source developers working in early 2025 took 19% longer on tasks when AI tools were allowed. A late-2025 follow-up with 57 developers pointed the other way: an 18% time saving for returning participants and 4% for new ones.

Neither estimate is solid. The confidence intervals run from clear savings to a small slowdown, and 30–50% of developers said they had skipped submitting tasks they did not want to do without AI. Those are probably the tasks where AI helps most. That selection, plus developers who declined to join at all, is why METR calls the new data unreliable and is redesigning the study.

Our reading of the evidence comes to three conclusions. Gains look largest on well-specified, verifiable work such as migrations and test-backed fixes. They look smallest for experts working in code they already know deeply. And developers’ own estimates are a poor instrument — METR found them unreliable in its earlier study — so measure outcomes directly.

Why does code review become the bottleneck?

When agents write more code, someone still has to read it. Uber’s engineers say this plainly: reviewers were swamped by the growing volume of AI-assisted changes. Their response, uReview, described on 12 August 2025, analyzes over 90% of the roughly 65,000 diffs — Uber’s equivalent of pull requests — that land each week.

The design is a lesson in precision over volume. Separate generators look for bugs, best-practice breaches, and security issues. A grading step then scores each draft comment’s confidence, low scorers are dropped, and near-duplicates are merged before anything is posted.

Engineers mark 75% of uReview’s comments as useful, and more than 65% are addressed. Comments about style, readability, minor logging changes, and low-stakes performance tweaks drew poor ratings, so a classifier now suppresses categories with a weak track record. Uber built in-house because its reviews run on Phabricator, not GitHub, and because outside tools produced too many false positives.

The general rule follows. AI review is a filter that helps humans spend attention well, not a substitute for an accountable reviewer. Every noisy comment trains people to skim, and skimmed review is how bad agent code reaches production.

How do you keep a coding agent from becoming a security incident?

A coding agent reads untrusted text — issues, comments, dependency code, web pages — and runs commands with whatever credentials it holds. That combination invites prompt injection: instructions hidden in content that the agent then follows. Treat the agent like a new contractor with shell access, not like a compiler.

GitHub’s published controls for its Copilot cloud agent make a sound checklist, whichever tool you use:

  • Only people who can already write to the repository can assign it work.
  • It can push to a single branch: a new branch of its own, or the pull request it was asked to update.
  • The person who requested the work cannot approve the resulting pull request.
  • By default, continuous integration (CI) workflows do not run on its code until someone with write access approves them.
  • Its internet access is restricted, and hidden characters are filtered out of user input before the agent sees it.

Separation of duties is the control that is easiest to forget. If an agent works on someone’s behalf, that person is its co-author, not its reviewer.

What this means for your team

  • Make work checkable before you delegate it. Fast, reliable tests, type checks, and a one-command development environment raise every agent’s ceiling. If a task has no check that can fail, keep a human driving it.
  • Start where verification is cheap. Migrations, dependency upgrades, test backfills, and bugs with a reproducing test suit agents well. Architecture, ambiguous product work, and security-sensitive code still need people in charge.
  • Write the context down. A short repository instructions file and tickets with acceptance criteria often help more than a newer model. Review, version, and prune both like code.
  • Run your own evaluation. Replay 20–50 recently closed tickets from the commit before each fix, and grade the agent’s work against what actually merged. That predicts more than any leaderboard.
  • Measure outcomes, not volume. Track lead time, review wait, change failure rate, and reverts. A rising share of AI-written code is an input, not a result.
  • Budget review capacity. Throttle agent output to what reviewers can absorb, tune AI review for precision, and keep a named human accountable for every merge.
  • Protect your engineers’ skills. Some Anthropic engineers worried that supervising agents takes exactly the expertise heavy delegation erodes. Keep hands-on work in rotation, especially for junior engineers.

We hold the agents we build at SurgeX Labs to the same rule: no task is delegated until there is a check that can fail.

Sources

  1. Cloud Next ’26: Momentum and innovation at Google scale (opens in new tab) — Google (The Keyword), 2026 blog.google

  2. SWE-bench: Can Language Models Resolve Real-World GitHub Issues? (opens in new tab) — Princeton University and University of Chicago (arXiv), 2023 arxiv.org

  3. Why SWE-bench Verified no longer measures frontier coding capabilities (opens in new tab) — OpenAI, 2026 openai.com

  4. SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks? (opens in new tab) — Scale AI (arXiv), 2025 arxiv.org

  5. How AI is transforming work at Anthropic (opens in new tab) — Anthropic, 2025 anthropic.com

  6. We are Changing our Developer Productivity Experiment Design (opens in new tab) — METR, 2026 metr.org

  7. uReview: Scalable, Trustworthy GenAI for Code Review at Uber (opens in new tab) — Uber Engineering, 2025 uber.com

  8. Risks and mitigations for GitHub Copilot cloud agent (opens in new tab) — GitHub Docs, 2026 docs.github.com

Building this? Talk to an engineer.

If this guide maps to a system you’re planning, send a short brief. A senior engineer replies within one business day.