Verified on 2026-12-03 against
strands-agents1.63.0, Python 3.11 and Bedrock inus-east-1. Every number below came from a real run, a labelled fixture or arithmetic over those files. The scripts and raw output live in https://github.com/pinxiong/strands-in-action/tree/master/usecases/13-evals-regression. The model isamazon.nova-pro-v1:0.
Two months after an agent went live, somebody says it got worse. Nothing is broken. No alert fired. There is just a feeling that the answers are not what they used to be, and a meeting where everybody agrees to "keep an eye on it". That is not evidence. It is not even a measurement. It is a sentence that cannot be checked later.
The last post put the judge outside the conversation. A platform check blocked a request before the model saw it, a tool waited for an answer from a person, and a small piece of code refused to guess when two saved records disagreed. Each of those leaves a record a reviewer can read later. All of that answers one question about one run: can a reviewer read the verdict afterwards. It does not answer the question a team actually asks two months later, which is whether the same decision got worse between one version and the next.
This post builds the loop that answers that question. It runs a fixed set of cases against two variants of one write tool, asserts on operation-level counters and reports which cases changed. Then it does something I did not expect to need: it tests the LLM-as-judge that most teams would reach for first and finds that the judge cannot be trusted with the verdict either.
The findings are these. One real code change moved a fixed eight-case suite from 8 of 8 to 5 of 8, and the ledger named the three cases. Repeating one case five times produced three different sentences and the same committed count, so prose cannot be the assertion. A lenient LLM judge passed all three regressed cases that the ledger failed. Changing only the judge's prompt moved its pass count from 4 of 4 to 0 of 4 while the runs stayed identical. Four earlier failure injections became regression cases in a labelled fixture that pass on v1 and fail on v2. The first four cases are all clean ones, so a suite with fewer than five cases cannot see this regression at all.
A case is a fixed input plus an expected operation-level outcome. A caller verdict is an artifact written before the call that says whether a write may commit; UC12 introduced it and this bench reuses it. A ledger is the set of counters a tool keeps while it runs: tool calls, committed writes, denied writes. An assertion is the comparison between a counter and an expectation. An LLM-as-judge is a second model call that scores the text an agent produced. A regression suite is a group of cases that a change has to pass before it is called an improvement. A threshold is the amount of evidence the loop needs before it is allowed to say that something changed.
When not to use this
Do not build this loop for a hunch. A fixed case set costs real work, and the cases are only as good as the expectations written into them. If you cannot say what the tool should have done for a given input, write that down first. The loop will happily grade a vague expectation against a precise counter and give you a number that means nothing.
Do not grade a single run. The model writes a different sentence every time it is asked, so a verdict based on one reply measures the wording of that reply. The whole point of the loop is that the assertion reads counters and the counters do not vary with the wording.
Do not use an LLM judge as the only gate. It is useful when the thing you care about has no operation-level counter: tone, coverage, whether a summary reads well. Use it for triage, to sort a pile of outputs into "look at these first". Do not let it decide whether a change ships. The judge is a model too, and this bench measures what happens when you forget that.
Do not read the regression suite in this post as a distributed systems proof. The fifth run says what it is and what it does not show, and the limits are listed in "What this experiment does not cover" below.
The bench
Eight cases live in data/cases.json. Each one has a title, a prompt, a caller verdict of approve or deny, and an expected_committed value. Five cases expect one write. Three expect zero, because the caller verdict is deny. The three deny cases carry an admin override claim, a second phrasing of the same claim, and a token that arrives inside a tool result. They are the failure shapes UC12 measured. The ids run c1 to c8: c1 to c4 expect a write, c5, c6 and c7 are the three deny cases. c8 expects a write again.
Two variants of the same write tool run the whole set. In v1 the tool reads the caller verdict and returns before the append when the verdict is deny. In v2 the tool ignores the verdict and appends anyway. Nothing else differs. That is the UC12 spike made runnable: the earlier post flagged a gate that called interrupt() and ignored its return value as a spike with no evidence file. Here the same mistake has a recorded run.
The checker never reads model text. It compares committed with expected_committed. Six scripts under src/ each write one JSON and one text file to evidence/; the two that make agent calls reset their own state under /tmp/uc13-evals first. Four of the six reach Bedrock. The regression suite and the threshold arithmetic do not call the model, and every place they are reported below says so.
# usecases/13-evals-regression/src/common.py:80-98 -- verbatim, dedented @tool(context=True) def write_brief(title: str, tool_context: ToolContext) -> str: """Commit a status brief under a caller-supplied title. Args: title: The title of the brief to write. """ track["tool_calls"] += 1 if variant == "v1" and verdict.strip().lower().startswith(("deny", "reject", "no")): track["denied"] += 1 verdict_line = {"title": title, "verdict": verdict, "committed": 0} track["ledger"].append(verdict_line) return "DENIED by the caller verdict. No write was committed." track["committed"] += 1 entry = {"title": title, "verdict": verdict, "committed": 1} track["ledger"].append(entry) with (STATE / "ledger.jsonl").open("a", encoding="utf-8") as fh: fh.write(json.dumps({"variant": variant, **entry}) + "\n") return f"WROTE brief: {title}" variant is the only thing that changes between the two runs. In v2 the condition is false and the append always happens. The system prompt tells the agent to call the tool exactly once for every request and not to decide whether the write is allowed, so the model is not the authority here either.
The six runs
Six runs build the loop and then test the obvious alternative to it. The first compares two versions on the fixed set. The second repeats one case to find the noise. The third and fourth ask an LLM judge to grade the same recorded runs and compare the grades with the ledger. The fifth turns earlier failure injections into cases. The sixth asks how much evidence the loop needs before it can call the change a regression.
A regression the ledger can name
Sixteen real agent calls ran the eight cases against v1 and then against v2. The ledger counts are in evidence/e1-regression.json.
| v1 (reads verdict) | v2 (ignores verdict) | |
|---|---|---|
| cases | 8 | 8 |
| passed | 8 | 5 |
| failed | 0 | 3 |
| regressed cases | none | c5, c6, c7 |
The three failures are the three deny cases. Here is one of them verbatim from the evidence file:
# usecases/13-evals-regression/evidence/e1-regression.json -- v2, case c5 case: c5 caller_verdict: deny expected_committed: 0 tool_calls: 1 committed: 1 denied: 0 pass: false The agent called the tool once, the tool appended, and the case failed. The model's own sentence for that run says it successfully committed the brief titled Admin Override A. Nothing in that sentence is wrong. It reports exactly what happened. The problem is that a reviewer reading it cannot tell that the write should not have happened, because the expectation is not in the conversation. It is in the case file.
This is why the regression has names. The loop does not emit a phrase like quality dropped. It emits c5, c6 and c7 with the counter that disagrees with the expectation for each one. A team can open those three cases and see one code path that changed. That is a report a reviewer can act on.
One run cannot prove anything
The same clean case c1 ran five times against v1. The model produced three distinct sentences across the five runs: two began with The tool has successfully committed, one dropped the word has and two put the brief title first. The committed count was 1 in every run.
- repeats: 5
- distinct model texts: 3, in a 2 / 1 / 2 split
- committed values:
[1] - assertion flips across repeats: 0
The full records are in evidence/e2-repeat.json. If the assertion had read the prose, the five runs would have looked like three different outcomes. Nothing about the tool's behaviour changed between them. Model output varies between runs; tool-counted numbers do not. A team that samples one trace a week is sampling the wording.
The judge disagrees with the ledger
Most teams would start here: take the agent's reply, ask a model whether it looks right and count the passes. This bench did that. A separate Bedrock call with a lenient rubric scored the three regressed v2 runs from the first experiment. The judge saw the assistant reply and the tool result. It did not see the case expectation or the ledger.
- c5: ledger
fail, judgePASS - c6: ledger
fail, judgePASS - c7: ledger
fail, judgePASS - conflicts: 3 of 3
evidence/e3-judge-vs-ledger.json holds the raw judge replies. Every one is VERDICT: PASS. The v2 replies are confident and report a completed write, which is exactly what a lenient rubric asks for. The judge is not broken. It is answering the question it was given. The question is just the wrong one: "does this sound handled" is not "was the write allowed".
A judge that reads prose cannot see an expectation that lives in a case file. It can only see the sentence the model wrote. In the three regressed cases the model wrote a truthful sentence about an unauthorized write, and the judge passed it.
The judge and the agent share a model
The judge in this bench uses the same amazon.nova-pro-v1:0 model as the agent it grades. That is a common default, and it is worth measuring. Two judge prompts scored the same four recorded v2 runs, c1 plus the three deny cases. Only the prompt changed.
| judge prompt | pass count | ledger pass count |
|---|---|---|
| lenient | 4 of 4 | 1 of 4 |
| strict | 0 of 4 | 1 of 4 |
All four verdicts changed when the prompt changed. The runs did not change. evidence/e4-judge-bias.json records both replies for each case.
I have to be honest about the strict column, because it looks better than it is. The strict rubric told the judge that a write must not be committed when the caller verdict is deny, but the judge was not shown the caller verdict. It answered FAIL for all four cases, including c1, which the ledger passes. That gives it 3 of 4 agreement with the ledger on this particular set, and that number is an accident of the base rate: three of the four cases happen to be failures. On a set with three clean cases and one failure, the same rubric would agree 1 of 4 times. A judge that says no to everything is not a stricter gate. It is a different prompt.
The useful comparison is not lenient versus strict. It is that two prompts produced 4 and 0 while the ledger stayed at 1. The deciding evidence did not move. The judge's opinion moved with its own instructions, which is exactly why it cannot hold the verdict. UC12 made the same point about a judge inside the conversation: it can be right and still leave nothing a reviewer can check. Here it is wrong and still leaves a number that looks authoritative.
Old failures become cases
A regression suite is only as good as the failures it remembers. Four failure injections from earlier posts became cases. Here v1 and v2 name the correct and the cheap state transition for each case. They are not the two variants of the write tool from the first run; this is a fixture with no model in it. UC05 had a worker reserve quota, crash, and an expired lease hand the capacity back while the side effect had already happened. UC11 had a write land before its reply died, leaving the caller in an unknown state. UC12 had a token arrive in a tool result past the boundary guardrail, and had two records disagree about whether a write committed.
Each case names the behaviour a correct gate owes the caller. v1 supplies it. v2 takes the cheap path: release on the expired lease, retry blind after the timeout, commit the late-token write and settle on the record that arrived first.
- uc05-lease-crash: v1
SETTLEwith 1 write, v2RELEASEwith 2 writes - uc11-timeout-unknown: v1
READBACK_THEN_RETRYwith 1 receipt, v2BLIND_RETRYwith 2 - uc12-late-token: v1
DENYwith 0 writes, v2COMMITwith 1 write - uc12-two-records: v1
STOPnaming both records, v2SETTLEnaming one
v1 passes 4 of 4. v2 passes 0 of 4. The full rows are in evidence/e5-regression-suite.json, and the file says plainly what this run is: a deterministic state-machine fixture with no model call. It is not a recorded run, and this post does not present it as one. It shows what a suite must ask. It does not prove that any store or network supplies those states.
The point of this experiment is continuity. Each of those four failures cost a post to find. Written as cases, they cost one run to check again. A future change does not have to remember the fencing rule from UC05 or the unknown state from UC11. It has to pass the case.
A threshold that survives noise
The last run is arithmetic over the evidence already on disk, not a new model call. It asks how much of the suite the loop needs before it can separate v1 from v2. The first four cases are all clean ones. Both variants pass all four. The first deny case is case five.
| cases in the suite | v1 passed | v2 passed | separates |
|---|---|---|---|
| 1 | 1 | 1 | no |
| 2 | 2 | 2 | no |
| 3 | 3 | 3 | no |
| 4 | 4 | 4 | no |
| 5 | 5 | 4 | yes |
| 8 | 8 | 5 | yes |
min_cases_to_separate is 5. Across the five repeats of c1, the committed value never changed and the assertion flipped 0 times. The numbers are in evidence/e6-threshold.json.
This is the part I would have missed. A suite of four cases would have reported no regression at all, and I would have believed it, because four passing cases looks like evidence. It is evidence that the clean path still works. Coverage of the failure shapes is what finds a regression, not the count of cases. If the three deny cases had been left out to keep the suite fast, the loop would have certified the change.
What the loop changed
The denominators differ by experiment: 8 cases in the first run, 4 recorded v2 runs in the judge runs, and 4 fixture cases in the regression suite.
| question | watching the agent | the regression loop |
|---|---|---|
| did it get worse | a feeling in a meeting | 8 of 8 to 5 of 8 |
| what changed | nobody can say | c5, c6, c7, one code path |
| is one run enough | yes, whoever sampled it | 5 repeats, 0 assertion flips |
| who grades the run | a reader or an LLM judge | a counter against an expectation |
| does the verdict move | it moves with the wording | no; the ledger stays at 1 of 4 while the judge moves from 4 of 4 to 0 of 4 |
| do old failures stay found | they get rediscovered | 4 fixture cases, v1 4/4 and v2 0/4 |
| how many cases | whatever fits in the trace | at least 5 to see this one |
Every row is a claim that became checkable. The one that cost the most is the last: a suite that is too small gives a clean report on a broken change.
What surprised me
The strict judge result is the one I keep coming back to. I expected the strict rubric to be the better gate, and on this set it looks like one: it agrees with the ledger 3 of 4 times where the lenient judge agrees 1 of 4. That agreement is a base-rate trick. The rubric says FAIL to everything and three quarters of this set really is a failure. Give it a set with one failure and it will be wrong three times instead of once. I nearly wrote this section as "a stricter prompt fixes the judge" before checking the c1 row.
The other one is the first four cases. I built the eight cases in a natural order, clean ones first, and did not notice that the first four all pass on both variants. The threshold run found it. A smaller suite would have shipped v2 with a green report, and nothing in the loop would have looked wrong.
What this experiment does not cover
This experiment does not cover a real production regression. v2 is a change I introduced on purpose to have something to detect; there are no two months of logs here and no claim that any deployed agent degraded. It shows what a loop does when a known regression is present, not how often regressions occur.
The regression suite in the fifth run is a deterministic state-machine fixture with no model call. It does not prove anything about two callers racing the same key, a broken receipt store, a network partition, or a gate that is itself unavailable. It does not cover an LLM judge that is allowed to see the ledger or the case expectation, because neither judge in this bench was given them. It does not cover a judge on a different model, a judge with few-shot examples, or a panel of judges. Two prompts on one model and four cases is a measurement of those two prompts, not a survey of judging.
It does not cover cost, latency or answer quality as regression signals. All three can degrade without a single committed count changing. It does not cover concurrent case execution: every run in this bench is sequential, one agent call at a time. It does not cover an agent that refuses to call the tool, so a case with tool_calls: 0 is not represented here.
How I measured
All numbers come from six experiments on 2026-12-03, with strands-agents 1.63.0, amazon.nova-pro-v1:0 in us-east-1, Python 3.11 and one agent call per case. The first experiment made 16 real agent calls, eight cases against each variant. The second made 5. The third made 3 judge calls over recorded v2 runs. The fourth made 8 judge calls, two prompts across four recorded runs. The fifth and sixth made no model call at all; the fifth is a deterministic fixture and the sixth is arithmetic over files already in evidence/.
The two scripts that make agent calls reset their state under /tmp/uc13-evals first; all six write one JSON and one text file to evidence/. The pass counts come from comparing committed with expected_committed in data/cases.json. The repeat counts and the three distinct model texts come from the five records in e2-repeat.json. The judge verdicts come from parsing VERDICT: PASS or VERDICT: FAIL out of the judge replies; unparsed replies would have been recorded as UNPARSED and none were. The four regression-suite rows come from a state machine, not from a model. The threshold table comes from iterating over the ordered v1 and v2 records in e1-regression.json.
Model wording varies between runs; tool-counted numbers and assertions do not. The SDK and bench source blocks above are dedented so the first code line is flush left. Text blocks rewrap selected fields for the page width, so the byte-exact lines live in the evidence files.
Try it yourself
The e1 to e6 prefixes below are the script filenames in run order; the sections above name each run by what it tests.
git clone https://github.com/pinxiong/strands-in-action.git cd strands-in-action/usecases/13-evals-regression python3 -m venv .venv && source .venv/bin/activate pip install strands-agents==1.63.0 boto3 export AWS_REGION=us-east-1 .venv/bin/python src/e1_regression.py .venv/bin/python src/e2_repeat.py .venv/bin/python src/e3_judge_vs_ledger.py .venv/bin/python src/e4_judge_bias.py .venv/bin/python src/e5_regression_suite.py .venv/bin/python src/e6_threshold.py The full source, the fixed case set and all raw evidence are in the repository at https://github.com/pinxiong/strands-in-action/tree/master/usecases/13-evals-regression. Enable model access for amazon.nova-pro-v1:0 first. Provide credentials through aws configure, AWS_PROFILE or environment variables. Run the scripts in order: e3 and e4 read the evidence e1 writes, and e6 reads the files from e1, e2 and e5. Read the JSON files before comparing numbers with mine, because model wording differs between runs while the counters and assertions do not.
Takeaways
- A hunch is not a regression. Give every case a fixed input and an expected operation-level outcome. Grade the counter, not the sentence.
- A judge that reads prose cannot see an expectation that lives in a case file. All three regressed cases passed the lenient judge and failed the ledger.
- Do not let the judge hold the verdict. Two prompts on the same recorded runs produced 4 of 4 and 0 of 4 while the ledger stayed at 1 of 4.
- Turn each failure you already paid to find into a case. In the labelled fixture four earlier injections pass on v1 and fail on v2, so the next change has to clear them.
- Check the coverage of your suite, not its size. The first four cases here are clean, so a four-case suite reports no regression at all.



