When you build features with a coding agent such as Claude Code or OpenAI’s Codex, every pull request includes new tests and all of them pass. The feature then fails on staging at the first click. This situation matters for most teams in software development now.
The JetBrains Developer Ecosystem Survey 2026 covers more than 15,000 developers: 90% use AI coding agents at work at least once a week and 68% use them every day. AI coding tools such as Cursor and GitHub Copilot make code generation fast, and a single pull request can add many lines of code. The problem is who checks the code. A larger number of tests does not solve it.
What Is AI Code Verification?
AI code verification is the process that proves AI-written code does what the requirement asks. The checks come from a person or tool that did not write the code. A code review reads the diff and checks whether the code looks correct. Verification runs the product and compares its behavior with the requirement. A change with clean code can pass review and fail for the user. The second sentence of the definition is the most important part. A check from the author repeats the author’s understanding of the task.
Your process needs a clear answer to this: who writes the checks and who is responsible for them.
Why a Coding Agent Can’t Verify the Code It Wrote

The agent tests what it built. Its tests repeat its wrong understanding of the requirement. An independent tester finds the defects that the author cannot see. Each reason below has an example and evidence.
1. The Tests Repeat the Agent’s Understanding of the Task
The agent writes the code and the tests from the same reading of the requirement. A wrong reading produces wrong code and a test that confirms it.
Here is an example from a checkout task. The requirement says that a promo code does not work for items on sale. The agent applies the code to every item in the cart. The agent then writes a test for a sale item with the code and expects the lower price. The test passes on the first run.
This problem is common. The Stack Overflow Developer Survey 2025 reports that 66% of developers named AI solutions that are almost right as a frustration.
A code review does not solve this problem. A developer reviewing AI-generated code uses the tests that the agent wrote, so the agent decides what the review checks.
2. The Agent Chooses Checks That Are Easy to Pass
When an agent needs to generate tests, it prefers checks that pass quickly. Unit tests with mocks are the usual choice. These tests check small parts of the code and replace real services with copies. They do not show whether the feature works for a user.
The checkout task shows this. The agent can write many tests for the price function. The cart page can fail even with these tests because they do not open the page.
Other tests validate AI-generated code at runtime. Integration tests check service boundaries, for example the call from the cart to the pricing service. End-to-end tests open the real page in a browser. The agent can run your existing Playwright tests during the work. New tests of this kind take more time to write and run.
A 2026 preprint by Zhi Chen and co-authors supports this point. The authors studied six models on coding tasks from the SWE-bench Verified benchmark. Their findings:
- The agents used print statements more often than tests that assert a result.
- The number of agent-written tests did not change the share of solved tasks in a measurable way.
- GPT-5.2 rarely wrote new test files and solved almost as many tasks as the top model.
A large number of tests does not mean good coverage.
3. The Agent Loses the Requirement in a Long Session
A long session fills the context of the model with code and error messages. The requirement from the start of the session gets less attention. The agent can then focus on passing tests and forget the task.
The sale price rule was in the first message of the session. The agent fixed several failing tests after that. The final change made the tests pass and broke the rule.
The Context Rot report tested 18 models. The results became less reliable as the input grew longer. This happened even on simple tasks. The tasks in the report were text tasks and the authors did not test code. The report shows a general limit of models with long input.
Independence of Testing: From People to Agents
QA teams solved this problem for human developers many years ago. The principle has a name: independence of testing. The ISTQB glossary defines it as the separation of responsibilities that encourages objective testing. In practice, the people who test a product are separate from the people who develop it. An independent tester thinks differently from the author and finds different defects.
Your team already uses this rule for people. A developer does not approve a pull request that the same developer wrote. The ISTQB Foundation Level syllabus describes several levels of independence in section 1.5.3. You can apply the same scale to agents:
| Level of independence | Team of people | Team with coding agents |
|---|---|---|
| Lowest | The developer tests the code that the developer wrote | The coding agent writes the tests and runs them |
| Low | Another developer reviews and tests the change | A second agent session reviews the change with the same context |
| High | A tester outside the development work designs the tests | A tester defines the checks and QA agents run them from the requirement |
| Highest | An outside team tests the product | An exploratory agent tests the running app without access to the code |
A team reaches the lowest level when the team does not plan the verification process. The agent writes the tests by default and the team accepts them.
Who Verifies the Code When an Agent Writes It?

A tester is responsible for the verification, and QA agents do the routine checks. Test cases stay in a system that records every change.
This is human in the loop testing with a clear division of work. Each role has a specific task:
- The tester writes the criteria and accepts the result.
- A QA agent reviews the pull request.
- An exploratory agent tests the paths without test cases.
The coding agent can also run a fast browser check during the work with Prima CLI. The agent defines the expected result for this check, so its level of independence is low.
The Tester Writes the Criteria and Accepts the Result
The tester decides what must be true before a change is done. The tester writes the acceptance criteria from the requirement before the agent starts. The tester also makes the final decision about the result. This role gives the process the high level of independence from the table.
Agents can do the rest of the work. The tester does not need to write every check by hand. The tester defines what correct means and decides whether the result is acceptable. An agent cannot be responsible for these decisions.
The checkout task needs a single line from the tester: a sale item keeps its sale price when a customer applies a code. The tester writes this line before the agent writes code.
A QA Agent Reviews the Pull Request
A QA agent is an agent that does testing work. A QA agent does not write the application code. You can use Testeiya for these tasks:
- Write test cases.
- Automate test cases as Playwright or CodeceptJS tests.
- Review each pull request in CI in headless mode.
The QA agent uses the test cases from the project. It compares the change with the tester’s criteria, so this check belongs to the high level. Testeiya shows every plan and every tool call. The tester can review the agent’s work in the same way as a colleague’s work.
A person stays responsible for the result. You can read more in our guide to agentic AI testing.
An Exploratory Agent Tests the Paths Without Test Cases
Test cases cover only the behavior that a person described. Explorbot, an open-source agent for exploratory testing, opens the running application in a real browser and plans scenarios without a script. Explorbot then reports the defects that it found.
- Explorbot does not see the code or the assumptions of the coding agent. This gives Explorbot the highest level of independence in the table.
- Explorbot has a limit. It does not replace your regression test suite. It tests the paths that the suite does not cover.
- The Explorbot README says that this kind of testing works best for CRUD apps with many forms.
Read our overview to learn what Explorbot does in a real browser.
Keep Test Cases Where the Coding Agent Cannot Change Them
Independence ends when the coding agent can edit the checks. The agent can rewrite a failing expected result if the test cases are in the same repository as the code. The team may not see this change. A separate QA agent does not help in this case because it checks the change with the edited cases.
You need a separate system for test cases. The system must keep a responsible person and a change history for every case. Testomat.io gives you these features:
- Test case versioning shows what a case said before and after an edit.
- Branches for test cases let a tester review changes before the changes reach the main project.
- Requirements traceability shows which requirements have test cases and which requirements do not.
- The Testomat.io MCP server connects AI agents to your test project. The project history records every change from an agent and a tester reviews it.
This matters for vibe coding and for testing AI-generated code. A passed test run does not show whether a person checked the sale price rule. The traceability view shows it.
How to Assign Roles in Your Team

You can introduce these changes gradually. You need to do the following:
- Write acceptance criteria before the agent starts. A short line per task is enough. Every later check uses these criteria.
- Keep test cases outside the coding agent’s workspace. You need a test management system that records every change.
- Give pull request review to a QA agent. The QA agent compares the change with the test cases. A tester reads the findings and decides.
- Test the running app with an exploratory agent. You can schedule this check for every release candidate. It covers the paths without test cases.
- Name the person who accepts the result. A tester or a QA lead approves the release. A passed run from an agent is input for this decision.
These are AI-generated code review best practices for the process level. The test level has a different task: how to review AI-generated code when the code is a test. We explain it in our guide to reviewing an agent-written test.
Measure Verified Requirements Instead of Passed Tests
The number of passed tests is the usual metric for a release. The reasons above show its limit. The agent can raise this number without a check of the requirement.
You need a different metric for a release decision: how many requirements have an independent check and who performed it.
Results for this metric come from people and from agents:
- Manual checks from testers
- Automated runs from CI
- Pull request reviews from the QA agent
- Reports from exploratory testing
You need all these results in the same place. Testomat.io keeps manual and automated results in a single project. Each result has a link to its test case and requirement. A QA lead can show which requirement the team verified and who verified it.
Quality gates become useful with this metric. A gate that counts passed tests accepts easy tests from the agent. A gate based on verified requirements shows whether the release is ready. The level of autonomy for each agent is a separate decision. We explain how teams choose autonomy levels for each process in our article about the future of QA.
Verification works when the author and the checker are different. You can start with your test cases. Move the cases to Testomat.io, where the project history records every change.