← All writing
Writing

Your Agents Ship Code Faster Than You Can Check It

AI & Agents · Engineering
A plum inspection press checks an ivory tile beside a dark tile held in an ivory checkpoint with a vertical stop pin, while one green-edged piece rests in front.

Where verification belongs, when PR gates earn their keep, and what a direct-main alternative requires.

An agent finishes a change. It sits in a review queue: code you've already paid to write, waiting to become useful.

Removing the PR could remove that wait. It wouldn't answer whether the change does the right thing, what it can damage, or who's available when it fails.

Verification is the work. PR review is one place to do it.

Some teams need stronger merge gates. A small, trusted team with mature checks might assess a narrow direct-main flow, moving more responsibility to the person shipping and the release boundary. Neither model makes verification every team's bottleneck. Planning, deployment, and approvals can still dominate.

For a CTO, the decision is where to demand evidence before accepting code or exposing its effects. That decision spends engineering attention now, or release and recovery capacity later.

Here's the stack I use, my PR pipeline, and a contrasting model to assess.

What the PR reports show

Faros AI's AI Engineering Report 2026 compared each team's two lowest-AI-adoption quarters with its two highest. Tasks completed per team with an associated PR rose 210%. Median wait for first review rose 156.6%, and median time in review rose 441.5%.

LinearB's 2026 Software Engineering Benchmarks Report compared PR categories instead. P75 pickup time was 1,055 minutes for agentic PRs versus 201 for unassisted PRs: the wait for review to start at the 75th percentile.

These are observational comparisons, not proof that AI caused the delays. Elapsed review time isn't active reviewer labor. Both describe sampled PR workflows, not every team shipping directly to main.

I heard it in plainer words from a room full of PE portfolio CTOs: QA is where the work piles up now.

That's a reason to inspect your service's wait and defects. Not a diagnosis to import.

The check survives the workflow

Agent code can compile, follow local patterns, and implement the wrong behavior. Bigger, unfocused changes make intent harder to trace. A one-line permission change can still carry more risk than a large documentation update.

A second agent helps inspect that work. Agreement isn't independent proof.

In Kim et al.'s study, model pairs chose the same wrong answer 60% of the time on average when both were wrong on HELM multiple-choice questions. That's conditional agreement on benchmark errors, not a PR-review miss rate.

Later studies examine multi-judge panels and cross-provider judging, including a limited code-judging screen. None measures my writer-reviewer pipeline. Test your reviewer against defects that matter in your codebase.

The same problem exists without a PR: somebody still needs evidence about behavior, scope, and effects.

Keep three boundaries separate:

  • Before push: local tests check the working revision in that environment. Running them by convention isn't an enforced server gate.
  • Before merge: required checks can govern PR admission to main under the effective repository policy.
  • Before release: post-push CI can block deployment. It can't keep a commit off main after the push has succeeded.

A broken commit on shared main can affect other engineers and automation even while deployment is blocked. Removing a PR moves that exposure. It doesn't erase it.

The five-layer verification stack

Lauren Tan (@poteto) described a four-layer inverse pyramid on October 16, 2026: codebase improvements, static analysis, prose, then human review.

Her first layer: "better architecture, stronger types and invariants, clear boundaries. agents love to copy what exists."

My reading: push recurring corrections into mechanisms that apply to future changes. I add evals between automated code checks and prose.

Tests check the code. Evals check the agents writing and reviewing it.

An eval uses versioned cases with expected outcomes or scoring criteria. Rerun it when the model, prompt, or tools change. I cover the mechanics in Building Private AI Evals.

Layer

What it catches

What it misses

Put it to work

1. Codebase structure

Invalid states and access that enforced boundaries prohibit.

Wrong intent expressed through valid code.

Database constraints, foreign keys, narrow interfaces, and one clear pattern per job. Remove obsolete patterns agents could copy.

2. Static analysis, tests, and CI

Type errors, known bad patterns, security findings, and regressions covered by checks.

Untested behavior and incorrect assumptions shared by code and tests.

Strict tsc or mypy. ESLint, Ruff, or golangci-lint rules. Semgrep or CodeQL. Unit, integration, and migration-safety checks.

3. Agent evals

Regressions represented in the cases: missed defects, ignored conventions, out-of-scope edits.

Failures outside the cases, or cases that have gone stale.

Representative writer tasks and seeded defects for the reviewer. Name an owner and rerun before agent changes.

4. Prose rules and skills

Guidance about intent, conventions, and when to ask.

Anything the agent ignores or misinterprets.

A short AGENTS.md and task-specific skills. Back enforceable rules with access restrictions or automated checks.

5. Human review

Wrong intent, scope creep, tradeoffs, and risk requiring organizational context.

Details and interactions the person doesn't inspect or anticipate.

Inspect risky work against the task. Turn recurring catches into checks.

Static analysis inspects code without running the application. Tests execute selected behavior. CI runs checks and reports results. None establishes general correctness.

For a gate, use explicit pass/fail criteria and repeatable results under controlled inputs. Isolate unstable timing and live-service dependencies. Decide where the result must block progress, then verify enforcement there.

On GitHub, required checks can accept successful, skipped, or neutral results. Inspect the effective branch-protection rules, bypass rights, trusted check producers, and evidence for the current revision. An accepted status doesn't prove every intended test ran.

Each layer needs maintenance. A noisy rule trains people to ignore it. A stale eval measures yesterday's failures.

Worked example: my PR pipeline

I run a small team. Coding agents open PRs. A second agent reviews them. Changes within the auto-merge policy merge when required checks pass. High-risk changes go to a person.

That's my worked example, not a universal workflow:

  1. Required CI checks: tests, linters, and security checks. My policy is no merges on red, subject to the enforcement details above.
  2. Before and after screenshots: CI captures affected screens for UI changes and attaches them to the PR. They provide visual evidence for inspection.
  3. A reviewer agent on a different model: it examines the change, but a different model doesn't guarantee different mistakes. I treat it as one filter.
  4. Evals behind the agents: I use them to reassess the writer and reviewer when models change.
  5. Human routing: high-risk areas don't auto-merge. Changes meeting the lower-risk policy move on green.
  6. A merge queue: GitHub checks integration with the latest target branch and changes ahead in the queue. This helps catch failures those checks cover. Required GitHub Actions queue workflows need the merge_group trigger (documentation).
  7. Recurring catches become checks: lint rules for expressible patterns, tests for behavior. A human catch moves into the pipeline.

What I'd add next: a file-scope check comparing touched files with the task's allowed scope. A view fix that edits billing would stop until the scope was resolved.

That's a proposed addition, not a capability I'm claiming to run.

My September 26, 2026 proposed PR review policy covers approval rules and named ownership. It describes a proposal, not an executed trial.

A contrasting model: direct to main

One extreme-development model proposes small changes pushed directly to main. The task initiator inspects the agent's work before shipping. Local checks precede the push. CI then gates deployment, with flags, monitoring, and recovery limiting exposure where they can.

This is a design to assess, not an independently proven account of Amp's production safety stack.

Amp's Ship documentation supports a narrower claim: the default Ship prompt asks the agent to commit, fetch and rebase onto the latest base branch, run the full test suite, and push. Amp also offers Push to Branch and Custom Ship behavior.

The button sends instructions. It isn't an enforced CI gate. The docs even allow ignoring a test after confirming it also fails on the base branch.

The useful contrast is where verification happens:

  • The initiator inspects before shipping. Starting the thread isn't approval. Record the accountable owner and the actual approval evidence required for that change.
  • Local checks precede admission. They provide evidence for the tested local revision, not a guarantee about later integration or production behavior.
  • Post-push CI controls release. A failed run leaves the commit on main. Release must depend on passing evidence for the exact integrated revision and deployable artifact. Every release route must honor that gate, including manual routes and queued releases. A green run for some later commit isn't approval for an unrelated artifact.
  • Rollout and recovery handle residual risk. Flags can limit exposure for behavior behind them. Monitoring can detect some failures after exposure. Neither replaces verification.

A narrow direct-main model needs more than trust: bounded push authority, shared codebase knowledge, mature checks, small changes with recoverable effects, flags where appropriate, and useful monitoring. Name the release owner and the people available to respond. Test the recovery path with them.

A flag can't undo a migration, leaked secret, or external payment. A source revert doesn't necessarily restore data. Some work needs approval before the irreversible action, whatever branching model you use.

The staffing tradeoff matters: removing routine review can shift work into incident response. If nobody can respond when the change ships, rapid recovery is only an assumption.

Context and identity aren't approval

Amp documents the exact commit trailer Amp-Thread-ID. Its threads record prompts, replies, tool calls, and changed files. That context can help reconstruct intent, provided authorized reviewers can access and retain it.

Thread linkage is traceability. A verified commit signature provides provenance about signing identity or key. Neither proves that a person deliberately reviewed and approved the change.

Follow your system's actual controls, including required approval evidence and separation of duties. Don't infer SOC 2 equivalence from signatures, threads, and green CI. Changing an approval gate requires the control owner's authorization.

Decision rule: retain the gate or assess a narrower flow

Keep PR gates while you locate the actual wait. If they catch consequential defects or provide required approvals, removing them sacrifices something specific.

Consider direct-main only for a bounded class of work whose admission, release, and recovery controls you can explain and support. Lower review wait isn't a win if escaped defects or recovery demands rise beyond the team's capacity.

Route by actual effects, not author or line count:

Change type

Examples

Verification and approval route

Low-effect work

Docs, notes, tooling without production, permissions, money, secrets, or sensitive-data effects

Policy may allow auto-merge after required checks. A narrow direct-main assessment can start here, with bounded push authority. Classify scripts by effect, not their internal label.

Small, scoped code

Low-risk module fix, copy change, test addition

In the PR model: required checks and reviewer agent before policy-approved auto-merge. Direct-main needs pre-push inspection and a release gate tied to the tested artifact. Small isn't automatically safe.

UI changes

Layout, styling, new screen

Add before/after visual evidence. Checkout, identity, or permissions flows take the higher-risk route.

Cross-module work

Broad refactor, feature spanning modules

Human scope and integration review, plus automated checks. Keep the admission gate where unresolved integration risk needs it.

High blast radius

Money, auth, permissions, migrations, deletions, secrets, deploy configuration

Named human approval before the risky action. Require a compatible rollout and tested recovery or roll-forward plan. Don't route these through the narrow direct-main category.

Outside contributors

Unfamiliar public-repo contributor

Human approval and restricted untrusted workflow access. A clean diff doesn't establish trusted automation.

Audit-bound systems

Systems covered by SOC 2 controls, SOX obligations, or contractual change controls

Follow approved system-specific controls. Retain named human approval wherever required. Obtain control-owner authorization before changing that gate.

When rows overlap, take the stricter route. Unclear scope goes to a person.

What to do Monday

  1. Inspect one service's last twenty changes. Include direct pushes, not just merged PRs. Record wait for review, integration, deployment, and approval. Separate human and agent review. Check escaped defects and recovery work alongside elapsed time.
  2. Automate one recurring check. Find a repeated review catch or escaped defect. Turn it into a lint rule or test with an owner. Specify whether it blocks admission, release, or both, and verify that the intended revision is covered.
  3. Write the release and risk contract. Name who owns each change, its required approval evidence, release authority, exceptions, and staffed recovery. Identify high-risk effects. Keep PR gates unless a narrow alternative has adequate controls and the necessary authorization.

Start with the service's actual wait and failures. Move one repeatable check into enforcement. Put a name against release and recovery.

The goal is useful code reaching users with understood risk. Not an empty review queue at any cost.

Keep your team informed

Practical AI ideas, delivered where you already are.

Get occasional field notes on choosing models, building useful AI workflows, and making better decisions with the tools.

Prefer a messaging app?

Telegram and WhatsApp are broadcast-only and carry the same posts. Pick the app you prefer.