Grading AI Coding Agents on ServiceNow, Part 2: Running Agents Fairly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
23m ago - last edited 22m ago
In Part 1, we turned closed stories into ATF tests that fail before the fix, checked each test against the task text, and sealed the answer away from the agent. This part covers the next step: running agents against those tasks so that a difference in results reflects the agents, not the setup.
It sounds like the easy part. It isn't. In Benchmarking Coding Agents on the Now Platform Codebase, the Touchstone team found that the three attempts at the same task agreed only 79% of the time, and several of their early problems came from configuration rather than the models: a snapshot feature that slowed runs until they timed out, and permission prompts that nobody answered in headless mode. A fair run is mostly about controlling the boring details.
1. Reset the starting point before every attempt
Every attempt must start from exactly the same state. If attempt 2 can see what attempt 1 changed, or Agent B inherits Agent A's half-finished work, the comparison is meaningless.
The simplest reliable approach is to rebuild from the same source every time rather than trying to undo changes:
- Keep the starting version of your app (the version before the fix, from Part 1) in source control or the application repository.
- Before each attempt, install that version onto a clean sub-production instance. The CICD API can do this as part of a script, so it doesn't depend on someone remembering to reset.
- Load the test data the ATF tests need, but not the tests themselves. Those stay held back until grading.
- Check the instance has no leftovers from earlier attempts before the agent starts: no extra update sets, records or scripts.
If you only have one instance, run attempts one after another and rebuild between each. It's slower, but slow and fair beats fast and wrong.
2. Give every agent the same conditions
Anything you vary between agents becomes part of what you're measuring. Keep these identical, and write them down:
| Keep the same | Why it matters |
| Task text, word for word | Small wording differences change what the agent builds |
| Instructions or context files | Touchstone found repository instruction files raised cost without improving results, so decide once and apply it to everyone |
| Time limit per attempt | A longer clock for one agent is an unfair advantage; count timeouts as failures |
| Instance access and permissions | An agent with admin rights can do things another can't |
| A clean agent workspace | Leftover files or memory from a previous attempt can carry the answer forward |
| Model and harness versions | Record exactly what ran, because both change often |
3. Run three attempts per task
The same agent on the same task doesn't always produce the same result, so one attempt per task will mislead you. Three attempts give you two useful numbers:
- Solve rate: the share of all attempts that passed.
- Solved on all three: the share of tasks the agent got right every time. This is closer to what a developer experiences when they run an agent once and trust the result.
An agent that solves 60% of tasks every time is easier to build a process around than one that solves 65% but different tasks on each run.
4. Grade automatically, the same way every time
Grading should be a script, not a judgement call:
- When the agent stops, revert any change it made to test records.
- Load the held-back ATF tests.
- Run the suite. The CICD API can start an ATF test suite and return its pass/fail result, so this step can be fully automated.
- Record the outcome as one of: solved, tests failed, no change made, or timed out.
If your tests include client-side (form) steps, make sure a test runner browser is available when the suite runs, or those tests won't execute.
Keep infrastructure failures separate. If the instance was unavailable or the agent was held up by rate limits, rerun that attempt rather than scoring it as a failure, and note how many reruns you needed. Touchstone treats an unsolved attempt that lost two minutes or more to rate limiting as tainted and reruns it.
5. Compare task by task, not overall percentages
Two overall percentages hide almost everything. Instead, compare the agents on each task and count where each one did better.
Here's an illustrative example (not real results) with two agents and three attempts each:
| Task | Agent A (of 3) | Agent B (of 3) | Better on this task |
| Business rule fix | 3 | 3 | Tie |
| ACL change | 2 | 0 | A |
| UI policy | 3 | 1 | A |
| Record producer | 1 | 2 | B |
| Flow change | 0 | 0 | Tie (neither) |
Ties tell you nothing about which agent is better, so set them aside and look at the wins. A rough rule using a simple sign test: if one agent wins 10 tasks and the other wins 1, that's very unlikely to be chance. If it's 6 against 5, it's noise, however different the overall percentages look.
Be realistic about sample size. When I asked the Touchstone team about this, they pointed out that with 200 tasks, two agents need about 6.6 points of separation before the difference is real, and at 30 tasks it's roughly 17. A small run can tell you whether an agent is clearly fine or clearly not, but it won't rank two good ones.
6. Watch for these traps
- ☐ Silent fallbacks: Touchstone found one harness quietly finished a session on an older model after a refusal. Check which model actually ran, not which one you asked for.
- ☐ Permission prompts in headless runs: if the harness waits for approval that never comes, the attempt idles until it times out.
- ☐ Harness defaults: features built for interactive use, such as automatic snapshots, can slow headless runs badly on large projects.
- ☐ Leftover state: a reset that misses one table or update set can leak the previous attempt's work.
- ☐ Changing the task mid-run: if you fix a task's wording, retire it and create a new one; don't edit it and keep the old results.
What's next
Part 3 will cover scoring beyond pass/fail: cost per task, consistency across attempts, and the platform hygiene checks (scope, out-of-box changes, update set capture) that catch a passing fix you still wouldn't want in production.
If you've run agents against your own instance, I'd love to hear what tripped you up. Was it the reset, the harness settings, or something I haven't listed here?