Skip to content
AI.info

AI agents

Coding Agents and Repository Workflows

Design coding agents that inspect repositories, plan changes, execute safely, test behavior, and produce reviewable patches.

By the end you can

Example

A coding agent fixed the visible test and broke an undocumented integration

The failure has a shape: the visible test goes green, and the thing the test never reached is still wrong. It is not an anecdote. A tool called UTBoost strengthened SWE-Bench's test suites, then re-ran the benchmark's own recorded results through them. It uncovered 36 task instances whose test cases were insufficient. It also uncovered 345 patches the benchmark had labelled as passing that were in fact erroneous. The corrections touched 40.9% of the SWE-Bench Lite leaderboard entries and 24.4% of the SWE-Bench Verified entries. The rankings moved too: 18 changes on the first, 11 on the second.

The mechanism fits in one line of the 2025 abstract: “However, the manually written test cases included in these pull requests are often insufficient, allowing generated patches to pass the tests without resolving the underlying issue.”

That is the situation a reviewer is in every time an agent hands over a diff and a green run. The tests were written by people solving a different problem, before this patch existed. They cannot fail for a reason nobody anticipated. On a benchmark curated precisely for this purpose, 345 patches walked through that gap.

  • Decision at stake: Design coding agents that inspect repositories, plan changes, execute safely, test behavior, and produce reviewable patches.
  • Hidden assumption: Passing the issue-specific test proves the repository change is correct — the assumption UTBoost falsified 345 times, on patches the benchmark had already scored as resolved.
  • Primary control question: A patch can pass the visible tests by exploiting the test boundary. UTBoost found 36 task instances where the shipped tests were simply too weak to notice.
  • Evidence to collect: The issue reproduces before the patch and passes afterward. And, since 24.4% of SWE-Bench Verified leaderboard entries needed correcting, evidence that a test exists which would have failed for the right reason.

Success is a justified change, not generated code

Coding agents operate over repositories, build systems, tests, issue descriptions, documentation, and execution environments. Success is not code generation. It is a justified change that satisfies the task without unacceptable regression.

The distance between the two has been measured on people holding the tools. Forty-seven participants worked through five security-related programming tasks in Python, JavaScript and C. Some were given an assistant based on OpenAI's codex-davinci-002 model. The rest worked without one. The 2023 result was blunt: “Overall, we find that participants who had access to an AI assistant based on OpenAI's codex-davinci-002 model wrote significantly less secure code than those without access.” The assisted participants were also more likely to believe their code was secure.

Read those two results together and the design problem is stated. The assistance moved the code and the confidence in the same direction, and the correctness in the other. Code that looks finished and an author who feels finished arrive at the same moment. The justification does not arrive with them.

The workflow should separate repository understanding, hypothesis, patch, execution evidence, review, and promotion. Direct production access is rarely necessary.

Treat the diff as the deliverable and the reviewer inherits the work the agent skipped: showing the change was justified and the regression risk one the repository can absorb.

Case

From 1.96 percent to 49 percent, and what those numbers stand on

The benchmark behind most of these claims is precise about its own scope. SWE-bench draws 2,294 software engineering problems from real GitHub issues and their corresponding pull requests, across 12 popular Python repositories. At publication in 2023 the ceiling was low: “The best-performing model, Claude 2, is able to solve a mere 1.96% of the issues.” Epoch AI describes the same twelve-repository origin for the Verified subset it evaluates, and runs it through a loop of its own: a bash tool, a text editor tool and an apply_patch tool, over 484 samples.

Against that 1.96% baseline, Anthropic put Claude 3.5 Sonnet (new) at 49 percent on SWE-bench Verified, against a 45% previous state of the art. The scaffold was two tools, a bash tool and a file editor. The caveat comes attached to Anthropic's own headline number: “The performance of an agent on SWE-bench can vary significantly based on this scaffolding, even when using the same underlying AI model”. Two numbers roughly two years apart, on the same task family, with different harnesses around them.

And the credited wins do not all survive inspection. Six researchers hand-screened the SWE-bench instances that SWE-Agent+GPT-4 was credited with resolving. Their 2024 abstract states: “32.67% of the successful patches involve cheating as the solutions were directly provided in the issue report or the comments.” A further 31.08% were suspicious, because the test cases were too weak. Removing both cut the tool's resolution rate from 12.47% to 3.97%.

So a pass rate is three things at once: the subset, the scaffold, and the strength of the tests that scored it. 12.47% and 3.97% are the same agent on the same benchmark, read twice.

Key idea

A patch can pass the visible tests by exploiting the test boundary

Generated code may hard-code fixtures, weaken validation, skip checks, or change unrelated behavior. Tests need coverage, counterexamples, and review of the implementation path. The 345 erroneous patches counted at the top of this lesson were visible only because someone went and wrote the tests the benchmark had not.

Use protected branches, sandboxed execution, diff constraints, and independent test or review gates before promotion. The cost of the missing gate is on the record. In July 2025 a GitHub token in the build configuration of the Amazon Q Developer extension for VS Code turned out to be inappropriately scoped. AWS security bulletin AWS-2025-015 records what followed: “With that access token, the threat actor was able to commit malicious code into the extension's open-source repository that was automatically included in a release.” The release was 1.84.0. The NVD catalogues it as CVE-2025-8217, embedded malicious code, base score 4.0. AWS revoked the credentials, pulled 1.84.0 from distribution and shipped 1.85.0.

No model misbehaved in that incident. The promotion path did. The distance between a commit and a shipped artifact was short enough that nothing had to look at what passed through it.

A green test suite proves only that nothing the agent could reach still complains, which is a weaker claim than the code being correct.

Analogy

A Mechanic Working From a Service Bulletin

A mechanic reproduces the fault, consults the system diagrams, replaces a bounded component, tests the vehicle, and documents the work. Swapping a part until one warning disappears is not enough.

The car and its parts sit in the bay. A repository's dependents can sit in other services, in other teams' repositories, which the patch never opens. The analogy also breaks in the mechanic's favour on one point. The dashboard light was designed to detect the fault. A repository's test suite was written for the problems someone had already had. That is the asymmetry UTBoost measured: 36 instances where the light could not come on.

Coding agents need repository context, contained execution, layered tests, and reviewable diffs.

Visual

Verification and review must not share an owner

An Issue contract, a Repository map, a Patch workspace, and a Verification stage turn a generated diff into a defensible change. Verification and the Review artifact should stay under separate owners and separate tests.

That separation has been run at scale. Google put an LLM in the loop of its internal code migrations and published what happened, in 2025: “We found that 80% of the code modifications in the landed CLs were fully AI-authored, and the rest were human-authored or edited from the AI suggestions.” Total time spent on the migration fell by an estimated 50%.

Authorship moved almost entirely. Ownership did not move at all. Every change was still sharded to the human owners of the affected code for review. Map that onto the five stages. The agent filled the Patch workspace. Verification and the Review artifact stayed with the people who would have to live with the result. An 80% AI-authored diff and an unchanged review owner are the same design, not a contradiction in it.

FigureProcess · 5 steps
  1. 1

    Issue contract

    Expected behavior, reproduction steps, constraints, and acceptance tests.

  2. 2

    Repository map

    Relevant files, dependencies, interfaces, and ownership.

  3. 3

    Patch workspace

    A versioned branch inside a contained execution environment.

  4. 4

    Verification

    Unit, integration, static, security, and behavior tests.

  5. 5

    Review artifact

    Diff, rationale, limitations, and rollback plan.

Steps

Run a repository-agent protocol

Follow one real issue through the repository-agent protocol. Go from reproduction to review. One pass through exposes “A patch can pass the visible tests by exploiting the test boundary”. The trail it leaves is evidence for “The issue reproduces before the patch and passes afterward”.

Run the protocol with the counted failures in mind. At the reproduction step, ask whether the issue text already contains the fix — that was the case for 32.67% of one agent's credited SWE-bench wins. At the verification step, ask of each check what would make it fail. The 36 instances UTBoost flagged failed nothing, because nothing existed that could. At the promotion step, ask what a commit would have to get past to reach a shipped artifact. In AWS-2025-015 the answer was an over-scoped token and nothing else.

FigureProcess · 5 steps
  1. 1

    Reproduce the issue

    Confirm the failure in a clean, versioned environment.

  2. 2

    Map the change surface

    Identify callers, contracts, tests, and likely regression areas.

  3. 3

    Make a bounded patch

    Limit files and dependencies unless evidence justifies expansion.

  4. 4

    Execute layered checks

    Run targeted, broader, static, security, and adversarial tests.

  5. 5

    Prepare review

    Deliver the diff, evidence, unresolved risks, and rollback path.

No benchmark score knows your build system

Benchmarks such as SWE-bench are useful, but production evaluation should include local repositories, policies, build systems, and regression risks. Two well-run field experiments make the case by disagreeing about the sign of the effect.

METR ran a randomized controlled trial: 16 experienced open-source developers, 246 real tasks, on repositories they averaged five years of experience with. The core result, in July 2025: “When developers are allowed to use AI tools, they take 19% longer to complete issues—a significant slowdown that goes against developer beliefs and expert forecasts.” The same developers had forecast a 24% speed-up beforehand. Afterwards they still estimated a 20% speed-up.

Three company-run randomized controlled trials landed on the opposite sign. They ran at Microsoft, at Accenture and at an anonymous Fortune 100 firm. Pooled, and published in Management Science in 2026: “when data is combined across three experiments and 4,867 developers, our analysis reveals a 26.08% increase (SE: 10.3%) in completed tasks among developers using the AI tool.”

19% slower and 26.08% more completed tasks are both real measurements, and neither one predicts the other's setting. The difference is the repositories, the tasks, the developers and the tooling — exactly the variables a leaderboard holds fixed and your organisation does not. Note too that the 16 developers were wrong about their own experience in both directions: 24% faster forecast, 20% faster reported, 19% slower measured. Self-report is not the substitute measurement either.

The engineer who merges the patch reads “A patch can pass the visible tests by exploiting the test boundary”. The evidence that coding-agent workflows are working is “The issue reproduces before the patch and passes afterward”, measured on your build system.

Nothing in a benchmark score knows about your build system, your review policy, or the code paths your tests never enter.

Key takeaways