KatInterview

Building a Screen-Operating AI Agent from Perception to Safety

Machine LearningModel answer
MediumModel answerMachine Learningagentsmultimodalvision-language-models

Last updated

Design a multimodal agent that reads a desktop screen, plans multi-step tasks, drives the mouse and keyboard within a latency budget, and stays safe and measurable.

Scenario

You are asked to design an autonomous software agent that completes tasks on a desktop computer the way a person would: it looks at the screen and then moves the mouse and types on the keyboard. Example instructions include "Find and reserve a flight to Seattle on this airline site" and "Write a summary of today's meeting from the emails in my inbox."

What your design must cover

  1. Screen representation. How is the current screen presented to the model? Compare raw screenshots with structured sources such as the DOM or the OS accessibility tree, and say what you would actually use.
  2. Decision logic. Is a purely reactive policy enough, or do you need a planning component? Explain how the agent copes with tasks that take many steps.
  3. Action interface. How do the model's outputs (coordinates, element references, text) become real OS-level mouse and keyboard events?
  4. Robustness and safety. How does the agent cope with layout changes (for example responsive pages), slow or unpredictable environments, and how do you prevent harmful, irreversible actions such as deleting files or making payments?

Constraints

  • Displays can be as large as 4K.
  • Each inference step should finish in under about 500 ms so the experience feels fluid.
  • The agent must handle multi-step flows (navigate to a site, fill in a form, submit).

Deliverables

  • A high-level architecture, described in text or an ASCII diagram.
  • A training plan, discussing imitation learning versus reinforcement learning and how they fit together.
  • An evaluation plan for measuring real-world performance.

Hints

Hint 1

Do the arithmetic on a 4K frame: count the vision tokens it would produce and see what that does to your 500 ms budget before choosing a resolution.

Hint 2

Think about combining both inputs: a pruned list of interactive elements with IDs, plus a downscaled screenshot annotated with those IDs, and a fallback for apps that expose no accessibility data.

Hint 3

Compounding error is the core reason a flat policy fails on long tasks. Consider a slow planner at sub-goal boundaries, a small fast controller per step, and a verifier that detects stuck or looping behavior.

Hint 4

For safety, separate the model from the executor: put a policy layer between them that classifies actions by reversibility and requires confirmation or blocks the risky ones. Train and test in resettable sandboxes.