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
30 replays are typed under the commits they ran on.
The lineup as a table
| No. | Commit | Subject | Status | Odds | Runs |
|---|---|---|---|---|---|
| 1 | 32f8faafcb06 | Report model_calls in --json output for cost tracking | Cleared | 0.3% | not replayed |
| 2 | 0a12ddea74f5 | Hoist tool registry in call_tool to module-level TOOL_FUNCTIONS | Cleared | 0.3% | not replayed |
| 3 | 463076906c78 | Refresh refund-agent README's list of changes from the neatroots example | Cleared | 0.3% | not replayed |
| 4 | 7d719e7aacb7 | Catch invalid JSON in tool call arguments instead of crashing the run | Cleared | 0.3% | not replayed |
| 5 | 92122ad24b01 | Show an example --json line in refund-agent README | Cleared | 0.3% | 0 failed, 9 passed |
| 6 | ced2ecd21c3e | Let the agent skip lookup_order when the customer gives order number and amount | Culprit | 98.1% | 4 failed, 2 passed |
| 7 | edba68bc32c8 | Carry max_steps in the run_info span | Cleared | 0.1% | not replayed |
| 8 | 0c0aa898ca70 | Move the default refund request into a DEFAULT_REQUEST constant | Cleared | 0.1% | 1 failed, 2 passed |
| 9 | 19facbc193e8 | Add order 1111 for cust_8 to the refund agent | Cleared | 0.1% | not replayed |
| 10 | 03a169ce83ba | Include order_id in tool failure stderr when present | Cleared | 0.1% | not replayed |
| 11 | 593d827f6f3d | Add a pytest-free smoke check for orders.json and the lookup helpers | Cleared | 0.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.
- 83585e74 a step in the coding session
- ced2ecd21c3e the culprit commit
- 92122ad24b01 its parent commit
- 1cb32685 a span in the failing run
- 23c1205b a span in the failing run
- b892b244e7f2 the failing run
- 45f7dc9b a span in the passing run
- 7d9f5963 a span in the passing run
- a98feac7aee0 the passing run
- d83349b6 a span in the passing run
- bfbe27725663 the Entire checkpoint
Evidence
Exhibit A the passing run
Run a98feac7aee0 at commit 92122ad24b01
- Asked Hi, I'm cust_6. Could I get a refund of 30 dollars for order 2002? Thanks. 6174ddcb
- The model calls lookup_order({"order_id":"2002"}) 7d9f5963
- lookup_order returns {"order_id":"2002","owner":"cust_4","amount":30,"currency":"USD","status":"shipped","placed_on":"2026-09-15"} 45f7dc9b
- 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
- Asked Hi, I'm cust_6. Could I get a refund of 30 dollars for order 2002? Thanks. da6236cc
- The model calls issue_refund({"order_id":"2002","amount":30,"reason":"customer requested refund"}) 23c1205b
- issue_refund returns {"refunded":30,"order_id":"2002","reason":"customer requested refund"} 1cb32685
- 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
- lineupNamed ced2ecd21c3e at 98.2% after 30 replays across 5 commits.
- motiveThe request is on record in checkpoint bfbe27725663.
- brief5 sentences kept and 0 cut by the rule checks.
- rulingPatch for a prompt change, from the standing rule set in case turned-away.
- fixTry 1, a patch: 0 failures in 30 replays. At most 6.2% at 95%. Kept.
- damages1 of 3 ordinary runs that asked this failed the check: 30.00 refunded wrongly.