Cross-Device AI Agent: Controlling a Desktop from Your Phone

    This article explains how cross-device desktop agents let users issue natural language commands on a mobile device while an agent on the desktop takes over the mouse and keyboard, completes cross-application tasks, and sends the progress and results back to the phone. It breaks down the architecture into four stages (access, orchestration, execution, and feedback), proposes a six-layer technical model, compares visual-driven and semantic-driven desktop automation, and outlines tiered permissions, observability, and a practical engineering checklist. The core takeaway is that turning GUI operations into programmable, auditable, and rollback-capable workflows is what allows agents to act without losing control.

    1. The Shift: Agents Start to “Act,” Not Just “Answer”

    A new pattern has emerged in the industry: a user issues a natural language command on a mobile device, an agent on the desktop takes over the mouse and keyboard, completes operations across multiple applications, and then sends the process and results back to the phone. This addresses a question that has been debated repeatedly—whether applications still need to exist in the age of agents. The more accurate conclusion is that applications have not disappeared; they have retreated from being “interfaces that humans click” to a “capability layer that agents invoke,” and the interaction entry point has become a cross-device, resumable, persistent task thread.

    It is worth emphasizing that this article is not about any specific product. Instead, it abstracts this class of capability into a general engineering problem—“cross-device desktop agents”—namely, how to let model-driven executors reliably operate graphical interfaces while maintaining security boundaries.

    2. Breaking Down the Form: A Closed Loop from Reach to Return

    The product logic of such solutions can be summarized into four stages:

    • Access end: a phone or any lightweight client, responsible for issuing intent, supplying context, and confirming high-risk actions.
    • Orchestration layer: maintains session and task state, performs intent parsing, plan generation, step scheduling, and failure retries.
    • Execution end: an executor running on the desktop, with capabilities for screen perception, control element location, mouse and keyboard operation, and result collection.
    • Return channel: synchronizes intermediate progress, screenshot evidence, and final artifacts back to the access end, forming an auditable trail.

    The key is the “persistent thread”: a task is not bound to a single interaction, the process can reside for a long time, and it can resume after disconnection. This is fundamentally different from the traditional “request-response” style of invocation.

    3. Technical Layers: Splitting Capabilities into Replaceable Modules

    It is recommended to model the system in six layers to avoid coupling the model, executor, and permissions together:

    1. Access layer: device registration, identity authentication, encrypted message transmission, and offline message re-delivery.
    2. Session and task layer: task objects, state machine, idempotency keys, and timeout and cancellation semantics.
    3. Planning layer: breaks natural language into ordered sub-goals and generates verifiable execution plans.
    4. Perception layer: captures screen content, recognizes interface elements, reads accessibility information, and produces structured descriptions.
    5. Execution layer: coordinate- or control-level operations, combined with basic actions such as waiting, scrolling, and focus switching.
    6. Governance layer: permissions, auditing, data masking, rate limiting, and rollback.

    A sample task state machine (pseudocode):

    1. state: CREATED -> PLANNED -> RUNNING -> (WAITING_CONFIRM)
    2. -> SUCCEEDED | FAILED | CANCELED
    3. on WAITING_CONFIRM: enter only when action risk level >= HIGH
    4. transition must carry an idempotency key and an operation snapshot for replay and rollback

    4. Two Technical Routes for Desktop Automation

    • Visual-driven: captures screen pixels, and a multimodal model understands the interface and outputs actions. The advantage is strong generality without requiring application modifications; the cost is that it is easily affected by resolution, themes, and animations, and requires stable waiting strategies and failure retries.
    • Semantic-driven: reads the system accessibility interface or control tree and locates elements by name and role. It offers better stability and testability, but requires the target application to expose complete semantic information.

    The more robust engineering approach is “semantics first, vision as fallback”: first attempt control location, and fall back to visual recognition on failure, while writing the location basis of each step into logs to make problem diagnosis easier.

    5. Permissions and Security: Minimal by Default, Tiered by Action

    Desktop control is a high-risk capability and must have tiered authorization:

    • Read-only: view the screen and read text, without performing write operations.
    • Standard: click and type within a specified application allowlist.
    • High-risk: delete files, send messages, confirm payments—mandatory manual secondary confirmation.

    Supporting measures include: masking sensitive screen areas, masking input content, snapshots before operations, rollback-capable scripts, and per-task time limits and operation count caps. Any design that “bypasses confirmation” should be treated as a defect.

    6. Observability and Evaluation

    Govern each task as a replayable execution trail:

    • Record the plan, each step’s action, interface snapshot hashes, elapsed time, and failure reasons;
    • Build an offline evaluation set covering the location success rate and task completion rate for common interfaces;
    • Track the false-trigger rate of high-risk actions as a launch gate metric.

    7. Engineering Implementation Checklist

    1. First get the executor running in a container or virtual machine, isolating the file system and network.
    2. Use a message queue to decouple the access end from the execution end, ensuring resumability after disconnection.
    3. Store artifacts uniformly in object storage, and send logs to a logging service with monitoring and alerting configured.
    4. If elastic execution nodes are needed, use a container platform for unified scheduling and scaling.
    5. If an enterprise already uses Baidu AI Cloud’s general capabilities, it can store task state, artifacts, and audit data in separate layers, and use a unified monitoring system to track execution success rate and latency.

    8. Conclusion

    The essence of a cross-device desktop agent is to turn “interface operations” into programmable, auditable, and rollback-capable execution flows. Whoever makes the permission boundaries, state management, and observability solid can let agents truly “act” without losing control.