Agentic Mobile Automation Architecture: Designing Secure AI Device Control with Multi-Level Approval

    This article examines how LLM-powered agents can take control of real mobile devices through the Model Context Protocol (MCP), and how a gateway-based architecture with multi-level human approval can make that capability safe and controllable. It covers the overall architecture, virtual display isolation for background execution, an unbypassable security gateway with risk-tiered approvals, full audit trails with replayable reports, and practical use cases along with remaining challenges. Readers will gain a concrete reference design for balancing automation efficiency with human oversight in mobile AI workflows.

    As large language models (LLMs) have advanced rapidly, AI coding tools have evolved from simple code generation to operating at the system level. Through the Model Context Protocol (MCP), agents can now take control of real mobile devices. However, granting AI the ability to operate a physical device carries significant security and privacy risks. This article takes a deep dive into a mobile automation architecture based on gateway interception and multi-level approval, and explores how to achieve safe, controllable agent-driven device takeover.

    1. Overall Architecture Design: Multi-Client Collaboration via MCP

    The core of this solution is an intermediate layer connecting the AI agent to the mobile device. The architecture consists of a PC client and a mobile application.

    1. PC-Hosted Mode

    In this mode, a lightweight client (approximately 16–22 MB) runs on the PC. MCP-compatible AI coding tools can establish a communication link with mobile devices through this client. The client acts as an instruction translator and forwarder, converting high-level agent intents into concrete touch or input events that the mobile device can execute. This architecture supports Android 10 through 17 and iOS 17.4 and above, offering broad device compatibility.

    2. Standalone On-Device Mode

    To remove the dependency on a PC, the mobile device can run a standalone app directly. This app has built-in model scheduling capabilities and can independently connect to mainstream LLMs. In this mode, the mobile device serves as both the execution body and the decision-making center. Users can configure tasks directly on their phones and let the agent execute them locally, reducing hardware dependencies and improving portability.

    2. Execution Isolation: Virtual Display and Silent Operation

    Automation tasks often need to occupy the screen for extended periods, which severely disrupts daily use. To solve this, the architecture introduces a “hidden second screen” mechanism on Android 13 and above.

    1. Technical Principle

    Using Android’s multi-display APIs, the application creates a virtual display. All UI operations performed by the agent—taps, swipes, text input—are directed at this virtual screen rather than the physical one.

    2. User Experience Benefits

    With execution isolation, the physical screen remains fully available to the user. Even if the user locks the screen or runs another foreground app, the agent can continue executing automation tasks silently in the background, delivering a true “background without interruption” automation experience.

    3. Security Gateway: An Unbypassable Human Approval Mechanism

    The biggest challenge in allowing an agent to operate a real device is preventing it from acting outside its authority. The solution introduces an independent security gateway: every critical instruction from the agent must pass through gateway validation, and the gateway is designed around one core principle—the agent can never authorize itself.

    1. Tiered Approval Policies

    Operations are classified into different risk levels with differentiated approval requirements:

    • Mandatory approval by default: Any operation involving funds, such as payments or transfers, is forcibly intercepted by the gateway. It can only proceed after the user physically taps “Allow.”
    • Configurable approval: Actions such as sending messages, placing e-commerce orders, deleting files, and installing apps can be configured by users according to their own risk tolerance—either executed directly or requiring manual confirmation.

    2. Application-Level Isolation and Anti-Spoofing

    Beyond process-level approvals, the architecture also imposes strict restrictions at the underlying interaction layer:

    • Sensitive app invisibility: High-sensitivity apps such as banking apps, digital wallets, and password managers are invisible to the agent by default. When scanning the system’s app list or screen controls, the agent simply cannot discover these apps.
    • Input restrictions: For system-level password fields and verification code (OTP) input fields, the agent cannot simulate text input via the keyboard, eliminating credential leakage at the source.
    • Anti-screen-text spoofing: Malicious pages may use on-screen text to mislead the agent—for example, disguising “Confirm Payment” as “Next.” The gateway performs deep validation combining application context with underlying control properties, ensuring that visible screen text alone cannot induce the agent to perform prohibited or high-risk actions.

    4. Full-Chain Auditing: From Black Box to Traceable Transparency

    Failures in automation are often hard to reproduce, a common weakness of traditional RPA and scripting tools. This architecture makes the entire execution process transparent through full-chain auditing.

    1. Execution Trace Recording

    At every step of an automated execution, the system automatically captures screenshots and records event screens. Operational metadata—timestamps, control coordinates, input text, and system feedback—is packaged into structured logs stored locally.

    2. Report Export and Replay

    The complete execution trace can be exported as a visual web report. Developers or users can step through the timeline frame by frame to pinpoint exactly which instruction caused an anomaly or deviation from expectations. This capability not only dramatically improves debugging efficiency but also provides tamper-resistant evidence for security audits.

    5. Application Scenarios and Practical Outlook

    1. Typical Use Cases

    A highly promising scenario is the automated reuse of idle devices. Users can connect an old mobile device to this architecture, configure daily scheduled tasks, and automatically perform low-risk, high-frequency operations such as app check-ins and information gathering. By enabling approval statistics, users can quantitatively observe how often the agent triggers human intervention in real runs, then iteratively refine prompts and task decomposition logic to gradually raise the automation rate.

    2. Challenges and Future Evolution

    Most solutions of this kind are currently in a pre-release stage. Although core capabilities such as device unlocking and silent background execution have been validated on mainstream real devices, complex dynamic UIs and multi-app collaborative scenarios still require extensive real-device testing to improve robustness.

    Going forward, as the architecture matures, integrating cloud object storage and logging services can reduce the local storage burden of audits and enable clustered scheduling and monitoring across multiple devices. This cloud-managed, edge-executed architecture will push mobile AI automation from a hobbyist tool toward enterprise-scale deployment.

    Conclusion

    Extending agent capabilities to real mobile devices is a key step in landing AI in the physical world, but security must always remain an inviolable bottom line. By introducing virtual display isolation, an unbypassable security gateway, and full-chain auditing, the architecture discussed in this article provides a high-security, high-controllability blueprint for mobile AI automation. Under a “machines do the work, humans hold the keys” collaboration model, we can enjoy the efficiency gains of automation while retaining absolute control over critical moments.