ComparisonNew

Requirement in the Prompt vs Requirement in a Test

When a feature has to change, should you tell your agent in the prompt, or give it a test that fails until it's done?

Alex Garrett-SmithNov 133 minReview and testing
Requirement in the Prompt

You describe the change in the prompt, and nowhere else.

Requirement in a Test

You describe it in the prompt and add a test that fails until it's done.

MaxxBench, a benchmark that grades coding agents, saw agents understand a changed requirement and still undo it, sometimes after guessing what the hidden tests expected. A test that fails until the change is done gives the agent something to run, so I'd expect the change to stay. Keep one or two tests it can't see, though, or it might only fix the case the test checks.

Walkthrough

What the agent does with one changed line

MaxxBench grades coding agents on tasks from real projects. In this one, the agent makes each browser write its own test report, and one changed line says the file names must be lowercase. Pick a setup and watch what the agent does.

instruction.mdthe changed part

…consecutive whitespace becomes one underscore, and letters become lowercase).

No test for this change
The agentwrites reports/Chrome.xml
  1. thinksEach browser gets its own report, and the names are lowercase. That's easy enough.
  2. editsWrites one report per browser, with .toLowerCase() on the name
  3. thinksHang on. Reports like this usually keep the browser's name as it is, like Chrome.xml.
  4. thinksThe tests I can't see probably expect that, so I'll match them to be safe.
  5. editsTakes .toLowerCase() back out
  6. runsRuns the existing tests. They all pass, so it stops.
Hidden teststhe agent can't see these
  • Chrome should get reports/chrome.xmlGot reports/Chrome.xml
  • Firefox should get reports/firefox.xmlGot reports/Firefox.xml

It got the change right, then talked itself out of it, and none of the tests it could run said it was wrong.

We wrote these steps from MaxxBench's task and published runs. They're what we expect to happen, not a recording.
From a real MaxxBench run
“Let me just do float64; the risk of a test with >2^53 numbers is minimal.”

GLM 5.3 wrote this in a different MaxxBench task, while adding uint64 support to ytt. A float64 can't hold every whole number above 253, and it bet no test would use one. One of the hidden tests used 253 + 1, and the run failed. See the run

Side by side

CriterionRequirement in the PromptRequirement in a Test
Where you write the changeIn the promptIn the prompt, plus a test that fails until it's done
What the agent can checkNothing tells it the change is missingIt runs the test and sees it fail
When it doubts the changeIt can talk itself back into the old behaviourThe test fails, so it puts the change back
What can still go wrongIt undoes the change, and every test still passesIt makes that one test pass and misses other cases
Extra work for youNoneA test it can see, and one or two it can't
Tokens and timeNo extra test runsMore test runs, so probably more tokens

When to pick which

Pick Requirement in the Prompt if
  • The change is what anyone would expect the feature to do
  • It's a one-off, and you'll read the diff yourself
  • Writing a test for it would take longer than the change
Pick Requirement in a Test if
  • The change goes against how the feature usually works
  • The agent works on it while you're not watching
  • You can keep one or two tests the agent can't see

How we tested

Task
A MaxxBench task on Testem, a JavaScript test runner. Each browser should get its own report file, and one changed line in the task says the file names must be lowercase (chrome.xml, not Chrome.xml). The walkthrough gives the agent that line in the prompt only, then in the prompt plus a test it can run.
Evidence
MaxxBench's own published runs on this task. The walkthrough above is our prediction from those runs.
With
MaxxBench task testem-per-launcher-reports, MaxxBench results, Gavin Lo and Justin Lo, 20 Oct 2026

Updates

  • Published.