Cross-Device AI Agent Architecture: A Practical Guide

    This article breaks down a cross-device AI agent pattern where a phone issues commands and a desktop executes them. It explains a four-plane architecture, why a CLI-style agent is a practical execution core, how risk-based approvals and scoped permissions keep remote actions safe, and the reliability details needed to move from demo to production. A phased rollout path is included.

    1. From Model Capability to Controlled Execution

    A notable product shift has emerged recently: AI no longer just answers questions, it starts operating the computer — moving the mouse, clicking interfaces, reading and writing local files, and running system commands. More importantly, the entry point for these actions is not the desktop but the phone.

    This form answers a question that keeps coming up: in the age of AI agents, do we still need apps? The answer leans toward “yes, and more than ever.” The reasoning is not mysterious: the model handles reasoning, but the result of that reasoning has to land in a concrete environment, which requires a stable entry point to carry three things — task dispatch, process observation, and result confirmation. The phone happens to be the most convenient carrier for all three, so it shifts from a “computing device” to a “remote control,” carrying no reasoning load and handling only interaction and authorization.

    This article abstracts the pattern from a neutral perspective, discusses how to design a persistent task pipeline that extends from mobile to a desktop execution end, and provides practical engineering layering and security boundaries.

    2. Architecture Layers: Four Planes of a Persistent Thread

    To make “initiate on mobile, execute on desktop, return results” a reliable system, it helps to split it clearly into four planes and avoid mixing responsibilities.

    1. Interaction plane (mobile)
      Handles only three things: issuing natural-language instructions, displaying the execution trace, and providing a second confirmation for high-risk actions. It should not embed business logic or cache sensitive data.

    2. Control plane (session and scheduling)
      Maintains session state, task queues, device online status, and routing relationships. The core data structure can be abstracted as:

    1. Session {
    2. id, owner, created_at
    3. devices: [desktop_id, ...]
    4. tasks: [task_id, status, risk_level]
    5. approvals: [approval_id, scope, ttl]
    6. }
    1. Execution plane (desktop agent)
      Runs on the user’s own machine, with local file access, command execution, and browser and GUI operation capabilities. It accepts only task descriptions issued by the control plane that are signed and time-bound.

    2. Observation plane (logs and audit)
      Records every tool call, parameter summary, return code, and duration. Observation data is the only reliable basis for later permission tightening and fault localization.

    The value of layering: a leak on the mobile end does not mean the execution end is compromised, and an anomaly on the execution end does not pollute session state.

    3. Why the Execution Core Is a CLI-Style Agent

    The original text notes a key fact: this kind of remote control capability is usually not written from scratch but built on top of existing intelligent coding tools. This is very reasonable from an engineering standpoint.

    A CLI-style agent has three natural advantages: first, clear capability boundaries — file read/write, process invocation, and dependency installation can all be uniformly abstracted as “tool calls”; second, strong composability — multiple steps can be chained through scripts; third, easy integration with external systems, such as messaging notifications, code hosting, and document storage, via standard protocols.

    A minimal tool description can be written as:

    1. {
    2. "name": "run_tests",
    3. "input": { "path": "string", "pattern": "string" },
    4. "risk": "low",
    5. "timeout_sec": 300
    6. }

    The risk field is the pivot of the whole system: low-risk actions execute automatically, medium-risk actions require mobile confirmation, and high-risk actions are rejected by default and logged.

    4. The Control Plane Debate: Why the Entry Point Determines Experience

    Another common route in the industry is to build the control plane directly on top of an instant messaging app: the user types in a chat box, the agent runs persistently in the background, automatically replies to messages, manages schedules, and reads and writes files.

    The advantage of this route is zero learning cost; the drawback is weak controllability: the message stream is meant for people to read, not for system orchestration; permissions, timeouts, retries, and idempotency lack a place to be carried; and once a session is mistakenly triggered, the scope of impact is hard to contain.

    This explains a seemingly contradictory phenomenon: as the underlying intelligence increasingly relies on the same set of models and the same execution interfaces, the focus of competition shifts from “who is smarter” to “whose control plane is more rigorous.” The control plane determines observability, rollback capability, and least privilege, and therefore determines whether the system can enter a real production environment.

    5. Permissions and Confirmation: Turning “What It Can Do” into “What It Is Allowed to Do”

    The biggest risk in cross-device execution is not insufficient capability but overly broad authorization. A three-layer convergence strategy is recommended.

    • Capability allowlist: the execution end exposes only an explicitly declared set of tools; anything undeclared cannot be called.
    • Scope isolation: assign an independent working directory and temporary credentials to each task, reclaimed when the task ends.
    • Time-bound approval: mobile confirmation generates a one-time authorization bound to task_id and scope, with a short TTL.
    1. approval = sign(task_id + scope + exp, device_key)

    The execution end verifies the signature and validity period before each tool call and fails and exits on expiry. This way, even if the command channel is eavesdropped, an attacker cannot obtain a reusable authorization.

    6. Reliability and Engineering Details

    For a remote agent to be “usable,” it must handle the following real-world problems:

    1. Reconnection and resume: persist task state to the control plane, and after the desktop reconnects, resume by task_id rather than starting over.
    2. Idempotency design: actions involving writes and external calls must carry an idempotency key to avoid duplicate side effects from retries.
    3. Timeout and circuit breaking: dual limits of per-step timeout and overall budget; pause immediately and report to mobile when the budget is exceeded.
    4. Environment drift: record dependency versions and system differences, and on failure provide a minimal reproducible environment description.
    5. Observability loop: collect logs, metrics, and alerts as unified data, so that on anomaly the mobile end can see “which step it is stuck on and why.”

    On the cloud side, this kind of system usually needs no complex components to get started: use a message queue for task distribution, object storage for execution artifacts and audit files, a container platform for stateless control services, and a logging service with monitoring and alerting to close the observability loop. Baidu AI Cloud offers corresponding capabilities in these general categories, which can be introduced gradually by scale to avoid over-designing all at once.

    • Phase 1: single-machine execution end plus mobile command dispatch, getting the minimal “dispatch — execute — return” loop working.
    • Phase 2: introduce risk grading and one-time approval, with high-risk actions disabled by default.
    • Phase 3: complete idempotency, reconnection and resume, and audit, and connect to unified observability.
    • Phase 4: multi-device routing and task orchestration, supporting automatic step-by-step execution of long workflows.

    8. Conclusion

    The “phone as remote control, desktop as execution body” model essentially frees intelligent capability from the chat box while constraining it with a stricter control plane. For developers, the real barrier is not calling the model but three “unglamorous but decisive” engineering tasks: the permission model, state management, and observability. Get these three solid, and cross-device agents can move from demo to daily production.