Skip to content

AI engineering · 17 October 2026 · 8 min read

Tests from the spec, not the code: blind test vectors with AI agents

If your expected test values come from your code, your tests can only confirm what the code already does. Here's how we have several AI agents derive them blind, from the specification alone, and what their disagreements tell us.

  • AI engineering
  • Testing
  • AI coding agents
  • Documentation
  • For engineers
  • For CTOs and tech leads
In this article
  1. What's wrong with tests that copy the code?
  2. What is a blind test vector?
  3. How do you make sure the agents really can't see the code?
  4. What happens when the agents disagree?
  5. Why does agreement mean the spec is good?
  6. Six rules for blind test vectors
  7. What does this mean for your business?
  8. What should your team do first?
  9. FAQ

The short answer: a test is only as good as its expected answer. If that answer comes from running your code, the test can only confirm that the code does what it already does, mistakes included. We have several AI agents work out the expected answers from the specification alone, without being able to see the implementation. When the spec is clear, they agree, and that agreement becomes the test. When they disagree, each disagreement is investigated on its own. It usually turns out to be a slip, a formatting difference or a gap in the spec. Either way, you learn something.

This is how we now pin down the expected answers for the calculations that matter most in our own systems. Here's how it works, and what it found when we turned it on our existing tests.

What's wrong with tests that copy the code?

It's the most natural shortcut in testing. You write the code, run it on an example, look at the output, think "that looks right", and save it as the expected answer.

The trouble is "looks right". If the code has a subtle mistake, the saved answer has the same mistake, and the test now protects it. Worse, the next person who fixes the bug will see a failing test and may "fix" the code back.

AI agents make this shortcut very tempting. An agent can generate hundreds of expected values in minutes by running the code. We fell for a version of it ourselves: early on, when draft test values disagreed with our engine, the instruction went out to make the test match what the engine did. That was the wrong way round. A test copied from the engine proves nothing, and a typo in a test should never be able to drive a change to the engine.

The rule now is the reverse. Every expected value is worked out from the specification. The engine is only checked against it afterwards.

What is a blind test vector?

A test vector is one worked example: these inputs, this exact expected output. Our real-time calculation engine is tested with a few hundred of them, each tied to a specific rule in the specification.

"Blind" means the expected output is worked out by someone who can't see the implementation. For us, that someone is a group of AI agents. Each one gets:

  • the specification, and the definitions it relies on

  • the vector's inputs and the format to answer in

  • nothing else: no code, no other tests, and no way to run the engine

Each agent works out every expected value by hand, quoting the rule it applied, file and section. If the spec doesn't decide a value, the agent says exactly what's missing and gives no value at all. "Undetermined" is a valid answer. A guess isn't.

We use at least three agents per vector, from different models and different AI providers, each working independently. When they all agree, that's the vector.

How do you make sure the agents really can't see the code?

Telling them isn't enough. Our first runs blinded agents by instruction, in a read-only workspace that still contained the code, with a rule to disclose anything they read. It mostly worked, and the disclosures were honest. In one run, an agent reported that, while tracking down why a result couldn't be written, it had opened one of the engine's tests. It stated that it hadn't used what it saw, and left the affected values open. That's the right behaviour, but it shows the gap: an instruction is a request, not a fence.

The robust version is physical. Each blind agent runs in an isolated container that holds only the specification and the inputs. The code isn't hidden from it; it simply isn't there. Then "blind" is a property of the setup, not a promise.

What happens when the agents disagree?

This is the part that makes the method worth it. With several independent readers, disagreement is information, and each one is triaged individually.

In our largest run, three agents re-derived every existing vector blind. Most matched the stored answers exactly. Of the ones that didn't, almost all turned out to be formatting: 1 against 1.0, a fraction written as a decimal, the same duration written two ways, results listed in a different order where the order doesn't matter. That's not a disagreement about meaning, and it told us exactly how the comparison should normalise answers.

What was left was much more interesting:

  • One agent's arithmetic slip. The other two agreed with the stored answer, and the spec row settled it. This is why you use three: a single blind reader would have produced a false alarm.

  • One genuine gap in the spec. One sentence could reasonably be read two ways, and the agents' reading was arguably closer to the literal text than ours. That's not a test bug or a code bug. It's a spec bug, and it went to a person to decide.

  • One outright contradiction, found in the notes. Even where the answers matched, an agent flagged that two sentences in different sections of the spec said opposite things. All three had followed the same one. The other sentence had to go.

And the important result: none of the stored answers turned out to be wrong. That's what we hoped for, but until the blind run, we didn't know it.

For each real disagreement, the process is the same:

  1. Recheck the vector against the exact spec text.

  2. Have an independent reviewer, given only that spec row and the vector, confirm or reject it.

  3. If it's still open, a person decides, with the spec row, the vector and the engine's output side by side.

When the spec is the problem, we fix the spec, then re-derive.

Why does agreement mean the spec is good?

Because a clear rule has only one reading. If three independent readers, from different models, each working only from the text, arrive at exactly the same output, the text is doing its job. If they don't, the text is ambiguous, incomplete or contradictory, even if your team has always "known what it means".

That makes blind derivation a test of the specification as much as of the code. Every time agents disagree on meaning, you've found a sentence that a new engineer, a client or a future you could also misread. Fixing it improves the spec, the tests and everyone's shared understanding at once.

Six rules for blind test vectors

1. Expected values come from the spec

Never from running the code. The engine is checked against the vector, never the other way round.

2. Fence the readers physically

Run blind agents in an isolated environment that contains only the spec and the inputs. Instructions alone leak.

3. Use at least three independent readers

From different models where you can. One reader can't tell its slip from a spec gap. Three can.

4. "Undetermined" beats a guess

An agent that can't derive a value from the text should say what's missing. That's a finding about the spec.

5. Normalise format before comparing meaning

Decide how numbers, fractions, times and orderings compare, so that only real disagreements reach a person.

6. Triage every disagreement individually

Each one is a slip, a spec gap or a real bug. Recheck the spec text, get an independent second look, then let a person decide. Never "fix" the code to match a vector, or the vector to match the code, without knowing which one is wrong.

What does this mean for your business?

Your specification is a business asset: it's the written record of what you agreed the product should do. If your tests are copied from the code, nobody is checking the product against what you actually asked for. They're only checking it against what was built.

Blind test vectors check both. They show whether the code does what the specification says, and whether the specification is clear enough that anyone reading it reaches the same answer. That matters well beyond engineering. An ambiguous specification is where rework, delays and disputes with suppliers start, and the same clarity your tests need is the clarity your clients, partners and auditors need too.

What should your team do first?

  • Pick the calculation that would hurt most if it were wrong, and write five worked examples for it from the spec, without running the code.

  • Have three agents derive the same examples blind, in a workspace with only the spec, and compare.

  • Look at every disagreement. Count how many were format, how many were slips, and how many were the spec. The last number tells you how good your spec really is.

  • Find any tests whose expected values were copied from the code, and treat them as unverified until someone has derived them independently.

FAQ

What is a test vector? A single worked example of a rule: specific inputs and the exact output the specification says they should produce. A good set covers each rule in the spec, including its edge cases.

Can AI agents write test cases from a specification? Yes, and they're good at it, as long as they can only see the specification. Several independent agents agreeing on an answer is strong evidence it's what the spec says. Their disagreements are often the most valuable output, because they point at unclear parts of the spec.

Why not just generate expected values by running the code? Because then the tests can only confirm the code does what it already does. Any bug present when the values were generated becomes part of the test, and the test will defend it.

What if the agents disagree with what the code does? Don't assume either side is right. Check the spec text first. If the spec is clear and the agents agree with it, the code has a bug. If the spec is unclear, fix the spec, then decide.


We embed engineers who build software where being wrong is expensive, and who test it from what it should do, not what it happens to do. If that's what your team needs, we're happy to talk.

All articles

Read something that sounds like your problem?

A free 15-minute intro with our CEO. Bring the article, and he’ll tell you which service fits, if any. If a spreadsheet and two rules would do the job, we’ll say so.