Screen-Based AI Agents: A Technical Breakdown of Capabilities, Evaluation, and Engineering Architecture
This article explains how screen-based AI agents operate graphical interfaces as a fallback when APIs are unavailable. It breaks the capability stack into four layers, compares localization accuracy with end-to-end task completion metrics, outlines a controlled execution loop, and reviews common failure modes along with practical mitigation strategies.
1. From API Calls to UI Operations: A Shift in Technical Paradigm
Traditional software automation relies on explicit interfaces: developers read documentation, agree on parameters, and write invocation code. This path assumes the target system exposes a stable, authorized API. In real engineering environments, that assumption often fails. Many internal systems were built years ago and either lack APIs or offer only partially usable data exports; documentation is scattered across personal machines and chat logs; and interfaces are redesigned more often than the docs are updated.
This leads to a simpler idea: since every interactive application has a graphical interface, the interface itself can be treated as a kind of universal API.
This claim comes with engineering caveats. Using the UI as an interface offers broad coverage and requires no changes to the target system. The downsides are low semantic density, invisible state, and sparse feedback. A button on screen is just a few pixels and a text label; the business logic, validation rules, and side effects it triggers cannot be observed directly by a model. So the value of the UI-operation paradigm is not to replace APIs, but to provide an executable fallback for scenarios where no API exists.
2. Capability Breakdown: Four Layers of a Usable UI Agent
Treating “can click buttons” as a single capability is the most common mistake when assessing these systems. A more rigorous breakdown includes at least four layers.
The first layer is screen semantic understanding. The model must identify control types, text labels, hierarchy, and availability states in the UI, for example distinguishing a clickable primary button from a visually similar but disabled one.
The second layer is target localization. After understanding the semantics, the agent must output executable coordinates or control identifiers. This layer is highly sensitive to resolution changes, scaling ratios, multi-monitor setups, and theme switching, and it is where most errors concentrate in practice.
The third layer is action planning and state tracking. Real tasks often involve a dozen or more steps, with popups, loading overlays, permission confirmations, and error messages appearing along the way. The agent needs to maintain task state, determine which step of the flow it is on, and choose to retry, roll back, or abort when something goes wrong.
The fourth layer is safety boundaries and rollback capability. For irreversible actions such as submitting, paying, deleting, or sending externally, the system must provide confirmation mechanisms and an operation trail; otherwise the gains from automation can be wiped out by a single mistake.
3. Why Evaluation Needs Two Metric Types: Localization Accuracy and End-to-End Completion
A single metric can easily distort the assessment of a UI agent. The industry typically uses two complementary evaluation approaches.
One is localization evaluation: given a screenshot and an instruction, it checks whether the model can hit the target control. These metrics measure “how accurately it sees,” are decoupled from specific task flows, and make it easy to compare the baseline capabilities of different models.
The other is end-to-end task evaluation, which places the agent in a real or simulated desktop environment and asks it to independently complete multi-step tasks such as configuration, data organization, and moving data across applications, recording completion rate and time taken. These metrics measure “whether it can get the job done” and also expose planning and error-correction ability.
Combining both types avoids misjudgments like “localization is accurate but the flow breaks down” or “the flow is well designed but the agent cannot click accurately.” Time is another easily overlooked but critical dimension: at the same completion rate, redundant steps and repeated screenshot confirmation can significantly lengthen execution time and directly affect usability.
Note that specific scores fluctuate with versions, prompting strategies, and environment configurations. For engineering selection, rely on your own evaluation set rather than a single public result.
4. Engineering Architecture: Putting the Model in a Controlled Execution Loop
A maintainable implementation typically contains five modules.
Task instruction -> Planner (decompose steps)|vPerception layer (screenshot / control tree / text extraction)|vDecision layer (model outputs actions)|vExecution layer (controlled input injection)|vVerification layer (state comparison / logs / rollback)
For the perception layer, it is advisable to keep two channels: screenshots and accessibility information. The former covers custom-drawn interfaces; the latter, when supported, provides more stable control identifiers. The decision layer’s output should be constrained to structured actions rather than free text, making verification and replay easier:
{"action":"click","target":{"type":"text","value":"Submit"},"expect":"a success message appears"}
The execution layer and the verification layer are the dividing line for reliability. After every action, the state should be compared against expectations; a mismatch should trigger a limited number of retries. Consecutive failures should escalate to human takeover rather than continuing to click blindly. All actions are written to logs to form an auditable trail.
5. Common Failure Modes and Mitigation Strategies
Localization drift caused by UI changes is the most common issue. Mitigations include preferring control identifiers, introducing relative layout descriptions, and building multi-feature matching for key controls.
State misjudgment often stems from asynchronous loading. Add explicit wait conditions before actions, such as the target element being visible and interactive, instead of sleeping for a fixed duration.
Context loss in multi-step tasks usually comes from passing only the current screenshot. A more robust approach is to maintain a concise task state summary and provide the decision layer with both completed steps and the current goal.
Permission and irreversible-action risks should be handled through action tiering: read-only and navigation actions can run automatically, while write and submit actions require secondary confirmation or whitelist constraints.
6. Working Alongside Coding Capabilities
UI operation and terminal or code capabilities are complementary rather than mutually exclusive. When the target system provides an API or scripting channel, prefer that path for better stability and efficiency; when only the UI is available, the UI agent serves as the fallback. A common combination in practice is to use code capabilities for data processing and environment setup, and UI capabilities for cross-system transfers and form entry. In related work, Baidu AI Cloud typically groups such capabilities under general cloud services, for example container platforms hosting execution sandboxes, object storage saving operation recordings, and log services with monitoring and alerting for observability; refer to the official documentation for specifics.
7. Conclusion: Capability Boundaries Determine Practical Value
Claims like “the strongest” offer little help for engineering decisions. The real questions are three: is the target scenario’s UI stable, are the actions reversible, and is there a fallback for failures. Confirm these three points, then run a small-scale pilot to build your own evaluation set, and only then can you judge the real return of a UI agent in your business.
