The Second MeetingNo. 2Architecture is risk management22 November 20266 min read

A test the agent can rewrite is not a control.

Developers at a company deep into AI coding agents told a Thoughtworks principal they no longer trusted their tests, because the agent rewrites them. That is not a testing problem. It is a separation-of-duties problem, and the decision underneath it belongs to whoever signs off on what done means.

Sent to subscribers on 22 November 2026.

A test the agent can rewrite is not a control.

In early 2026 Matteo Vaccari, a technical principal at Thoughtworks Italia, interviewed 26 developers at an organisation that had gone further than most with AI coding agents. He asked whether they trusted their tests. Most said no. One answer, as he reports it: "Well… I don't trust our tests that much!" The reason was not that the tests were badly written. It was that they kept changing. "Even if I review the tests when they are initially generated, as new features get added, the AI refactors both existing code and existing tests, so I'm no longer confident that the tests are still ensuring the right behaviour."

Read that from the chair of the person who signs off on the engineering budget. The test suite is what the company points to when it says a change is safe. It is what the release gate runs, what the auditor is shown, what the engineering lead means by "it's covered". And in that organisation, the system that wrote the change was free to rewrite the evidence that the change was correct.

That is not a testing problem. It is a separation-of-duties problem, and most companies running coding agents have it without having decided to.

The control and the output are the same file

A control is something the thing being controlled cannot change. A spending limit the spender can raise is not a limit. An approval the requester can grant to themselves is not an approval. Finance teams understand this without being told, which is why the person who raises a purchase order is not the person who pays it.

A test suite the agent may edit is not a control. It is a second output of the same process, produced by the same model, under the same instruction to make the build green. When the agent changes a behaviour and the test that pinned that behaviour in the same commit, the build stays green and the suite now certifies the new behaviour. Nobody lied. The system did what it was asked. The definition of done was rewritten by the party being measured against it, and the release gate reported success.

Most teams cope by reviewing harder. Vaccari is honest about how that goes: "reading AI-generated test code is even more boring than reading AI-generated production code", and "after a point, fatigue kicks in". A control that depends on a tired person reading boring diffs carefully, forever, is a control that will fail on a Friday afternoon, and nobody will know which Friday.

His answer is a permissions table

Vaccari's proposal is technical, but its shape is organisational. When AI writes the code, he argues, "developers become its customers", and "customer tests, not developer tests, become the primary contract between humans and AI". He moves those customer tests out of code and into data files, read by a small test runner, because data files are easier to read and "easier to protect from unexpected manipulation by AI".

Then he writes down which files each kind of task is expected to change:

WhenProduction codeTest dataTest runner
Implementing new functionalityYesYesNo
Refactoring production codeYesNoNo
Improving test coverageNoYesNo
Improving the test DSLNoYesYes

The table is the useful part, and not for the reason engineers will like it. It turns a judgement call into a check. A refactor that touches the test data is visible at a glance, before anyone reads a line of it, because a refactor was never supposed to touch the contract. That is the move an auditor makes with segregation of duties: you do not try to spot the bad payment, you make sure the person who can create a vendor cannot also approve its invoices.

The question is not how good your tests are. It is who is allowed to change them.

Where the money is going

There is a cost argument underneath this, and it is larger than most AI budgets assume.

Martin Fowler relayed a figure from Cindy Sridharan this month: "70% of my daily token spend goes into verifying patches", and "only ~20-30% into creating them". Fowler added that enterprise users describe a single customer request triggering "a dozen turns to other models" to "probe its input and verify its output". One engineer's ratio and a handful of reports is not a benchmark, and I would not put it in a forecast. But it points the right way. The plans I see budget for generation. Once a team takes correctness seriously, the spend goes on checking.

That changes what the checking is worth. If most of the tokens go on verification, then verification the generating agent can quietly rewrite is the most expensive thing in the pipeline and the least trustworthy. You are paying the most for the part you can rely on least.

What I would decide in your chair

Three decisions, in this order, and none of them is a tool purchase.

Name the contract. Somewhere in every codebase there is a set of files that defines what done means for the business: the acceptance tests, the fixtures, the API contracts, whatever your team calls them. Write down which ones they are. Most teams cannot, because nobody was ever asked to draw the line between the tests that describe the business and the tests that describe the implementation.

Decide who may change it. Agents may change the implementation and its tests freely. A change to the contract is a different kind of event. It is a change to what the company has agreed the product does, and it should carry a name, a reason and a person who approved it, the way a change to a price or a policy does. Vaccari's table is a good first version of that rule.

Make the change visible without reading it. The check should be mechanical. A refactor branch that touches contract files fails the pipeline, or at least goes to a different reviewer. The point is not to read harder. It is to make the dangerous diff impossible to miss.

I built the open-source agent workflow I use on the same principle, one level up. It runs ten specialist roles, and what passes between phases is a versioned document, not a recollection. The role that implements receives the specification as an artefact, and if the specification changes, the change shows up in its history like any other. The idea is Vaccari's, applied earlier: the thing that defines the work should not live only in the memory of the thing doing the work.

What I am not claiming

Monday

Three questions for whoever owns engineering. Each should take a minute. If it takes longer, that is the finding.

  1. Which files in our main product define what done means to the business, and could you list them now?
  2. In the last month, how many agent-written commits changed a behaviour and the test that pinned it in the same change? If nobody can find out, the release gate cannot either.
  3. Who has to approve a change to the contract, and is that rule written anywhere a pipeline can enforce it?

If your team is shipping agent-written code into a product you have to stand behind, and the honest answer to the first question is "we'd have to look", that is the conversation I have most weeks. I take two or three of these engagements at a time.

Referenced in this issue

  1. Tests as data · Matteo Vaccari, martinfowler.com, 11 November 2026 — the 26 interviews, the developer quotes, customer tests as the contract, the table of which files each task changes, the note on prototypes.
  2. Fragments: 10 November · Martin Fowler, 10 November 2026 — Cindy Sridharan's 70% and 20–30%, and the dozen turns to other models.

Get the next one first.

Every Sunday, one essay like this, a day before it appears here.