The Frame Check: Why Agent Tests Pass Duplicate Orders and Unrequested Edits, and the Before/After State Diff That Catches Them
Most tests of AI agents check that the requested change happened. Almost none check that nothing else changed. What five recent papers found when they looked at the second question, a toy demo you can copy, and the two-part test to add to any agent that writes to a real system.

An agent is asked to send payment requests to the coworkers who didn't pay their share of a work dinner. The correct run sends three requests. Then it repeats the last write. Now there are four requests and an extra notification on someone's phone.
The benchmark's tests pass it. Same as the correct run.
That is one task from Richard Abrich's audit of the AppWorld and WorkArena verifiers (arXiv:2610.09142v3). Every test you have asks one question. Did the thing happen. Nobody asks the second one. What else happened.
1. Two gates, and most suites only light one
A correct run does two things. It makes the requested change, and it leaves everything else alone. Program specification has had names for those two halves since McCarthy and Hayes in 1969, which Abrich cites: the postcondition and the frame condition.
I'm calling the second half the Frame Check. Every test of an agent, or of code an agent wrote, needs both:
- Postcondition: did the asked-for thing happen?
- Frame: what else changed, and was it allowed?
The first one is what nearly every assertion you've ever written does. The second one is where the damage lives.

2. The verifiers passed every extra change
Abrich mutation-tested both verifiers. He took correct runs, made hand-written edits designed from the verifier source, and confirmed each false positive with an end-state check.
The result is about as clean as these things get. All confirmed false positives were unrequested changes. Planted omissions and wrong values produced none. The verifiers were strict about the asked-for thing and blind to everything next to it.
- AppWorld's tests passed a duplicate write in all six tasks of two templates.
- One count assertion per template rejected all six duplicates and still passed every correct run.
- WorkArena's form verifier, called once after submission, passed all 36 edited runs that filled an unrequested field.
- Called after every field, it caught extra fields filled first or in drop-downs, but still passed all 8 runs that filled a text or reference field last.
A verifier that passes 36 of 36 runs with an extra field filled isn't lenient. It just never looked.
It gets worse because these verdicts are also training rewards. Abrich reports that three reinforcement learning methods that train on one of these templates would fully reward the duplicate. The blind spot doesn't only hide the behavior. It pays for it.

3. Too strict on one axis, blind on the other
This is what makes it a pattern and not a bug. The same kind of tests that ignore unrequested damage are often too strict about details nobody asked for.
Avi Aggarwal and Yiran Hu at Purdue looked at SWE-bench-style benchmarks, where an agent's patch is graded by tests taken from the original fix (arXiv:2611.31839). Those tests were written to confirm one fix works, not to accept every fix that works. One of their examples: a Django issue asks that a date widget stop crashing on a huge year. The test requires the function to return exactly the string "0-0-0". The issue never says what to return.
Two LLM judges flagged 23% of SWE-bench Verified and 35% of public SWE-bench Pro tasks as overspecified. On 206 validation tasks they caught 89% of the known overspecified ones and wrongly flagged 4% of the fine ones. The top 30 Verified submissions resolve 31% of flagged tasks on average, against 88% of the rest. Relaxing the tests let 61% of 2,186 failed patches on flagged tasks pass.
Put that next to Abrich. Tests demand details the task never stated, and ignore damage the task never asked for. That isn't loose or tight. It's calibrated on the wrong axis.
Caveat: the flags come from LLM judges, validated against human audits, and the leaderboard shift is a counterfactual regrade.
4. Agents don't have transactions. They have retries
You could argue unrequested changes are rare. Artem Trofimov and Boris Novikov measured how often they actually happen when an agent recovers from its own mistakes (arXiv:2611.31554).
The setup is common. An agent submits a block of code with several writes. The block fails halfway. The first writes already took effect. The agent gets an error, rewrites the block, and runs it again.
In a stratified sample of 200 AppWorld episodes across ten models, 145 were confirmed partial executions. 30 of the 143 with a determinable outcome were followed by a harmful recovery that was still there at the end of the run. Weighted, that's 24.6% (95% interval 15.6 to 34.4). Two thirds of the harmful recoveries duplicated an effect. The rest deleted user data or made a wrong first-time write, like ordering the wrong product.
A rule that looks for repeated calls found 75% of the duplications but only 41% of all harm. Idempotency IDs supplied by the model didn't detectably help in a 17-episode pilot with one local model, because the model issued a new ID for the same operation.
A retry is a second write. If your test only checks that the order exists, it can't tell one order from two.
Caveat: 136 of the 145 confirmed episodes are in AppWorld's shopping app. One benchmark.
And don't count on cleaning it up after. Kaviru Hapuarachchi graded 50 agent harnesses and runtimes on their recovery mechanisms, using public reports of those mechanisms in real runs (arXiv:2611.27090). Of 128 such reports, 19 describe the run fully recovering, 54 partial, 45 failed, and 10 unclear. Checkpoint/resume recovered once in 27 reports. Rollback recovered once in 15. Compensation of external effects, undoing what already went out to another system, is offered by no harness at all. Public reports lean toward failures, so read this as a record of incidents, not a failure rate.
5. Green and covered still isn't caught
The usual signals won't warn you either. In SpecEngineeringBench (Xingjian Wang and 12 co-authors, arXiv:2611.32973), seven frontier coding agents wrote tests for 100 instances with recorded defects. Their tests reached a 91.47% Head Pass Rate and 80.48% change-focused coverage. Their Fail-to-Pass Rate, the share of tests that fail on the defective code and pass on the repaired code, was 26.36%.
The authors' explanation is the one I'd expect: agents encode what the implementation currently outputs into the assertions. The test describes the code. It doesn't check the requirement. Pass rate and coverage tell you the test ran. They don't tell you it would notice.
6. A toy version of the Frame Check
To make the two gates concrete we wrote a toy demo. This is an illustration, not a measurement: one task, five hand-written runs, a short Python script.
The task is "place order A1 and set plan to pro." The postcondition-only check asks whether an A1 order exists and the plan is pro. The frame check takes the state before the run, applies only the requested change, and requires the state after the run to match it exactly.

| Run | Postcondition only | Postcondition + frame |
|---|---|---|
| correct | PASS | PASS |
| duplicate write | PASS | FAIL |
| unrequested field edit | PASS | FAIL |
| wrong value | FAIL | FAIL |
| omission | FAIL | FAIL |
Same shape as Abrich, on a toy. Omissions and wrong values get caught by the normal check. Extras sail through. The frame check is a few lines: snapshot, expected diff, compare. Real systems need an allowlist for fields that legitimately change on their own, like timestamps and audit logs. That allowlist is the frame, written down.
7. What to change, and my prediction
The pattern I keep hearing from QA and DevOps teams: the bugs that hurt are rarely the missing feature. They're the thing that changed next to it.
For any agent, or agent-written code, that writes to a real system:
- Snapshot the state before. Diff it after. Fail on any change the task didn't ask for and the allowlist doesn't cover.
- Count, don't just find. "An order exists" passes a duplicate. "Exactly one new order" doesn't.
- Check after the last write, not only once at submit. Abrich's per-field run still missed fields filled last.
- Treat a retry as a second write in your tests. Plant the half-finished block and see what the recovery leaves behind.
- Don't trust pass rate or coverage as proof the tests would catch a break. Break something on purpose and see.
My prediction, and it's an opinion, not a finding: by 2028, "what else changed?" will be a standard line in agent evals and in release reviews of AI-written code, right next to "did it pass?".
8. Where OrangePro fits
Green CI shows what passed, not what's protected. OrangePro runs on the merged build, after merge and before release. It isn't a PR gate or a release gate. It challenges the tests you already have with targeted faults (mutation) to show which ones would miss a meaningful break. Where it finds a gap, it delivers a reviewable, test-only patch with execution evidence.
A frame-style break, an extra or duplicate effect, is exactly the kind of gap the papers above say tests miss. Mutation is how you find out whether yours would. OrangePro doesn't monitor agents at runtime and doesn't prevent production issues by itself. It gives reviewers evidence they can check.
If your code wrote twice tomorrow, which test would fail?
Related: The Judge Said It Was Fine, on LLM judges that passed forbidden writes, Verifier Debt, and the guide to testing code from Claude Code and Cursor.
Sources
- Richard Abrich. "Finding Side-Effect Loopholes in AppWorld and WorkArena Verifiers." arXiv:2610.09142v3, 16 Nov 2026 (v1 6 Oct 2026). https://arxiv.org/abs/2610.09142
- Avi Aggarwal, Yiran Hu. "Spec-Test Coverage Gap: Detecting Overspecified Tests in SWE-Bench-Style Benchmarks." arXiv:2611.31839, 24 Nov 2026. https://arxiv.org/abs/2611.31839
- Artem Trofimov, Boris Novikov. "Agent Recovery Gone Wrong: Measuring Harm Beyond Duplicate Calls." arXiv:2611.31554, 23 Nov 2026. https://arxiv.org/abs/2611.31554
- Kaviru Hapuarachchi. "Exercised, Rarely Recovered: What Public Reports Say About Recovery in 50 AI Agent Harnesses and Runtimes." arXiv:2611.27090, 20 Nov 2026. https://arxiv.org/abs/2611.27090
- Xingjian Wang et al. "SpecEngineeringBench: Evaluating Coding Agents as Autonomous Specification Engineers." arXiv:2611.32973, 24 Nov 2026. https://arxiv.org/abs/2611.32973
Header photo: Hippolyte Blancard, "Accident de train de la gare Montparnasse du 22 octobre 1895." Musee Carnavalet, Paris Musees (PH78193). CC0, via Wikimedia Commons.
Want to see it on your code?
Bring one real pull request and we will run OrangePro on it with you. The first 30-minute call is free.