Software Engineering

What a Backend Engineer Should Do While the Agent Writes Code

Agents made writing code cheap, but trusting it is still your job. Here's what backend engineers should do during the run and with the hours it frees up.

·
6 min read
·
AI-assisted

AI tooling disclosure

Generative AI materially contributed to this article.

Human review confirmed by the author.

What a Backend Engineer Should Do While the Agent Writes Code

TL;DR: Writing code was never the whole job, and with agents it matters even less. Use the wait to specify and review. Spend the capacity they create on what still needs engineering judgment: boundaries, security gates and production.


A webhook that passes its tests

You ask an agent for a payment-webhook handler. It writes the handler and a test, and everything is green. Then the provider retries a delivery after a timeout, and the customer is credited twice.

Here is that failure in miniature: one ledger table, one handler, the same event delivered twice. I compared three versions of the handler under two conditions: a sequential retry and two concurrent deliveries.

Handler

Retry arrives later

Two deliveries at once

First draft: plain INSERT

❌ 2 rows

❌ 2 rows

Check, then insert (no unique key)

✅ 1 row

❌ 2 rows

Unique key + ON CONFLICT DO NOTHING

✅ 1 row

✅ 1 row

The middle row is the dangerous one. It looks right and survives the obvious test. Here is the race it loses:

sequenceDiagram
    autonumber
    participant P as Payment provider
    participant A as Worker A
    participant B as Worker B
    participant DB as Ledger table
    P->>A: deliver evt_123
    P->>B: retry evt_123 (provider timed out)
    A->>DB: SELECT evt_123
    DB-->>A: not found
    B->>DB: SELECT evt_123
    DB-->>B: not found
    rect rgb(254, 226, 226)
        Note over A,B: Race window
        A->>DB: INSERT evt_123
        B->>DB: INSERT evt_123
    end
    Note over DB: 2 rows, customer credited twice

Only a concurrent test, or a schema that enforces the rule, catches it.

The contract comes first, written before the agent runs:

def test_duplicate_delivery_is_applied_once(handler):
    handler(event)
    handler(event)  # the provider retries
    assert ledger_rows(event["id"]) == 1

And the database enforces it:

CREATE TABLE ledger (
    event_id TEXT NOT NULL PRIMARY KEY,
    amount INTEGER NOT NULL
);

INSERT INTO ledger (event_id, amount)
VALUES (?, ?)
ON CONFLICT (event_id) DO NOTHING
RETURNING event_id;

Run the insert inside a transaction. Use RETURNING to determine whether a row was actually inserted. Update the account balance only if a row was returned, and keep that update in the same transaction. If the balance update fails, roll back both operations.

Tested with SQLite 3.53 and two threads. PostgreSQL supports the same ON CONFLICT ... DO NOTHING RETURNING pattern.

That is what "specify and verify" means in practice, and it is where your time now goes.


Why this is the part that matters

A 2026 NBER working paper followed more than 500,000 GitHub developers across three generations of AI tools. For autonomous agents, commits rose 240%, projects rose 80%, and actual releases rose just 30%.

%%{init: {"xyChart": {"showDataLabel": true}, "themeVariables": {"xyChart": {"plotColorPalette": "#2563eb"}}}}%%
xychart-beta
    title "Autonomous agents: cumulative effect by stage (%)"
    x-axis ["Commits", "Projects", "Releases"]
    y-axis "Effect (%)" 0 --> 260
    bar [240, 80, 30]

Cumulative effect of adopting autonomous agents at each stage (Demirer, Musolff & Yang, NBER Working Paper 35275, 2026).

Writing got cheap. Trusting what was written didn't.

Faros AI's telemetry (22,000 developers across 4,000 teams) shows the same pressure inside companies. Its Q2 2026 report put median review time at 5x its comparison level. Its Q3 follow-up reported average PR size up 71.8%, PRs merged without any review up 76.3%, and time in QA up 300.6%.

Per-change quality looked better in the newer dataset: incidents per PR rose 242.7% among teams moving from low to high AI adoption in the earlier comparison, compared with 14.5% among teams already at high adoption in the Q3 dataset. Yet monthly incidents were still up 125.4%.

These are comparisons across different groups and relative changes, not absolute incident rates. Faros also sells engineering analytics. Still, the figures illustrate how improvements in individual changes can coexist with more incidents overall when change volume grows.

flowchart LR
    W["Write code<br/>agents made this cheap"]:::cheap --> R["Review<br/>queue forms here"]:::queue
    R --> T["Test and QA<br/>time in QA is rising"]:::queue
    T --> L["Release<br/>gains shrink here"]:::strain
    L --> O["Operate<br/>incidents rising"]:::strain

    classDef cheap fill:#dcfce7,stroke:#16a34a,color:#14532d
    classDef queue fill:#fef3c7,stroke:#d97706,color:#78350f
    classDef strain fill:#fee2e2,stroke:#dc2626,color:#7f1d1d

Green is cheap now, amber is where work queues, red is where the strain shows up.

Google's 2025 DORA report (nearly 5,000 professionals) calls AI an amplifier: teams with loosely coupled architectures and fast feedback loops gained, while tightly coupled, slow teams saw little or none.

Speed is also hard to feel. In METR's 2025 randomized trial, 16 experienced open-source developers took 19% longer with AI on tasks in repositories they already knew, despite estimating afterward that they had been about 20% faster. METR's February 2026 follow-up leaned toward speedup, but the organization called that data weak evidence because of selection effects, including developers declining to participate if they could not use AI, and difficulties measuring time when multiple agents were used concurrently.

The lesson isn't "AI slows you down." It's "measure, don't feel."


During the run: the next five minutes

These recommendations are mine, built on the evidence above. The research doesn't prescribe them directly.

1. Write the contract for the next task

Agents optimize for what you specify. Pin down what bites in production: idempotency and retries, timeouts, ordering, backward-compatible migrations, error contracts. A failing test you wrote first is the cheapest review you will ever do.

2. Review the previous diff in small slices

Review is where the queue forms, and AI-assisted changes keep getting bigger (average PR size was up 71.8% in Faros's Q3 data). Keep agent tasks narrow, and spend your attention on what tests rarely catch: transaction boundaries and locking, N+1 queries, authorization checks, and data-loss paths.

Faros recommends setting review requirements by risk and scope rather than skipping review under load. Treat AI review as a first pass, not a verdict. Faros found it associated with fewer failed changes, but that finding is correlational.


Across the day: with the capacity it creates

3. Own the seams

DORA's finding about loose coupling suggests clear service boundaries help AI-assisted teams. Sharpen module interfaces, write the ADR, or untangle the dependency you've been avoiding.

4. Keep security gates automated

Veracode found that 45% of tested coding tasks produced vulnerable code in its 2025 research. Its Fall 2026 benchmark put the vulnerability rate at roughly 38%, with average security pass rates rising from 56% to 62%.

These are benchmark results across 18 models, four languages and four vulnerability categories, not measurements of all AI-written production code. That is progress, but not a solved problem.

Run SAST, dependency and secret scanning in CI, and don't let the model that wrote the code be its only judge.

5. Watch production

More changes mean more to monitor and roll back. Keep dashboards, SLOs, canaries and runbooks sharp, and make sure you can revert quickly.

6. Keep your own skills sharp

Anthropic ran a randomized trial with 52 mostly junior engineers learning an unfamiliar async Python library. The AI group scored 50% on a comprehension quiz versus 67% for hand-coders, with the biggest gap on debugging.

In a separate qualitative analysis, participants in the conceptual-inquiry group averaged 65%. That group had just seven people, however, and the interaction patterns were not randomized. The finding suggests a useful habit, but doesn't establish that asking conceptual questions caused better results.

Caveats: it's Anthropic's own research, the sample is small, and it tested learning a new library. Still, the habit is cheap: ask why, and occasionally write the tricky part yourself.


What not to do

  • Don't start more agents than you can review. More parallel diffs just lengthen the queue.

  • Don't merge what you don't understand. In Stack Overflow's 2025 survey, more developers distrusted AI output (46%) than trusted it (33%).

  • Don't measure by feel. Track review time, change failure rate, reverts and time to production.


Caveats

  • The evidence mixes randomized trials, observational studies, vendor telemetry and surveys. They measure different things.

  • The NBER paper is a working paper, not peer-reviewed. Faros and Veracode are vendors with commercial interests.

  • Tools change quickly, so numbers from early 2025 may already be dated.


The takeaway

The job is shifting from typing code to deciding what should exist, proving it works, and keeping it healthy in production. When the agent is writing, you're not idle. You're the one who has to make sure what it wrote is correct.


Sources

Comments(0)

Join the discussion by logging into your account.

No comments yet. Be the first to comment!

Emma Clements

Passionate developer sharing knowledge about modern web technologies and best practices.

Subscribe to Emma Clements's Newsletter

Direct email dispatches when new stories are published. Zero algorithms.