AI code review vs guardrails vs tests: who catches what

By Shamaz Khan · 29 Nov 2026 · 6 min read

TL;DR

Who catches what

FailureTestsAI reviewStet
Known behaviour brokeYes, if testedSometimesYes: runs tests on PR and main
Failure was already on mainNo (looks like yours)NoYes: labels it
Agent edited files outside the taskNoRarelyYes, with a scope
Tests deleted, skipped or assertions removedNo: they still passSometimesYes: fixed patterns
Type or lint checks switched offNoSometimesYes
Poor design, naming, edge casesNoYesNo
Untested behaviour brokeNoSometimesOnly with a lock or snapshot

The cheapest setup that covers it

  1. Your existing tests, plus a type check (tsc --noEmit) if you use TypeScript.
  2. Stet on every PR: free, two clicks at getstet.dev/add. It runs those tests on the PR and on main and flags weakened tests.
  3. Optional: an AI reviewer (CodeRabbit, Copilot review, self-hosted PR-Agent) for opinions on the code.
  4. When agents write most of the code: npx stet-cli init to lock key behaviours and set a scope per task.

FAQ

Is AI code review enough for AI-written code?

Usually not on its own. AI review doesn't run your code, so it can miss regressions and won't tell you whether a failure was already on main. Pair it with tests and a guardrail that runs them on every PR.

What are guardrails for AI coding agents?

Rules the agent can't talk past: which files a task may change, which behaviours must keep passing, and checks that tests weren't weakened. Stet enforces them before commit and on every PR.

What is the cheapest way to review AI-generated pull requests?

Your existing tests plus Stet on every PR is free. Add an AI reviewer if you also want comments on design and style.

See what your AI change really did, on every PR

Stet posts one comment on every pull request: what broke vs main, tests deleted, weakened or skipped, checks switched off, files outside the task. Free and open source, zero config, nothing leaves your CI. Plus a CLI and MCP server for Claude Code, Cursor and Codex.

Add to GitHub in 2 clicks · npx stet-cli init · Install · Setup guide · GitHub

Related