AI agents are writing code autonomously.
They take a GitHub issue. They plan an implementation. They write the code. They open a PR.
The human isn’t in the loop anymore.
They’re at the end of it.
So who verifies the code?
Not You
You’re asleep. Or working on something else. Or reviewing 5 other PRs. Or — let’s be honest — approving things that look reasonable because you’re behind.
That was already the reality before agents.
Now multiply the volume.
If you have 10 agents opening PRs per day, you’re not reviewing each one carefully. You’re skimming. You’re pattern matching. You’re hoping.
That’s not a quality strategy.
That’s a prayer dressed up as a process.
The Agent Doesn’t Know Your Business Rules
An AI agent generates code that looks right. It follows patterns. It uses the right libraries. It handles the obvious cases.
But pattern matching isn’t understanding.
The agent doesn’t know that usernames can’t contain spaces in your system. It doesn’t know that the discount calculation rounds differently for wholesale vs retail. It doesn’t know that the third-party API returns null instead of an empty array when there are no results.
Your business rules live in the gaps between documentation and reality.
Tests encode those gaps. Documentation doesn’t.
A well-written test suite is the most precise specification of your system’s actual behavior. Not what someone wrote in a wiki 18 months ago. What the code actually does today, including the weird parts.
How We Use This in Practice
We use AI agents to automate content delivery for this site. The workflow:
- File a GitHub issue using a structured template
- Agents triage, plan, and implement
- The agent creates a PR with new content
- CI runs the build — validates schemas, markdown structure, link integrity
- Build passes → human does a quick quality review
- Build fails → agent gets feedback and iterates
The build is the test suite.
Zod schemas validate every frontmatter field. Astro’s build process catches broken links and malformed content. By the time a human looks at the PR, structural verification is done.
The human only reviews quality — is this content good, not is it correct.
That’s the division of labor: machines verify correctness, humans verify quality.
Agent-Ready vs Agent-Hostile Codebases
Here’s the hard truth.
Some codebases are ready for AI agents. Most aren’t.
An agent-ready codebase has:
- Tests that define behavior at boundaries
- CI that runs those tests on every change
- Clear error messages when things fail
- A build that catches structural problems early
An agent-hostile codebase has:
- No tests, or flaky tests that cry wolf
- Manual verification steps that require human judgment
- Tribal knowledge about what “correct” means
- A deploy process that depends on someone being careful
The difference isn’t sophistication. It’s feedback loops.
An agent with no tests is generating code into the void. Every PR it opens requires full human review. You haven’t automated anything. You’ve just moved the bottleneck downstream.
An agent with a strong test suite has a complete feedback loop:
- Red tells it what to build
- Green tells it when to stop
- Error output tells it what went wrong
No human required until the end.
The Kata Connection
This isn’t abstract.
Every kata on this site is a miniature version of this workflow. Requirements are given. You write tests that encode those requirements. Then the implementation has to make the tests pass.
Now imagine handing those tests to an agent instead of writing the implementation yourself.
That’s not a thought experiment. That’s Tuesday.
The practice of writing tests from requirements — clear, precise, boundary-aware tests — is exactly the skill that makes you effective in an agent-assisted workflow.
You’re not learning TDD to be a better manual coder.
You’re learning to write the specifications that machines execute against.
The Real Bottleneck
Code review is a human bottleneck in an increasingly automated world.
Tests are an automated verification layer that scales infinitely.
One PR or a thousand — the test suite runs the same way every time. It doesn’t get tired. It doesn’t skim. It doesn’t approve things because it’s Friday afternoon.
If you want AI agents to actually work for you — not just generate code you have to babysit — invest in your test suite.
It’s the interface between your intent and the agent’s output.
And that interface is the only thing standing between “AI-assisted delivery” and “AI-assisted chaos.”