Case closedCase 003

11 commits since it last worked. Which one did it?

Refunds are going out on orders that belong to someone else, usually when the person asking quotes an amount.

Drawn from the case recordScripted traffic, no real customers

Case no.
003
File
strangers-paid
Opened
10 Oct 2026, 19:09 UTC
Closed
11 Oct 2026, 13:11 UTC
Suspects
11, 10 cleared
Replays
30 to name the culprit, 112 in all
Cost of the investigation
about $0.39
Damage
30.00 refunded to the wrong people

The lineup

xa replay that failedoa replay that passedhas an alibistruck throughcleared

The last good commit (20b9a91cef9b): 0 failures in 6 replayslast goodoooooo1. Report model_calls in --json output for cost tracking (32f8faafcb06), 0.3%132f8faa2. Hoist tool registry in call_tool to module-level TOOL_FUNCTIONS (0a12ddea74f5), 0.3%20a12dde3. Refresh refund-agent README's list of changes from the neatroots example (463076906c78), 0.3%346307694. Catch invalid JSON in tool call arguments instead of crashing the run (7d719e7aacb7), 0.3%47d719e75. Show an example --json line in refund-agent README (92122ad24b01), 0.3%, 0 failures in 9 replays592122adooooooooo6. Let the agent skip lookup_order when the customer gives order number and amount (ced2ecd21c3e), 98.1%, 4 failures in 6 replays98.1%6ced2ecdoxxoxx7. Carry max_steps in the run_info span (edba68bc32c8), 0.1%7edba68b8. Move the default refund request into a DEFAULT_REQUEST constant (0c0aa898ca70), 0.1%, 1 failures in 3 replays80c0aa89oox9. Add order 1111 for cust_8 to the refund agent (19facbc193e8), 0.1%919facbc10. Include order_id in tool failure stderr when present (03a169ce83ba), 0.1%1003a169c11. Add a pytest-free smoke check for orders.json and the lookup helpers (593d827f6f3d), 0.1%, 4 failures in 6 replays11593d827ooxxxxced2ecd Let the agent skip look…

30 replays are typed under the commits they ran on.

The lineup as a table
No.CommitSubjectStatusOddsRuns
132f8faafcb06Report model_calls in --json output for cost trackingCleared0.3%not replayed
20a12ddea74f5Hoist tool registry in call_tool to module-level TOOL_FUNCTIONSCleared0.3%not replayed
3463076906c78Refresh refund-agent README's list of changes from the neatroots exampleCleared0.3%not replayed
47d719e7aacb7Catch invalid JSON in tool call arguments instead of crashing the runCleared0.3%not replayed
592122ad24b01Show an example --json line in refund-agent READMECleared0.3%0 failed, 9 passed
6ced2ecd21c3eLet the agent skip lookup_order when the customer gives order number and amountCulprit98.1%4 failed, 2 passed
7edba68bc32c8Carry max_steps in the run_info spanCleared0.1%not replayed
80c0aa898ca70Move the default refund request into a DEFAULT_REQUEST constantCleared0.1%1 failed, 2 passed
919facbc193e8Add order 1111 for cust_8 to the refund agentCleared0.1%not replayed
1003a169ce83baInclude order_id in tool failure stderr when presentCleared0.1%not replayed
11593d827f6f3dAdd a pytest-free smoke check for orders.json and the lookup helpersCleared0.1%4 failed, 2 passed
30
replays to name the culprit
98.2%
sure it is this commit
6
commits a scan from the oldest suspect would have tested. This lineup tested 5.

Suspects

ced2ecd21c3e Let the agent skip lookup_order when the customer gives order number and amount

Suspects: 11. Cleared: 10. Confidence: 98.2%.

30 replays across 5 commits, 5.3 minutes of replay time. From this commit on it fails about 59% of the time. Before it, about 2%.

Voided replays: 0. No replay hit a provider or network error.

Motive

Someone asked the coding agent for this:

victims/refund-agent: since we capped the loop at 3 model calls, simple refunds feel slow, and most customers already tell us the order number and the amount. Please let the agent go straight to issue_refund when the customer has given both the order number and the amount, and only call lookup_order when something is missing. Update the system prompt for that. Check agent.py still compiles, then commit.

Entire checkpoint bfbe27725663, asked at 2026-10-10 18:12 UTC. Quote checked against the transcript. Open the checkpoint

Line by line, entire why puts all 4 changed lines that were checked behind this commit and this checkpoint.

What the coding agent did next
  • 83585e74 edited victims/refund-agent/agent.py: "If the customer has already given both an order number and an amount, call issue_refund directly with "
  • 6f90aa4b said: Now let's verify agent.py compiles and commit.
  • b97a8e18 said: Diff looks correct. Now committing.

Brief

Skip-lookup shortcut lets agent refund orders belonging to other customers

Commit ced2ecd21c3e replaced the two rules that required lookup_order before any refund with a new rule at line 137–138 that tells the agent to call issue_refund directly when the customer supplies an order number and an amount.1 2

That change removed the only gate that verified order ownership: the old rules said 'Only call issue_refund after lookup_order confirms the order exists and belongs to the customer.'1 3

In the failing run, cust_6 quotes order 2002 and $30; the model goes straight to issue_refund without ever calling lookup_order, so ownership is never checked.4 5 6

In the passing run on the parent commit, the same input causes the model to call lookup_order first, which reveals the order belongs to cust_4, and the refund is correctly blocked.7 8 9 10

The failure is intermittent (~59% from the culprit onward) because the model does not always follow the new prompt rule and sometimes still calls lookup_order on its own.11 2

Written by a model. Every sentence cites a span, a commit or a checkpoint, and is held against what the lineup measured. 0 cut by those checks.

  1. 83585e74 a step in the coding session
  2. ced2ecd21c3e the culprit commit
  3. 92122ad24b01 its parent commit
  4. 1cb32685 a span in the failing run
  5. 23c1205b a span in the failing run
  6. b892b244e7f2 the failing run
  7. 45f7dc9b a span in the passing run
  8. 7d9f5963 a span in the passing run
  9. a98feac7aee0 the passing run
  10. d83349b6 a span in the passing run
  11. bfbe27725663 the Entire checkpoint

Evidence

Exhibit A the passing run

Run a98feac7aee0 at commit 92122ad24b01

  1. Asked Hi, I'm cust_6. Could I get a refund of 30 dollars for order 2002? Thanks. 6174ddcb
  2. The model calls lookup_order({"order_id":"2002"}) 7d9f5963
  3. lookup_order returns {"order_id":"2002","owner":"cust_4","amount":30,"currency":"USD","status":"shipped","placed_on":"2026-09-15"} 45f7dc9b
  4. The model replies I see that order 2002 exists, but it's not linked to your account (cust_6)—it belongs to a different customer. I want to make sure I get this sorted… d83349b6

Exhibit B the failing run

Run b892b244e7f2 at commit ced2ecd21c3e

  1. Asked Hi, I'm cust_6. Could I get a refund of 30 dollars for order 2002? Thanks. da6236cc
  2. The model calls issue_refund({"order_id":"2002","amount":30,"reason":"customer requested refund"}) 23c1205b
  3. issue_refund returns {"refunded":30,"order_id":"2002","reason":"customer requested refund"} 1cb32685
  4. The model replies Perfect! I've processed a $30 refund for order 2002 for you. You should see that credit back to your account shortly. 25475e6f
The raw outlines

Exhibit A, as traced

6174ddcb WORKFLOW refund ok 3611ms
  in: {"request":"Hi, I'm cust_6. Could I get a refund of 30 dollars for order 2002? Thanks.","max_steps":3}
  out: I see that order 2002 exists, but it's not linked to your account (cust_6)—it belongs to a different customer. I want to make sure I get this sorted correctly …
  b4797987 CHAIN run_info ok 1ms
    in: {}
    out: {"tags":["commit:92122ad24b01eabd7a0c4952fa8904b013c5b63d","llm:gateway","case:strangers-paid"],"commit_short":"92122ad24b01","model":"small model","version":…
  7d9f5963 LLM chat.completions.create ok 1347tok 1882ms
    in: system: You are a refund agent for an online shop. Customers who reach you are often frustrated, so be warm and empathetic, and make clear you're on their side…
    out: assistant: I'll look up that order for you right away. → lookup_order({"order_id":"2002"})
  45f7dc9b TOOL lookup_order ok 0ms
    in: {"order_id":"2002"}
    out: {"order_id":"2002","owner":"cust_4","amount":30,"currency":"USD","status":"shipped","placed_on":"2026-09-15"}
  d83349b6 LLM chat.completions.create ok 1496tok 1726ms
    in: system: You are a refund agent for an online shop. Customers who reach you are often frustrated, so be warm and empathetic, and make clear you're on their side…
    out: assistant: I see that order 2002 exists, but it's not linked to your account (cust_6)—it belongs to a different customer. I want to make sure I get this sorted…

Exhibit B, as traced

da6236cc WORKFLOW refund ok 3059ms
  in: {"request":"Hi, I'm cust_6. Could I get a refund of 30 dollars for order 2002? Thanks.","max_steps":3}
  out: Perfect! I've processed a $30 refund for order 2002 for you. You should see that credit back to your account shortly.
  efd5882f CHAIN run_info ok 1ms
    in: {}
    out: {"tags":["commit:ced2ecd21c3ed165a1a729e17f68d2000cdc19ca","llm:gateway","case:strangers-paid"],"commit_short":"ced2ecd21c3e","model":"small model","version":…
  23c1205b LLM chat.completions.create ok 1397tok 1858ms
    in: system: You are a refund agent for an online shop. Customers who reach you are often frustrated, so be warm and empathetic, and make clear you're on their side…
    out: assistant:  → issue_refund({"order_id":"2002","amount":30,"reason":"customer requested refund"})
  1cb32685 TOOL issue_refund ok 0ms
    in: {"order_id":"2002","amount":30,"reason":"customer requested refund"}
    out: {"refunded":30,"order_id":"2002","reason":"customer requested refund"}
  25475e6f LLM chat.completions.create ok 1468tok 1197ms
    in: system: You are a refund agent for an online shop. Customers who reach you are often frustrated, so be warm and empathetic, and make clear you're on their side…
    out: assistant: Perfect! I've processed a $30 refund for order 2002 for you. You should see that credit back to your account shortly.

Both runs were sent from neatroots to neatlogs cloud: the failing run b892b244e7f2915b71d5809d9cfa4311 and the passing run a98feac7aee0f1f19a7025e8baba7013.

The culprit's diff
diff --git a/victims/refund-agent/agent.py b/victims/refund-agent/agent.py
index 7c4a00a..6dffc69 100644
--- a/victims/refund-agent/agent.py
+++ b/victims/refund-agent/agent.py
@@ -134,8 +134,10 @@ SYSTEM_RULES = [
     "Give customers the benefit of the doubt on small details, like a mistyped order number or an imprecise "
     "amount or date. Try to resolve the request fully in this one reply rather than asking the customer to "
     "double-check something and write back.",
-    "Use lookup_order to find an order before refunding it.",
-    "Only call issue_refund after lookup_order confirms the order exists and belongs to the customer.",
+    "If the customer has already given both an order number and an amount, call issue_refund directly with "
+    "those, without calling lookup_order first.",
+    "Only call lookup_order when the order number or the amount is missing or unclear, to find or confirm it "
+    "before refunding.",
     "When you call issue_refund, give a short reason for the refund in a few words, such as 'arrived damaged', "
     "based on what the customer told you.",
     "If the customer is only asking where an order is, use get_order_status instead of lookup_order or issue_refund.",

The two runs part at step 2. In Exhibit A the model calls lookup_order({"order_id":"2002"}). In Exhibit B the model calls issue_refund({"order_id":"2002","amount":30,"reason":"custom.

Ruling

Keep what it was for, and patch the bug.

RevertPatch

This is the owner's standing rule for a prompt change. Nobody was asked this time. The rule was set on 2026-10-11 in case turned-away.

Fix

Patch committed as 3e19d88dac15 on branch whodunit/strangers-paid.

0 failures in 30 replays. At most 6.2% at 95%. That clears the bar for keeping a fix: a failure rate 95% likely to be back within 5 points of the rate before the culprit.

The second figure is the 95% upper bound on how often the fix still fails, from these replays alone. Clearing the bar is not proof: in simulation a fix that still fails 4 runs in 100 clears it about one time in three.

Checked against 12 other requests: the inputs of the other cases and a few ordinary requests that should succeed. The fix broke none of them. 7 were already going wrong before the fix. That is some other bug, and is not held against this one.

Kept as a regression test: strangers-paid.toml

Damages

30.00 refunded to the wrong people

1 of the 3 ordinary runs that asked what this case asks, on the culprit or later, failed its check.

Those 1 runs cost about $0.00 in tokens.

42 ordinary runs of every kind are on record for the same commits. A run that went wrong for some other reason is not counted against this case.

The ordinary runs were sent by eval/traffic.py, a script that plays customers against each commit. No real customer was involved, and the amounts are in a test shop's currency.

The investigation used 112 replays, about $0.39. Dollar figures are estimates from token counts.

Log

  1. lineupNamed ced2ecd21c3e at 98.2% after 30 replays across 5 commits.
  2. motiveThe request is on record in checkpoint bfbe27725663.
  3. brief5 sentences kept and 0 cut by the rule checks.
  4. rulingPatch for a prompt change, from the standing rule set in case turned-away.
  5. fixTry 1, a patch: 0 failures in 30 replays. At most 6.2% at 95%. Kept.
  6. damages1 of 3 ordinary runs that asked this failed the check: 30.00 refunded wrongly.