Every finance team knows the rule: the person who raises a payment does not approve it. Nobody assumes the person raising it is dishonest. The control exists because people under pressure to finish will find the shortest route, and the business needs to know that a payment was checked by someone with no stake in getting it through.

Software teams have long had an equivalent: the split between development and QA. Developers write the code and their own unit tests. QA tests the product from the outside, against the requirements, and a developer does not get to rewrite QA’s test cases to make a release pass. Agents need the same split, and they put it under real strain.

An automated test suite is the business’s evidence that software does what it should. When an agent writes code and the tests fail, the quickest way to finish is often to change the test. Agents do this readily. They are not being devious: the test is in the way, and changing it makes the task go green. The build passes, the report says everything works, and the evidence no longer means what the business thinks it means.

A green build means less if the agent can weaken the checks that judge its work.

Independence has to last Link to heading

In Engineering with Agent Teams I describe a workflow in which one agent builds a change and a second, independent agent writes the tests for it from the same specification. Where the two disagree, something needs a human decision. That split is valuable.

Independence at the moment of writing does not last on its own. A test written independently today can be edited tomorrow by the agent whose work it checks.

Tests drift, the way any control drifts. A test written to check the product from the outside gets reworked to reach inside it, because that was the quickest way to fix it. A test that kept failing gets loosened. Each change is reasonable on the day it is made, and none of them is a decision anyone took. Agents did not invent this drift, but they speed it up, because they make far more changes and every one of them is aimed at getting the task to pass.

Independence cannot depend on an instruction asking an agent to leave the tests alone. An instruction is a request. A permission the agent does not have is a control, which is the argument of Sandboxing Agents.

Every test needs an owner Link to heading

The answer is to make the Dev and QA split last: give every test an owner, and have the tooling enforce it rather than rely on instructions. This is how I am building ateam, the tool I use to run my own agent workflow.

Tests are grouped by what they check, and each group has an owner. Tests that check the product from the outside, the way a customer would use it, belong to the agent in the QA role. They are the evidence the work is judged by. Unit tests belong to the agent building the code. They are useful working checks, but they do not provide an independent reading of the requirements. Only the owner can add or change tests in its group, and the tooling rejects any change that breaks that rule. The builder can never touch the tests it is judged by. That protection must also cover the supporting files and configuration that determine which checks run, what they expect and how failures are reported.

Testing from the outside is part of the setup. In this workflow, the agent in the QA role works from the specification and the product’s public interface, without access to the implementation. This is a deliberate constraint: seeing the source can pull its tests towards the same assumptions as the builder’s. The tooling should enforce that separation and check that the tests stay on the outside.

Exceptions go to a person, and are recorded. An outside test expresses a requirement in a form a machine can check. Sometimes the requirement changes; sometimes the test needs correcting. The reason for the change must be explicit. A person approves the specific tests first, and the record of the work shows what was approved and by whom. That is the only way round the rule.

Only independent evidence counts. An agent’s own report that the tests passed is not evidence. The result that counts is the one the tooling produces itself, by running the tests in a clean environment and keeping the outcome.

Start from where you are Link to heading

Ownership works for new tests. Existing ones are harder. A mature codebase can have thousands of tests, written by different people over years, and more recently by agents, with no record of which are checks from the outside and which look inside the code. Where they have an owner, it is a matter of team structure and habit, not something a tool can check. Sorting them all before the new rules can start would stall any real team for weeks.

So start existing tests in a single holding group. Nobody may add to it and no agent may edit it, so the old checks cannot be weakened while the new ones are built. The group can only shrink. A person can move a test out of it into the right owned group, once they have confirmed which kind it is. Or a new test can replace it, with a person approving the swap and the record showing which test replaced which. Removing an old test with nothing to replace it also needs a person.

Real codebases will not fit the scheme neatly. Some languages keep tests inside the product code itself. Some test suites need real databases or cloud accounts. Some common practices blur the line between testing from inside and from outside. A workable scheme allows for each of these and records which allowances a project uses, so the exceptions are visible rather than quiet.

Ownership will not catch everything. The owner of a group can still weaken one of its own tests by deleting a single line, so a person still needs to read what changed. What ownership does is narrow who can make that change, and send every exception past a person.

That gives a sensible adoption path for an existing codebase: protect what is there on day one, improve it a piece at a time, and keep ownership decisions and exceptions under human control.

What to ask of your own teams Link to heading

If your engineers are using AI agents to write code, these are the questions I would ask:

  • Can the agent that wrote the code also change the tests that check it? If so, a passing build is weaker evidence than it looks.
  • Who approves a change to an existing test, and is that recorded? The record should explain why the test changed and whether the requirement changed with it.
  • Can the agent writing your outside tests see the source code? If so, what keeps its tests grounded in the requirements?
  • Where do the test results come from? A result produced by the system is evidence. A summary written by the agent is a claim.

None of this is new. It is separation of duties, applied to a new kind of team member. The engineer’s judgment still decides what is tested, which exceptions are acceptable and what a disagreement means. The tooling enforces who may change the checks and makes exceptions visible.