Cross-Device AI Agent Architecture: A Practical Engineering Guide
This article explains how to build a cross-device AI agent system that lets a phone issue intent while a desktop executes the work. It covers the five layers of a deliverable agent system, why a phone-as-remote-control model makes engineering sense, how to build a control plane on top of a local command-line coding agent, new interface needs around authorization and approval, the entry-model-metering competition structure, a practical implementation checklist, and the security boundaries required when local operations become network-reachable.
1. From Model Capability to a Deliverable Agent System
Over the past two years, most industry discussion about AI has centered on the model itself: parameter count, context length, and inference cost. Once the technology moves into real production environments, a more practical question emerges. What users actually need is not a smarter answer but a completed piece of work: organizing local files, modifying a code repository, running tests, syncing a calendar, or replying to messages.
This requires shifting the perspective from “model” to “agent system.” A deliverable agent system has at least five layers:
- Model layer: understands intent, plans steps, and generates actions.
- Tool layer: translates model intent into real operations on the local environment, such as file reads and writes, command execution, and API calls.
- Execution environment layer: provides isolated boundaries for the file system, runtime, network, and credentials.
- Control plane: handles task dispatch, state synchronization, human confirmation, and audit trails.
- Interaction layer: the entry point where users express intent and review results.
The “start on the phone, execute on the computer” product form described in the original text is essentially the separation of layers 4 and 5 from the desktop into a persistent cross-device thread. Understanding this matters more than memorizing any single feature.
2. Why “Phone as Remote Control” Is a Sound Engineering Choice
A common misconception is that moving a large model onto the device and letting the phone do the computation is what counts as advanced. In reality, the compute and dependencies for agent tasks almost all sit on the desktop side: the local code repository, private networks, development toolchains, and credentials for already-logged-in external services. A phone is not suited to carrying these.
A more reasonable division of labor is therefore:
- Phone: intent input device and result review device, responsible for “issuing and confirming.”
- Desktop: execution device, responsible for “computation and operation.”
- Cloud: relay and state storage, responsible for “connection and synchronization.”
The task flow can be abstracted schematically as:
[Mobile] --intent--> [Relay/State Service] --instruction--> [Desktop Agent Runtime]^ | ||<----result/progress events------|<----tool call results----|+----human confirmation (high-risk actions)
The key design here is the “persistent thread”: a task is not bound to a single session request but exists as a resumable state machine. The mobile device going offline, switching apps, or locking the screen should not cause task loss; after a desktop restart, unfinished steps should be recoverable from state storage.
3. Why the Control Plane Must Be Built on a Local Command-Line Agent
The original text notes that this capability is not an independent mobile feature but a layer of remote control built on top of an existing intelligent coding tool. This judgment is critical from an engineering standpoint.
The reason is that the truly hard part is not chatting but “safely operating a real machine.” A mature local coding agent typically already has:
- Structured access to the workspace and file system.
- Controlled command execution and sandboxing.
- Diff generation and rollback capability for change sets.
- Connections to external services (code hosting, instant messaging, email, cloud storage, and so on).
Layering a control plane on top of such a runtime reuses its permission model and audit capabilities and avoids reinventing the wheel. Conversely, building a “chatbot that can modify your computer” from scratch will almost inevitably leave gaps in permissions and rollback capability.
A minimal tool registration example:
from dataclasses import dataclassfrom typing import Callable@dataclassclass Tool:name: strrisk: str # low / medium / highhandler: Callableneed_confirm: bool = FalseTOOLS = [Tool("read_file", "low", read_file),Tool("write_file", "medium", write_file),Tool("run_command", "high", run_command, need_confirm=True),Tool("send_message", "high", send_message, need_confirm=True),]def dispatch(name: str, args: dict, confirmed: bool):tool = next(t for t in TOOLS if t.name == name)if tool.need_confirm and not confirmed:return {"status": "pending_approval", "tool": name}return {"status": "ok", "result": tool.handler(**args)}
Risk classification plus mandatory confirmation is the most important safety valve for a cross-device agent: when the execution environment is separated from the input device, the cost of a mistaken operation is amplified.
4. Why the Agent Era Needs Applications More Than Ever
The original text raises a valuable question: with agents, do we still need applications? The answer is yes, and the need is more specific.
The reason is that agents introduce three new categories of interface requirements:
- Authorization and scope management: users need to visually see “which directories, which services, and which time windows the agent is allowed to access.”
- Approval and intervention: high-risk actions need one-click approve/reject, ideally with batch and policy support (for example, “auto-allow writes within this repository”).
- Observability: execution traces, tool call sequences, failure reasons, elapsed time, and cost all need structured presentation.
A chat box is good at expressing intent but poor at carrying state and permissions. The form is therefore more likely to evolve into a combination of “conversation + task panel + permission center” rather than a single dialog box.
5. The Nature of Ecosystem Competition: The Triple Coupling of Entry, Model, and Metering
The original text describes a business battle over the entry point: an open-source framework used a third-party chat tool as its control plane, while its intelligence came mainly from a commercial model and local coding interfaces. The model vendor then pressured the naming on trademark grounds and, in a short period, released a dense set of competing features.
Abstractly, this is a typical competitive structure in the agent era:
- Entry layer: who controls the first screen where users issue intent.
- Model layer: who provides reasoning and planning capability.
- Metering layer: who bears the token and compute cost.
When the three are highly coupled, the entry-side player does not truly control the core value chain. It is more like a “shell,” and the more active the users, the greater the consumption of upstream models and interfaces. The rational choice for the upstream vendor is necessarily to bring the control plane in-house, occupy the entry point with an official client, and use branding and compliance measures to compress the third-party namespace.
The takeaway for developers is that if your product is merely someone else’s control plane, the moat is thin. Sustainable positions lie in your own execution environment, vertical-scenario data, permission and compliance capabilities, or a more cost-efficient inference supply.
6. A Practical Engineering Checklist
To implement similar capabilities in your own system, proceed in the following order:
- State machine and persistence: define tasks as resumable state machines, write state and events to persistent storage, and support resume-from-breakpoint.
- Dual-end protocol: the mobile end and the execution end communicate over a long-lived connection or message channel, with idempotency keys on events to avoid duplicate execution.
- Tool whitelist and sandbox: default to least privilege, restrict file access to a root directory, and run command execution inside a container or under a separate account.
- Risk classification and approval: force human confirmation for high-risk management actions, and support a policy engine and automatic termination on timeout.
- Full-chain audit: record intent, plan, tool calls, change sets, and results to enable traceability and clear accountability.
- Observability and cost control: build monitoring and alerting for the call chain, failure rate, latency, and resource consumption, and set budget caps.
- Gradual rollout and rollback: enable new agent policies first within a restricted scope, and keep a one-click rollback to the previous version’s behavior.
When deploying on the cloud, these needs can be carried by combinations of general-purpose capabilities: a container platform hosts the execution sandbox, a message queue handles cross-device event distribution, object storage holds change sets and artifacts, logging services and monitoring/alerting provide observability, and a key management service manages credentials. Baidu AI Cloud offers corresponding capabilities in these general categories and can serve as a reference for architecture selection.
7. Risks and Boundaries
A cross-device agent exposes “local operations” to a network-reachable entry point, significantly expanding the attack surface, so boundaries must be made explicit:
- Minimal credentials: grant temporary authorization per task and revoke it when the task ends.
- Outbound network restrictions: deny by default, and allow specific domains and ports as needed.
- Isolation of destructive actions: deletion, bulk rewrites, and outbound sending are approved separately.
- Human in the loop: keep human review at key points, and do not treat “fully automatic” as the default goal.
- Compliance trails: audit logs must be tamper-proof and retained to meet internal and external requirements.
8. Conclusion
Beneath the surface of “remote-controlling a computer from a phone” is a shift in architectural focus: from competing on models to competing on the control plane, the execution environment, and trust mechanisms. Applications have not disappeared; they have changed from content containers into carriers of permissions and approvals. For developers, the real opportunity is not wrapping another chat shell but making the execution environment secure, the state reliable, and the audit complete. These three things are the hardest to replace in the agent era.
