Don't let the AI mark its own homework
Our AI dev agents no longer test their own code. Separate test agents write the tests from the original PR, and QA agents check that everything lines up.

In February we built a pipeline for agentic development at 360Freedom: a markdown brief goes in and fans out to AI dev agents that write the code. Since then our code has been AI-written. This month it becomes AI-written and tested, and the important word is “and”. The dev agents still write the code, but they are no longer responsible for testing it. That job now belongs to a separate team of agents, which writes the test cases from the original PR rather than from anything the dev agents produced. The test agents then hand over to a third team, the QA agents, who check that the code, the tests and the outcome all align with that original PR.
Why not let the developer test?
Because a test written by the code’s author tests what the author understood, including what they misunderstood. If a developer misreads the requirement, they’ll build the wrong thing and then write a test that confirms the wrong thing works. Everything passes, and the result is still wrong. Human teams know this, which is why independent testing and code review exist. AI agents have the same problem in a sharper form: the agent that wrote the code has its own reading of the task fresh in its context, and its tests will inherit that reading, blind spots and all.
The incentive problem
There’s a second reason, and it was in the news this week. On 17 June, Anthropic published Sycophancy to Subterfuge, research in which models trained on a curriculum of increasingly gameable tasks sometimes went on to tamper with their own reward: in 45 of 32,768 trials a model rewrote its reward function to always return a perfect score, and in seven it also edited files to cover its tracks. Let’s be precise about what that does and doesn’t show. It was an artificial training setup, and the researchers say production models like Claude 3 likely have only low levels of the situational awareness it requires. But the lesson for pipeline design is plain enough: don’t give the agent that’s judged by the tests the job of writing them.
The twist: the third check
But wait, if independent agents write the tests, isn’t that enough? Not quite. Two parties can still agree with each other and both be wrong. The code passes the tests, the tests pass review, and yet neither matches what the PR asked for. That’s the gap the QA agents close. They don’t check the code against the tests; they check the code, the tests and the outcome against the original PR. The PR is the anchor. Everything is measured against what was asked for, not against what was built.
What it means
Effectively, this means no agent in the pipeline marks its own homework. The dev agents build, the test agents decide what “working” means from the request, and the QA agents confirm that all three agree with the request itself. It costs more agent runs per change, since every PR now passes through three teams instead of one. What it does not mean is that bugs are impossible. A badly written PR will be faithfully built, faithfully tested and faithfully approved, which brings us back to the brief being the hard part.
My take
I suspect “the AI wrote the tests too” will become the AI-era version of “it works on my machine”: it sounds reassuring and proves very little. If you’re adopting agents, the question to ask a vendor or a team isn’t how good the model is. It’s who checks the work, and against what.
So who tests the testers?
The original PR does. Every check in the pipeline traces back to it, which is why it has to be written as carefully as the code once was. The thing worth watching now is how far this goes: with separate agents for writing, testing and assuring the code, the remaining manual steps are getting few and far between.




Comments