Cross-App Automation for AI Assistants: Architecture and Launch Checklist

    This article describes an end-to-end architecture for AI assistants that execute multi-step tasks across applications. It covers DAG-based task planning, application capability registration and matching, execution engine adapter selection, background task isolation and crash recovery, permission and privacy controls, and a pre-launch checklist. Readers get a structured reference for designing, validating, and operationalizing cross-app automation before rollout.

    Introduction

    Large models are moving AI assistants from answering questions to executing tasks. When a user says, “Turn the design sketch into a 3D animation and export a video,” the system needs to call a design tool, a rendering service, and a video tool, completing multiple steps in sequence. This capability is often called Computer Use mode. This article follows a task from intake to completion and explains the data structures, selection criteria, and security boundaries required at each stage, followed by a pre-launch checklist.

    1. Task Understanding and Planning

    The input to the task planning layer is the user instruction and the current context, including open applications, permissions the user has granted, and historical preferences. The output is an executable task plan. The plan should use structured data rather than free text; otherwise, the scheduler cannot validate step by step whether each step is feasible.

    A minimum viable plan can be represented as a directed acyclic graph (DAG):

    1. {
    2. "plan_id": "plan_20261125_001",
    3. "plan_version": 1,
    4. "goal": "Convert a design sketch into a 3D animation video",
    5. "timeout_sec": 1800,
    6. "steps": [
    7. {
    8. "step_id": "s1",
    9. "action": "image.convert",
    10. "app": "design_tool",
    11. "inputs": {"file": "sketch.png"},
    12. "outputs": {"model": "model.obj"},
    13. "depends_on": [],
    14. "required_permissions": ["read:files", "write:project"],
    15. "idempotency_key": "plan_20261125_001:s1",
    16. "retry": 2,
    17. "on_fail": "replan"
    18. },
    19. {
    20. "step_id": "s2",
    21. "action": "render.animate",
    22. "app": "render_service",
    23. "inputs": {"model": "$s1.model"},
    24. "outputs": {"video": "anim.mp4"},
    25. "depends_on": ["s1"],
    26. "required_permissions": ["write:render_job"],
    27. "idempotency_key": "plan_20261125_001:s2",
    28. "retry": 1,
    29. "on_fail": "ask_user"
    30. }
    31. ]
    32. }

    Each step declares its inputs, outputs, dependencies, required permissions, idempotency key, and failure policy. The scheduler performs a topological sort based on dependencies, so steps without dependencies can run in parallel. plan_version identifies whether the plan has been replanned. timeout_sec limits the overall runtime. required_permissions lets the scheduler check authorization before execution instead of discovering a problem only when a step fails.

    There are three failure policies. retry means retrying the same operation, which is suitable for transient errors such as network timeouts. replan means asking the model to regenerate the remaining plan based on the current state, which is suitable when an intermediate result does not meet expectations. ask_user means pausing the task and asking the user to decide, which is suitable for irreversible operations or cases the model cannot determine.

    Replanning must have a limit. For example, the same plan can be replanned at most twice, after which it is handed off for manual handling. Otherwise, the model may repeatedly generate the same failing plan, consuming compute without converging.

    2. Application Identification and Scheduling

    2.1 Application Capability Registration

    The scheduler relies on a capability registry. Each application must register the following fields:

    • app_id: the unique identifier of the application;
    • version_range: the supported version range, for example >=3.2,<4.0;
    • actions: the supported operation list, with input and output schemas for each operation;
    • permission_scope: the permission scope required to execute the application operation, for example read:files and write:project;
    • adapters: available execution methods, such as api, gui, and script;
    • health_check: a method for detecting whether the application is available, such as calling a version endpoint or checking whether a process is alive.

    A simplified example:

    1. app_id: design_tool
    2. version_range: ">=3.2,<4.0"
    3. actions:
    4. - name: image.convert
    5. input: {file: "png|jpg"}
    6. output: {model: "obj|fbx"}
    7. permission_scope: ["read:files", "write:project"]
    8. adapters: [api, gui]
    9. health_check: "GET /api/version"

    The capability registry must be updated together with application upgrades. If a version range expires, the scheduler should mark the application as unavailable instead of continuing to call it.

    2.2 Matching and Selection

    Matching has two phases. The first phase is hard filtering. A candidate application must satisfy all of the following conditions; otherwise, it is excluded directly:

    1. Its version falls within version_range.
    2. The user has granted all permissions in permission_scope.
    3. The health_check probe passes.
    4. The input and output schemas are fully compatible.

    Authorization status is a hard gate and does not participate in scoring. No matter how good other conditions are, an application missing the write:project grant cannot be selected.

    The second phase is weighted scoring, which ranks only the candidates that passed filtering. The weights below are examples and need to be calibrated with business data:

    • Capability match (weight 0.5): coverage of the operation and quality of parameter matching;
    • User preference (weight 0.2): historical choices and default configuration;
    • Execution stability (weight 0.3): recent success rate.

    Weights should be adjusted periodically based on online data rather than fixed for a long time. Before and after adjustment, compare task success rates to confirm that the change actually improves results.

    2.3 Cross-Application Data Passing

    Before the output of one step enters the next step, it usually needs adaptation. Common issues include different encoding formats, different units, and inaccessible file paths. Adaptation rules should be written as testable functions, and checksums before and after conversion should be recorded to help locate the step where an error occurred. File paths should be uniformly converted into references accessible to the scheduler. Do not pass a local absolute path directly to another application.

    3. Operation Execution Engine

    After the target application is determined, the execution engine performs the concrete operation through three types of methods.

    Method How it works Stability Execution speed Required permissions Applicable boundary Failure handling
    GUI automation Identify controls and simulate clicks and input Low; fails after UI changes Slow Screen reading and input control Legacy software without an API Compare screenshots and relocate controls
    API call Call the official API or SDK High Fast API token granted by the application Applications that provide APIs Retry by error code, fall back after timeout
    Scripted execution Generate and run scripts Medium to high Fast File and process permissions in the runtime environment Code editors and command-line tools Dry run in a sandbox first and check exit codes

    The usual selection order is API first, script second, and GUI as the fallback. The final choice should still follow the adapters registered in the capability registry.

    GUI automation is the most fragile, so its failure rate should be monitored as a separate metric. When used, it must follow these constraints:

    • Capture only the window region required by the task, not the full screen;
    • Mask screenshots and logs before storage, covering password fields, ID numbers, and chat content;
    • Keep the execution process visible to the user so the user can pause or terminate it at any time;
    • Write an audit log for each operation, recording the target control, operation type, and time.

    Scripts must run in a restricted environment. Specific requirements include: network access disabled by default; only allowlisted or signed scripts permitted; timeouts and CPU and memory limits configured; file snapshots recorded before execution so failures can be rolled back. Do not simply open screen or network permissions for convenience. The broader the permissions, the larger the impact of a failure.

    4. Background Execution and Progress Visualization

    4.1 Task Isolation

    Background tasks need to be isolated from the user’s foreground work. The three isolation methods apply to different scenarios:

    • Process isolation: lowest overhead, suitable for lightweight tasks that only call APIs. Memory is not shared by default between processes, but system resources such as the file system, clipboard, and display may still be accessed by multiple processes. Therefore, limit the file paths a task can access, prohibit clipboard reads and writes, and limit the screen access scope. If shared memory is truly needed, declare it explicitly and write it to the audit log.
    • Container isolation: clear resource boundaries, suitable for script execution and batch processing; startup usually takes hundreds of milliseconds to several seconds.
    • Virtual machine isolation: strongest isolation, suitable for running untrusted scripts or GUI tasks that need an independent desktop; resource overhead is higher.

    Each task should have quotas for CPU, memory, disk, and runtime. When a quota is exceeded, terminate the task and write an error code to prevent the task from occupying local resources indefinitely.

    4.2 State Synchronization and Crash Recovery

    Background tasks synchronize state with the foreground interface through a message queue or local inter-process communication (IPC). State writes should use atomic writes or transactions: persist to disk first, then push to the interface. In this way, progress is not lost after a process crash, and there is no situation where the interface shows success while the disk record is incomplete.

    After a restart, the scheduler reads the last completed step and continues from the step after it. This process depends on idempotency. Completed steps must be idempotent, meaning repeated execution does not produce duplicate files or duplicate charges. In practice, every external side effect, such as sending a request, charging a fee, or writing to shared storage, carries an idempotency_key, and the peer service deduplicates by that key. During recovery, the scheduler first queries the execution results for these keys, then decides whether to call again.

    4.3 Progress Tracking Fields

    Progress records should include the following fields:

    1. {
    2. "task_id": "t_8f3a",
    3. "step": "s2",
    4. "status": "running",
    5. "started_at": "2026-11-25T10:21:03+08:00",
    6. "error_code": null,
    7. "artifact_ref": "s3://bucket/tasks/t_8f3a/anim.mp4"
    8. }

    status should preferably use exactly six values: pending, running, paused, succeeded, failed, and cancelled, so that the frontend and backend do not define their own values.

    artifact_ref points to the storage location of the artifact, making it easy for users to view it later. However, the artifact link itself may also leak content, so it is necessary to:

    • Use temporary signed links with expiration times;
    • Validate whether the requester is the user who owns the task when accessed;
    • Clean up expired artifacts periodically according to the retention policy;
    • Mask sensitive information that may be contained in artifacts before displaying them externally.

    Screenshots or screen recordings of key checkpoints are also stored as references and follow the same access control rules.

    5. Permission and Privacy Controls

    5.1 Permission Model

    Authorization models can be used alone or in combination.

    • RBAC (Role-Based Access Control): assign permissions by role. For example, a “designer” can read and write project files, while a “visitor” can only read. It is simple to implement and suitable for scenarios with stable permission categories.
    • ABAC (Attribute-Based Access Control): make dynamic decisions based on attributes such as user, resource, and environment. For example, “only allow access to company projects during working hours.” It is expressive, but rules become difficult to maintain as they grow.

    The two can be combined: roles determine baseline permissions, and attribute conditions determine whether those permissions can be used in the current context.

    Regardless of the model, the following principles should be followed:

    • Least privilege: each step requests only the permissions required for that step, not permissions for the entire application;
    • Per-action authorization: authorization granularity should be tied to specific operations, such as write:project rather than “all permissions”;
    • User confirmation: before a permission is used for the first time, and before irreversible operations such as deletion, sending, or payment, explicit user confirmation is required;
    • Revocation at any time: users can view and revoke granted permissions in the interface, and related running steps should pause immediately after revocation;
    • Audit logs: record who executed which operation through which application at what time; the logs themselves must be tamper-resistant;
    • Sensitive data masking: mask identity information, credentials, and financial data in model inputs, logs, and screenshots.

    Permission checks should be performed before each step, not only once at task start, because authorization may be revoked while the task is running. Pseudo-code:

    1. def authorize_step(user, step, app):
    2. if not app.health_ok():
    3. return deny("app_unhealthy")
    4. for perm in step.required_permissions:
    5. if not user.has_grant(perm, scope=step.app):
    6. return deny(f"missing_grant:{perm}")
    7. if step.is_irreversible() and not user.confirmed(step.step_id):
    8. return ask_confirmation(step)
    9. audit_log.write(user.id, step.app, step.action, decision="allow")
    10. return allow()

    6. Pre-Launch Checklist

    Before launch, confirm each item below. Each item should have corresponding tests or evidence rather than relying on experience alone.

    1. Plan validation: the DAG has no cycles, every referenced step_id exists, and every step declares a failure policy and replan limit;
    2. Capability registry: version_range, permission_scope, and health_check are registered for every application and match the actual version;
    3. Authorization checks: required_permissions for every step pass the hard-gate validation, and related steps pause after authorization is revoked;
    4. Execution fallback: when an API fails, the system can fall back to a script or GUI, and the fallback path has been tested;
    5. Isolation and quotas: CPU, memory, disk, and runtime quotas are enforced; over-limit tasks can be terminated and an error code written;
    6. Idempotency and recovery: simulate a process crash in the middle of each step; after restart, there are no duplicate files, duplicate charges, or duplicate requests;
    7. Authorization audit: audit logs cover all operations and can be traced to the specific user and specific permission;
    8. Screen and script security: screenshots are minimized and masked, scripts have network access disabled by default, and allowlist and signature mechanisms are enabled;
    9. Artifact access: artifact_ref uses temporary signed links, and an expiration cleanup policy is configured;
    10. Monitoring and rollback: GUI automation failure rate, replan count, and quota-exceeded count are connected to monitoring, with a clear rollback switch.

    After completing these checks, scale up. In the early scaling stage, retain manual sampling, expand gradually, and continuously compare task success rates and user complaints.