Visual Understanding and Computer Operation: Engineering Practices for Multimodal Agents

    This article explores the engineering practices behind multimodal agents capable of visual understanding and computer operation. It covers key challenges such as interface perception, action planning, error correction, hallucination mitigation, security boundaries, evaluation metrics, and phased implementation strategies for enterprise deployment.

    1. Why Visual and Operational Capabilities Are in the Spotlight

    Over the past few years, large language models have primarily processed text inputs and produced text outputs. As application scenarios shift from simple Q&A to process execution, users need models to read web screenshots, report charts, and software interfaces, and to perform actions on their behalf, such as clicking, typing, and switching windows. Together, these two capabilities determine whether an agent can take over repetitive office tasks.

    Industry discussions around this direction typically revolve around three questions: how does the model perceive the interface, how does it break down goals into executable action sequences, and how does it detect and correct errors when they occur. This article breaks down these three questions from an engineering perspective.

    2. Visual Understanding: From Text Recognition to Interface Comprehension

    Early automation solutions typically relied on control trees or Optical Character Recognition (OCR). Control trees require the application to expose its complete structural information, while OCR only provides text content and cannot determine the hierarchical relationship or regional meaning between buttons.

    Multimodal models receive images directly and can simultaneously utilize layout, color, icons, and text information. For example, they can determine whether a gray button is disabled or answer numerical questions based on the headers and row/column relationships of a table. In engineering, three points require attention:

    1. Resolution and Cropping: When interface screenshots are too large, small font content may be lost. It is usually necessary to divide them by regions or only pass in local images relevant to the current task.
    2. Coordinate Alignment: The coordinates output by the model must correspond to the scaling ratio of the real screen; otherwise, the click position will be offset.
    3. Temporal State: Page loading takes time. Before taking a screenshot, you should wait for critical elements to appear to avoid making judgments based on an outdated screen.

    3. Computer Operation: The Closed Loop of Perception, Planning, Execution, and Verification

    A reliable operational agent typically consists of four phases.

    • Perception: Obtain the current screen screenshot and necessary context, such as the current application name, task goal, and historical actions.
    • Planning: Output the next action based on the goal and current screen, such as clicking a specific coordinate, entering text, scrolling the page, or ending the task.
    • Execution: A controlled executor translates the action into system-level operations and records logs.
    • Verification: Take another screenshot to determine whether the action achieved the expected effect. If not, it enters a branch for retrying or rewriting the plan.

    The verification phase is often overlooked but is critical for reducing error rates. Without verification, an agent will continue executing subsequent steps after an initial mis-click, writing data to the wrong location and causing a chain reaction of problems. The pseudocode below demonstrates the basic structure of this closed loop:

    1. def run_agent(goal, max_steps=30):
    2. history = []
    3. for step in range(max_steps):
    4. screenshot = capture_screen()
    5. action = planner.next_action(goal, screenshot, history)
    6. if action.type == "finish":
    7. return verify_goal(goal, capture_screen())
    8. if not policy.allow(action):
    9. return escalate_to_human(action)
    10. executor.perform(action)
    11. after = capture_screen()
    12. ok = checker.confirm(action, before=screenshot, after=after)
    13. history.append({"action": action, "ok": ok})
    14. if not ok and count_failures(history) >= 3:
    15. return escalate_to_human(history)
    16. return escalate_to_human("step limit reached")

    There are two key takeaways from this structure. First, check the policy before each execution to ensure the action is within the authorized scope. Second, when consecutive failures reach a threshold, the agent should stop and escalate to a human rather than retrying indefinitely.

    4. Hallucinations: Why They Are More Dangerous in Interface Tasks

    In pure text Q&A, hallucinations manifest as incorrect statements, which users can identify by reading. In operational scenarios, hallucinations turn into incorrect actions. The model might confuse two similar buttons or assume an operation was successful before the page has finished loading.

    General methods to address hallucinations include:

    • Require the model to describe the key elements it sees and provide its reasoning before outputting an action, facilitating post-hoc auditing.
    • Perform secondary verification on critical fields, such as amounts, recipients, and dates, comparing them item by item with the original data.
    • Set confirmation steps for irreversible operations, such as submitting an order, deleting a file, or sending an email.
    • Use structured formats to constrain action output, preventing invalid instructions or ambiguous descriptions from creeping into free text.

    The commonality among these methods is placing the model’s judgments in a checkable position rather than relying on the model’s own stability.

    5. Permissions and Security Boundaries

    Operational agents possess real system permissions, so security design should precede feature development.

    1. Least Privilege: Assign independent accounts or restricted sessions to each task, granting access only to the applications and directories required to complete the task.
    2. Isolated Execution: Run in a sandbox or an independent virtual desktop to avoid affecting the production environment.
    3. Sensitive Information Handling: Passwords, tokens, and personal information should not appear in screenshot logs. Logs must be desensitized, and credentials should be injected via secure storage, never written into prompts.
    4. Treat Page Content as Data: Text appearing on web pages or documents might contain instructions attempting to alter the agent’s behavior. Such content should be ignored during execution, and anomalies should be logged.
    5. Human Handover: Provide an entry point to pause and take over at any time, and retain a complete operation replay for traceability.

    6. Evaluation Methods: Measuring Reliability with Metrics

    Evaluating an operational agent should not rely solely on the results of a single demonstration. It is recommended to establish a fixed set of tasks, re-run them after every model or prompt change, and track the following metrics:

    • Task Success Rate: The proportion of goals achieved within a limited number of steps.
    • Average Step Count: The number of actions required to complete a task, reflecting planning efficiency.
    • Misoperation Rate: The frequency of clicking wrong elements or writing to incorrect fields.
    • Human Intervention Rate: The proportion of tasks requiring human handover.
    • Cost and Duration: The number of model calls and total time per task.

    The test set should cover normal paths, interface changes, pop-up interruptions, network latency, and abnormal data. A replay mechanism can help pinpoint failure causes and serves as a crucial basis for continuous iteration.

    7. Implementation Suggestions for Enterprise Deployment

    When selecting scenarios, prioritize tasks that meet the following conditions: fixed processes, verifiable inputs and outputs, controllable failure costs, and a current heavy reliance on manual repetitive operations. Examples include batch form entry, cross-system data reconciliation, and extracting information from interface screenshots.

    Deployment can be advanced in three steps.

    Phase 1: Read-only tasks. The agent only observes and aggregates information without modifying any data, used to verify the accuracy of perception capabilities.

    Phase 2: Reversible operations. Allow modifications to draft data, which must be reviewed by a human before submission.

    Phase 3: Controlled automation. Open auto-submission for low-risk, high-frequency tasks, while retaining audit records and one-click rollback capabilities.

    Each phase should use evaluation metrics to determine whether to proceed to the next stage.

    8. Conclusion

    Visual understanding and computer operation capabilities expand the application boundaries of agents, but their reliability depends on engineering design: clear perception inputs, controlled execution pipelines, strict verification mechanisms, and permission isolation. Teams should treat model capabilities as a component within the system, continuously verifying their performance in their own business using quantifiable metrics.