Orchestrating Desktop AI Agents from Mobile: Separating the Control Plane from the Execution Plane
AI agents are changing how software is used: users describe goals in natural language, and agents plan and execute tasks by calling tools. This article examines a product pattern where tasks are initiated on a mobile device and executed on a desktop machine, and explains how to architect such systems by separating the control plane, execution plane, and inference plane. It covers session persistence, least-privilege permissions, human-in-the-loop confirmation, credential management, prompt injection defense, auditing, and cost control, and concludes with a practical pre-production checklist.
1. Background: Application Shapes Are Changing
For over a decade, users have interacted with software primarily through graphical interfaces: open an app, find the entry point, click buttons, and complete tasks step by step. The rise of AI agents is changing this model. Users describe a goal in natural language, the agent breaks it down into steps, invokes tools such as file operations, command execution, calendar, and email, and finally returns the result.
This shift raises a common question: do we still need applications once agents become ubiquitous?
The answer is yes, but the role of applications changes. Applications remain responsible for data storage, state management, permission control, and business rules. What changes is the entry point: more and more operations are initiated through conversational instructions, while the graphical interface recedes into an auxiliary layer for viewing results and confirming critical steps.
2. The Pattern: Controlling Desktop Execution from Mobile
A typical product pattern looks like this: a task is initiated on a mobile device, executed on a desktop device, and the results are sent back to the mobile end. Its core characteristics are:
- Persistent threads: Task and conversation history are stored on the server side and are not interrupted when any single device disconnects.
- Cross-device sync: Phone and computer share the same session context, so users can pick up and check progress after switching devices.
- Asynchronous execution: After issuing an instruction, the user can walk away. The desktop completes the task in the background and sends a push notification when done.
- Human confirmation: Operations involving modifications, sending, or deletion require user approval on the mobile device.
The value of this pattern lies in decoupling the execution environment (a desktop with full file access, development tools, and network capabilities) from the operation entry point (the phone you carry everywhere). Users can keep work moving without sitting in front of a computer.
3. Architecture Breakdown: Control Plane, Execution Plane, and Inference Plane
The key to understanding these systems is distinguishing three layers with different responsibilities.
3.1 Control Plane
The control plane receives instructions, authenticates identities, manages sessions, and routes tasks. It is typically deployed server-side and includes:
- Identity authentication and device binding
- Session and task state storage
- Message push and cross-device sync
- Task queues and retry mechanisms
The control plane neither performs concrete operations nor runs large models. Its job is to ensure instructions are delivered reliably, state stays consistent, and permissions are traceable.
3.2 Execution Plane
The execution plane runs on the user’s desktop and is the only layer that touches local resources: reading and writing files, invoking the command line, and accessing internal systems. Its design priorities are isolation and least privilege.
It is recommended to configure a working directory whitelist for the execution plane and deny access to the entire user home directory by default. For command execution, restrict the set of allowed commands and log all inputs and outputs in full.
3.3 Inference Plane
The inference plane calls large language models to understand intent, plan steps, and generate content. Inference typically happens in the cloud or a dedicated model service, and is billed by usage (for example, by the number of input and output tokens).
In this architecture, the phone usually performs no inference at all. Its main role is to input instructions, view progress, and confirm results. Separating the three layers allows each to scale and be replaced independently, and makes it easier to apply distinct security policies to each.
Below is illustrative pseudocode for task dispatch, showing how the three layers interact. It does not correspond to any specific API:
# Illustrative code: task initiated on mobile, routed by the control plane,# and executed after confirmation by the execution planedef dispatch_task(user_id, device_id, instruction):session = control_plane.get_or_create_session(user_id)task = control_plane.enqueue(session, device_id, instruction)plan = inference_plane.plan(instruction) # The inference plane generates stepsfor step in plan.steps:if step.risk_level == "high":approved = control_plane.request_confirmation(user_id, step.description) # High-risk steps are confirmed on the mobile deviceif not approved:control_plane.mark_skipped(task, step)continueresult = execution_plane.run(device_id, step, policy=load_policy(user_id))control_plane.report(task, step, result) # Results are sent back and written to the audit log
4. Comparison with Messaging-Channel Agents
Another common approach is to connect an agent to an instant messaging tool, where users send instructions through a chat window and the agent executes locally or on a server. The differences between the two approaches are as follows:
| Dimension | Messaging-Channel Agent | Dedicated Client, Remote Control |
|---|---|---|
| Interaction entry | Third-party instant messaging service | First-party client or app |
| Execution location | Usually the user’s own host or server | Usually the user’s desktop device |
| State storage | Relies on chat history and local files | Server-side persistent threads |
| Security boundary | Constrained by the platform’s message rules and APIs | Can be defined by the client itself |
| Typical use cases | Auto-replies, reminders, lightweight automation | Desktop development, document processing, complex tasks |
Neither approach is absolutely superior. Messaging-channel agents have a low deployment barrier and suit lightweight personal scenarios; dedicated clients offer stronger control and are better suited to teams with security and audit requirements.
5. Key Engineering Concerns
5.1 Least Privilege
The permissions granted to an agent should match what the task requires. Define policies by tool category and deny any operation not explicitly listed by default.
{"filesystem": {"read": ["~/projects/current"],"write": ["~/projects/current/output"]},"shell": {"allow": ["git status", "npm test"],"deny_pattern": ["rm -rf", "sudo"]},"network": {"allow_domains": ["internal.example.com"]},"confirm_required": ["delete", "send", "deploy"]}
Policy files should be maintained by users or administrators, and loaded and validated by the execution plane before execution. Instructions generated by the model must not have permission to modify policies.
5.2 Human in the Loop
High-risk operations include deleting files, sending messages externally, running deployments, modifying permissions, and payments. These should require mandatory confirmation. The confirmation prompt should include the target of the operation, its scope of impact, and whether it is reversible, so users never approve actions they don’t fully understand.
5.3 Session Persistence and Recovery from Disconnection
Mobile networks and desktop sleep both cause connection drops. The task system should meet the following requirements:
- Every step has a unique identifier, so duplicate deliveries produce no duplicate side effects (idempotent design).
- After an interruption, execution can resume from the most recent confirmed checkpoint.
- Task states are clearly enumerated, for example: pending, running, awaiting confirmation, completed, failed.
5.4 Credential Management
The mobile client should not store high-privilege credentials long-term. The server should use short-lived tokens, and keys for the execution plane should be stored in the operating system’s keychain—never written to configuration files or logs.
5.5 Prompt Injection Defense
External content such as web pages, emails, and documents may contain text disguised as instructions. Systems should treat such content as untrusted data: it may serve as reference information only, and must never directly trigger tool calls. Tool outputs likewise need to pass format validation before being fed back to the model.
5.6 Auditing and Cost
Every task should record the initiator, the original instruction, the model-generated plan, the parameters and results of each tool call, confirmation records, and elapsed time. Audit logs support later investigation and help pinpoint errors.
On the cost side, set token usage budgets and rate limits per user or team, and monitor for abnormal growth.
6. Pre-Production Checklist
Before putting such a system into production, verify the following items one by one:
- Are the responsibility boundaries of the control plane, execution plane, and inference plane documented in the design docs?
- Can the execution plane only access whitelisted directories, commands, and domains?
- Do all high-risk operations require mobile confirmation, with complete confirmation information?
- Are tasks idempotent and capable of resuming from checkpoints?
- Do keys appear on the client only as short-lived tokens, and never in logs?
- Is external content isolated from the instruction channel?
- Do audit logs cover the full lifecycle: instructions, plans, tool calls, and confirmations?
- Are usage budgets, rate limits, and anomaly alerts in place?
- Is the initial cross-platform support scope clearly defined, with alternatives or explanations for unsupported systems?
Agents have changed the interaction entry point, but they have not changed the fundamentals of software engineering: clear responsibilities, controllable permissions, reliable state, and traceable processes. Designing the control plane, execution plane, and inference plane separately is a viable path to enjoying the convenience of remote orchestration while keeping the security boundary intact.
