Cross-Device AI Agent Architecture: A Practical Guide

    This guide explains how to build AI agents that separate the control plane from the execution plane across devices. It covers the three-layer architecture (control, execution, and channel), persistent session state, permission tiers and human approval gates, sandboxing and isolation, reliability patterns for long-running tasks, observability and cost controls, common anti-patterns, and a phased rollout roadmap. It is written for developers and enterprises that want a vendor-neutral foundation for intelligent automation.

    1. From Single-Device Assistants to Cross-Device Agents

    AI applications are undergoing a structural shift. Instead of answering one prompt at a time, agents can now read and write files, run system commands, operate graphical interfaces, and chain multiple external services together. Once an agent gains real operational capabilities, a new engineering question emerges: where does execution happen, where is the control entry point, and how do you decouple the two?

    The traditional approach binds them together: the agent must run on whatever device the user is currently using. This creates three clear pain points:

    1. Fragmented scenarios: You want to start a long task during your commute, but the execution environment is your office desktop.
    2. Broken sessions: Switching devices or a brief network hiccup loses context, and the task cannot resume.
    3. Uncontrolled risk: High-privilege actions have no human confirmation step, so accidental deletion, accidental sending, or accidental modification is hard to intercept.

    The industry has gradually converged on a common architectural pattern: a lightweight control plane, a heavy execution plane, and a persistent channel connecting the two. The mobile device only issues instructions and confirms results, while the desktop or a cloud container does the real computation and tool invocation. This pattern does not depend on any specific vendor implementation and is the mainstream solution in current agent engineering.

    2. Architecture Layers: Control Plane, Execution Plane, and Channel Layer

    A robust cross-device agent system should be clearly split into three layers.

    2.1 Control Plane

    The control plane is the user-facing entry point. It can be a mobile client, a chat window, or a web console. Its responsibilities are deliberately minimized:

    • Create and restore sessions;
    • Send natural-language instructions or structured tasks;
    • Display the execution plan, tool-call trace, and intermediate artifacts;
    • Approve high-risk actions through a human gate (approve / reject / edit).

    The key point: the control plane does no inference and no computation. It is not a “model on your phone” but a remote control. The benefit is that the mobile device needs no high compute power, and sensitive data does not stay on the mobile device long-term.

    2.2 Execution Plane

    The execution plane is where the real work happens, typically deployed on a desktop, an edge box, or a cloud container. It needs:

    • Controlled read/write access to the local file system;
    • Command-line and script execution;
    • Browser or GUI automation;
    • Connectors for external services (messaging, email, calendar, code hosting, object storage, and so on);
    • Sandboxing and resource quotas.

    The execution plane should be treated as a host for untrusted code, so its isolation level sets the security floor of the whole system.

    2.3 Channel Layer

    The channel connecting the two planes must satisfy four properties:

    • Persistent: Backed by long-lived connections or a message queue, so tasks do not stop when a page closes;
    • Resumable: Session state is stored externally and can be replayed after a disconnect;
    • Auditable: Instructions, plans, tool calls, and results are fully recorded for traceability;
    • Authenticated: End-to-end identity verification prevents instruction injection and unauthorized calls.

    An illustrative message structure (pseudocode, showing field design only):

    1. {
    2. "session_id": "s-8f2c",
    3. "trace_id": "t-001",
    4. "role": "user|planner|tool|approver",
    5. "content": "Organize invoices from the last 7 days in Downloads into a table",
    6. "risk": "low|medium|high",
    7. "requires_approval": true,
    8. "attachments": ["artifact://plan-01"]
    9. }

    3. Persistent Sessions: The Core of the Cross-Device Experience

    The “no interruption” of a cross-device experience is not about the network never dropping. It is about state never being lost. It is recommended to split session state into four types and store them separately:

    State type Content Suggested storage
    Conversation state Message sequence, summaries Relational or document database
    Task state Plan tree, current step Persistent task table plus a state machine
    Artifact state Generated files, screenshots Object storage
    Credential state Tokens, authorization scope Key management service; never store plaintext on disk

    The recommended engineering approach is “event sourcing plus snapshots”: append each tool call as an immutable event, and periodically generate a snapshot to compress load time. On recovery, load the snapshot first, then replay the incremental events to restore the scene on any device.

    1. # Pseudocode: session recovery flow
    2. def resume(session_id):
    3. snap = store.load_snapshot(session_id)
    4. events = log.fetch_after(session_id, snap.offset)
    5. state = apply(snap.state, events)
    6. return state # includes plan, completed steps, pending approvals

    4. Permissions and Approval: Turning “What It Can Do” into a Governance Problem

    The biggest risk of an execution agent is not weak capability but excessive capability without boundaries. There are four practical governance measures:

    1. Least privilege: Read-only by default; open write operations by directory allowlist;
    2. Action tiers: Three levels — low risk (queries), medium risk (writes to the workspace), high risk (deletion, external sending, payment);
    3. Human gate: High-risk actions require mandatory approval, and the approval request carries a diff preview rather than just a one-line description;
    4. Full-chain audit: Who approved which instruction, when, and from which device is all recorded.

    A detail often overlooked in approval design: approval information must be “judgeable”. Instead of saying “a config change is about to happen”, show the concrete diff:

    1. - retry_limit = 3
    2. + retry_limit = 50
    3. timeout_ms = 30000

    If the approver can make the right call within two seconds, the control plane design is adequate.

    5. Sandboxing and Isolation: The Security Foundation of the Execution Plane

    Whether deployed on desktop or in the cloud, the execution plane should follow a “default untrusted” principle:

    • File system isolation: Mount only the task working directory; system paths are read-only;
    • Egress control: Deny by default; allow by domain allowlist to prevent data exfiltration;
    • Resource quotas: Limit CPU, memory, and runtime to avoid runaway loops;
    • Snapshot rollback: Take a snapshot automatically before a task, and restore with one click on failure;
    • Short-lived credentials: Use short-lived tokens that expire when the task ends.

    In the cloud, you can combine common capabilities such as container platforms, function compute, object storage, message queues, logging services, and monitoring and alerting: containers host the execution environment, queues decouple long tasks, object storage holds artifacts, and logging and monitoring provide observability. This gives you elasticity and operability without binding to any proprietary interface.

    6. Reliability Design: Making Long Tasks Actually Finish

    Long tasks are the norm for agents, and failures are inevitable. Four mechanisms are recommended:

    • Idempotency: Each tool call carries a unique key, so retries produce no side effects;
    • Checkpoint resume: Record completion markers at step granularity instead of rerunning everything;
    • Timeout and backoff: Set timeouts and exponential backoff for external calls to avoid cascading failures;
    • Compensating transactions: Pair non-rollbackable actions such as writing files or sending messages with inverse operations.

    A simplified execution loop:

    1. while plan.has_next():
    2. step = plan.next()
    3. if step.risk == "high" and not approvals.granted(step.id):
    4. approvals.request(step) # push to control plane and wait for human confirmation
    5. continue
    6. result = tools.run(step, idempotency_key=step.id)
    7. log.append(step.id, result) # event sourcing, supports recovery

    7. Observability and Cost Governance

    Once the execution plane has system-level permissions, observability is not optional:

    • Tracing: Use trace_id to link instructions, plans, tool calls, and artifacts;
    • Structured logs: Record commands, exit codes, duration, and output summaries (with sensitive fields masked);
    • Metrics dashboard: Task success rate, average steps, approval pass rate, token consumption;
    • Cost guardrails: Set per-task and per-day budget caps, and automatically degrade or pause when exceeded.

    Cost governance is especially important because model calls and external APIs are often billed by usage. Making “budget” a first-class citizen in the scheduler prevents automation from running up expenses uncontrollably when unattended.

    8. Common Anti-Patterns

    1. Stuffing the model into the mobile device for “edge computing”, losing on both experience and power consumption;
    2. Keeping session state only in memory, so switching devices means starting over;
    3. Showing only a natural-language description in approvals, leaving the approver unable to judge the real impact;
    4. A fully writable execution plane with unrestricted network access, where one mistake causes irreversible loss;
    5. No idempotency design, so retries trigger duplicate external sends;
    6. Logging full commands without masking, creating a new leakage surface.

    9. Rollout Roadmap

    • Phase 1: Establish a persistent channel between the control plane and execution plane, enabling single-session cross-device resume;
    • Phase 2: Add action tiers and high-risk approval to form a governance loop;
    • Phase 3: Complete sandboxing, snapshot rollback, and network egress control;
    • Phase 4: Integrate monitoring, alerting, and budget guardrails, and enter unattended trial operation;
    • Phase 5: Build a catalog of tool connectors and templates to lower the cost of onboarding new tasks.

    10. Conclusion

    The value of the “mobile remote control, desktop execution” architecture is not the novelty of turning a phone into a remote. It is that it forces developers to make the hardest parts of agent engineering explicit: externalized state, tiered permissions, isolated execution, and full auditability. Do these four things well, and cross-device support is a natural result. Do them poorly, and no matter how impressive the entry point, you have only moved the risk further away. For enterprises and developers that want to build intelligent automation, laying a solid foundation on a vendor-neutral architecture first, then expanding scenarios, is the more reliable path.