Skip to content
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
139 changes: 139 additions & 0 deletions content/posts/screenshots-are-not-state/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
title: "Screenshots are not state: checking GUI agents where they save"
date: 2026-12-01
draft: false
author: "Richard Abrich"
tags: ["agents", "benchmark", "validation", "research", "openadapt"]
description: "A per-step visual critic blocks most clean runs, and a newer model still saves records twice after a crash. Checking only at saves fixes both."
thesis: "Checking GUI agents only where they save, with an on-disk log of finished saves, cut mid-batch crash duplicates from 10 of 16 runs to 0 of 16."
audience: "developer"
post_type: "essay"
---

Computer-use models are much better than a year ago at clicking the right button on one screen.
On multi-step work they still report success when the form was never submitted, when a required
tab was skipped, or when a crashed worker restarted and saved the same record twice.

Our paper, [Screenshots Are Not State: Transactional Verification and Compilation for GUI
Agents](https://arxiv.org/abs/2611.39728), measures these failures on six external benchmarks and
on live apps. The runtime ([OpenAdapt](https://github.com/OpenAdaptAI/OpenAdapt)) and the
evaluation code ([openadapt-evals](https://github.com/OpenAdaptAI/openadapt-evals)) are MIT
licensed.

![Where per-step checks fail and where OpenAdapt checks instead](fig1_architecture.png)

## A critic on every step blocks clean runs

A common guard is to ask a vision model before every click whether the action looks right. Two
things go wrong.

False alarms add up. If the critic wrongly blocks 5% of good steps, a 25-step task is blocked
before it finishes 72% of the time (1 - 0.95^25). On 63 clean runs from OSWorld-Verified, a
per-step critic blocked all 63, adding a median of 2,945 ms of critic time per run (about 490 ms
per check).

One screenshot also can't show what happened elsewhere. From the active window alone, a person
can't tell whether another tab was updated, whether an email went to Sent or stayed in Drafts, or
whether the worker saved item 1 before it crashed.

## What a newer model changed

We ran one model upgrade against two kinds of failure.

On DesktopChaosBench, our small synthetic suite (25 single-button tasks with mixed DPI scaling,
lossy video, missing accessibility trees, focus-stealing pop-ups and remote-desktop
disconnects), moving from gpt-5.6-luna to gpt-6.1-terra took the unwrapped agent from 3 of 25 to
25 of 25.

On EnterpriseSessionBench, we gave the agent two records to save through the browser in four
self-hosted apps (Gitea, Mealie, Vikunja and Memos), killed the process with SIGKILL after the
first save, and restarted it. The agent made no backend API calls. Moving from gpt-5.6-sol to
gpt-6.2-sol barely changed the duplicate rate: 11 of 16 runs saved a record twice before the
upgrade and 10 of 16 after.

| gpt-6.2-sol, 16 runs, SIGKILL after record 1 | Verified completion (VCR) | Silent errors (SER) | Duplicate records | Model calls |
| :--- | :---: | :---: | :---: | :---: |
| Unwrapped | 3/16 (18.8%) | 9/16 (56.3%) | 10/16 (62.5%) | 188 |
| openadapt.wrap, fresh state per run | 16/16 (100%) | 0/16 | 0/16 | 66 |
| openadapt.wrap, state kept across runs | 16/16 (100%) | 0/16 | 0/16 | 21 |

Exact McNemar tests against unwrapped: VCR p = 0.000244, duplicates p = 0.00195, SER p = 0.00391.
The wrapper's duplicate rate was also 0 of 16 on gpt-5.6-sol, where its verified completion was
9 of 16.

![Duplicate records after a mid-batch SIGKILL, two model generations](fig2b_sigkill_crash.png)

## Checking only where the agent saves

`openadapt.wrap` lets reading and navigation run unchecked. It checks only the few actions that
change data or cross a policy rule.

Before a save, it checks where each value came from, the policy rules and the accessibility
structure in under 5 ms. A small local model screens untrusted text for prompt injection. The
wrapper then writes a PENDING entry to a log on disk. If the process crashes or has to log in
again, it reads the app's screens on restart, skips records that are already saved and resumes
at the first unfinished one.

After a save, it checks the screen the way a careful person would: the form has closed, no error
appeared, and the saved values or a confirmation number are visible. It doesn't reload the page,
because reloading breaks some forms and desktop dialogs. When the saved state is out of view and
the app allows it, the wrapper can reopen the record, look from a separate read-only session, or
query an API or database.

For desktop apps without a DOM, we dim the screen outside a box around the last click and show a
before and after pair to a 4-bit Qwen3.5-4B LoRA (3.15 GB of VRAM, 357 ms median, no API cost).
On four Ubuntu apps it never saw in training (GIMP, LibreOffice Calc, Thunderbird and VLC; 160
runs from OSWorld-Verified), it reached 0.7905 AUROC, up from 0.6272 for the single-frame model it
started from (DeLong p = 0.0051), with false alarms on 8 of 87 clean runs (9.2%). In those runs
the next-to-last action was a click in 102 of 160, and dimming darkened a median of 78.9% of the
final screenshot. On the first screenshot, and on the final one when that action wasn't a click,
it darkened only a 9.8% border.

A run that passes the checks compiles into a replay that makes no model calls (1.8 s warm). We
upgraded Gitea, Vikunja, Memos and Mealie to newer versions and replayed 60 workflows.
Matching controls against the new page recovered 56 of 60 with no silent errors. In the other 4,
the new version had added fields to the form. We stripped the page to its HTML and ARIA structure, replaced every
field value with a placeholder, repaired the replay from that copy without any user data leaving
the machine, and accepted the fix only after a live check passed. All 60 then passed.

## Other benchmarks

![Silent errors on external benchmarks and replay results after app upgrades](fig3_benchmarks_and_upgrades.png)

| Benchmark | Unwrapped | With openadapt.wrap | Notes |
| :--- | :--- | :--- | :--- |
| HealthAdminBench (52 runs) | 61.5% silent errors | 1.9% (p = 9.3e-10) | Verified completion fell from 38.5% to 11.5%, because 45 of 52 runs stopped for a person |
| HealthAdminBench appeals (50 held-out tasks, 10 demonstrations) | 62.0% silent errors | 2.0% (p = 1.9e-9) | 90.9% of saves it allowed were correct |
| ST-WebAgentBench, 3 apps (44 runs) | 95.5% silent errors | 27.3% (p = 1.9e-9) | Task completion rose from 6.8% to 13.6%, using 38.7% more tokens |
| EnterpriseSessionBench, 4 fault types (64 runs) | 65.6% verified, 29.7% duplicates | 89.1% verified, 0 duplicates (p = 4e-6) | 27.5% fewer model calls (550 to 399) |
| OS-Harm (54 runs) | 44.4% harmful | 11.1% (p = 0.0039) | Policy-compliant completion rose from 40.7% to 63.0% |
| AgentDojo, gemini-2.5-flash (512 runs across 4 models) | 72.9% attack success | 16.7% | Benign task success rose from 37.5% to 56.3% |

## Where it still fails

1. It can't guess rules nobody wrote down. On a 12-task slice of HealthAdminBench's EHR portal
with no clinic rules given, verified completion fell from 2 of 12 to 0 of 12. Silent errors fell
from 41.7% to 16.7%, which was not significant (p = 0.45). Clinic rules need a written table
or a few demonstrations.
2. Stopping when unsure prevents wrong saves but leaves work undone. In the 64-run fault suite,
wrapping prevented every duplicate and every false "done", and 11 of 104 records were left
unfinished and reported as unverified.
3. Pixels alone miss state that is off screen. The desktop model missed 33 of 73 failures (45%)
in OSWorld-Verified, mostly settings files and mail folders. Over a compressed Windows remote
desktop (105 runs), pixel checks let no wrong record through but stopped 40 healthy runs, mostly
on 1 to 2 px codec shifts and blinking carets.

## Try it

pip install openadapt

import openadapt
from openadapt.simplex_transducer import WriteAheadSagaLog

safe_agent = openadapt.wrap(your_agent, wal=WriteAheadSagaLog("session.wal"))

To run the local demo without an API key: `uvx --python 3.12 openadapt@latest quickstart --no-break`.

- Paper: [arXiv:2611.39728](https://arxiv.org/abs/2611.39728)
- Runtime (MIT): [github.com/OpenAdaptAI/OpenAdapt](https://github.com/OpenAdaptAI/OpenAdapt)
- Benchmarks (MIT): [github.com/OpenAdaptAI/openadapt-evals](https://github.com/OpenAdaptAI/openadapt-evals)
3 changes: 3 additions & 0 deletions content/tags/openadapt/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "OpenAdapt"
---
Loading