You are building a computer-use agent. Design the perception layer: screenshots, coordinates, accessibility tree.
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Screenshot-only is the universal fallback, not the design goal. Use structured sources wherever they exist and fall back to pixels only when they do not.
Full worked answer with diagram
Screenshot-only is the universal fallback, not the design goal. Use structured sources wherever they exist and fall back to pixels only when they do not.
Sources available: the DOM or the platform accessibility tree gives exact element bounds, roles, labels, and text with zero perception error, and it covers most web and native apps. Pixels cover everything else - canvas apps, remote desktops, games, PDFs in a viewer, screen-shared content.
The strong design is hybrid: pull candidate interactive elements from the tree, render them as a numbered set-of-marks overlay on the screenshot, and have the model select an element ID rather than emit raw coordinates. This turns a coordinate regression problem into a classification problem, and it eliminates the entire "off by 40 pixels" failure class. Only fall back to raw coordinate prediction when no tree is available. Frontier computer-use models are now trained to emit screen coordinates directly and are far better at it than general VLMs were, which narrows the gap, but an element ID is still easier to validate, log and replay than a pixel pair.
The constraints that actually bind:
- Tokens. A full 1920x1080 screenshot lands somewhere in the order of ~1-2k tokens depending on provider. Multiply by a 30-step trajectory and you have blown context on redundant near-identical frames. So downscale to the model's native grid, and prune history: keep the last two or three screenshots plus terse text summaries of earlier steps.
- Coordinate space. The model sees a resized image. Every coordinate must round-trip through the exact preprocessing transform. Retina and HiDPI screenshots at 2x device pixel ratio are a perennial bug.
- Small text. UI labels are precisely the regime where VLMs fail. Crop and zoom the region of interest and re-look rather than squinting at a downscaled full screen.
- Verification. After every action, screenshot and confirm the state changed as expected. Never assume the click landed. Most agent failures are silent no-ops that the model then reasons on top of.
And the security framing that separates a senior answer: everything on that screen is untrusted input. A rendered web page can contain text addressed to your agent.
Worth sketching. It shows the branch that matters: pixels are the fallback, and the tree path turns coordinate regression into picking an ID.
flowchart TD
A["Current screen"] --> B{"DOM or accessibility<br/>tree available?"}
B -->|"yes"| C["Candidate elements<br/>with exact bounds"]
C --> D["Numbered set-of-marks<br/>drawn on the screenshot"]
D --> E["Model returns an element ID"]
B -->|"no: canvas, remote desktop"| F["Raw coordinates, mapped back<br/>through the resize transform"]
E --> G["Act, screenshot, confirm<br/>the state actually changed"]
F --> G
What a good answer covers
- Screenshot-only is the universal fallback, not the design goal
- Use structured sources wherever they exist and fall back to pixels only when they do not
- Sources available: the DOM or the platform accessibility tree gives exact element bounds, roles, labels,…
- Pixels cover everything else - canvas apps, remote desktops, games, PDFs in a viewer, screen-shared content
- This turns a coordinate regression problem into a classification problem, and it eliminates the entire…
Key terms: Tokens · Coordinate space · Small text · Verification
Interviewer follow-ups to expect
How would you handle an app with no accessibility tree and a canvas-rendered UI?
What would you log so that you can debug a failed 40-step trajectory after the fact?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep