Cloud Agent Architecture in Practice: Learning Loops and Security Governance
Cloud agents go beyond single-turn conversational assistants by planning tasks, invoking tools, checking results, and preserving state across multi-step workflows. This article examines the engineering controls required to make that model production-ready: sandbox isolation across compute, file systems, network access, and credentials; a learning loop that turns task experience into reviewed, versioned skills; purpose-scoped cross-session memory; reliable scheduling and failure handling; task boundaries for multi-agent collaboration; separation of control and execution planes; observability and evaluation; and a staged rollout path. The emphasis is not autonomy for its own sake, but verifiable experience, constrained behavior, recoverable state, and auditable results.
1. From Conversational Assistants to Continuously Running Agents
Traditional conversational assistants generally work around a single request: they receive a question, generate a response, and leave judgment and execution to the user. Cloud agents go further by taking on task planning, tool invocation, result checking, and state persistence, allowing the system to advance multi-step work within a controlled environment.
For example, a task to “periodically summarize business materials and generate an analysis report” typically requires reading authorized data, checking completeness, extracting key metrics, generating a report, and delivering the result. If abnormal data appears, the system may also need to perform additional verification or request human confirmation. The engineering value of an agent lies in connecting these steps into a recoverable, observable execution flow, not merely producing a plausible block of text.
From a general architecture perspective, such systems typically include the following components:
- Reasoning and planning layer: Understand the objective, decompose the task, and select the next operation.
- Tool execution layer: Access files, run programs, or call business interfaces within permitted boundaries.
- State and memory layer: Preserve task progress, user preferences, and necessary historical information.
- Skill management layer: Maintain reusable procedures and update them based on evaluation results.
- Scheduling and governance layer: Manage triggers, resource quotas, approval rules, and audit records.
These components do not mean the system can operate autonomously without limits. Whether tools are available, whether a task can continue running, and whether results can be delivered automatically all depend on the specific implementation and authorization boundaries.
2. Cloud Sandboxes: Clear Boundaries for Tool Execution
Once an agent can run programs, read and write files, or access networks, its risks are no longer limited to incorrect answers. They can also include data leakage, resource exhaustion, and unintended business operations. The primary role of a cloud sandbox is to provide a controlled environment for execution activities.
2.1 Isolation Must Cover More Than Compute Processes
A sound isolation design should cover compute resources, file systems, network access, and identity credentials at the same time. Different users or tasks should not share writable directories or sensitive configurations. Execution environments should have CPU, memory, disk, and runtime limits to prevent abnormal tasks from consuming resources indefinitely.
Network egress should also be constrained. If a task only needs to access an authorized internal service, there is no need to allow arbitrary external connections. Business credentials should be provided on demand through controlled mechanisms wherever possible, rather than being stored in the execution environment for long periods.
A sandbox can reduce risk, but it cannot replace application-level permission checks. Even if execution is isolated, an agent may still complete an incorrect business operation through a legitimate interface. Therefore, the interface layer must still verify identity, resource scope, and operation type.
2.2 Separate Ephemeral Environments from Persistent State
Execution environments should remain disposable and rebuildable, while task state, skill documents, and necessary artifacts should be managed in separate storage. This reduces environment residue and supports failure recovery.
A common flow is:
Task enters the queue → execution environment is allocated → least privilege is injected → tool operations are executed → results and logs are saved → temporary resources are cleaned up.
When a task is resumed, it should continue from a confirmed checkpoint rather than rerunning all steps by default. This is especially important for operations with external side effects, such as sending messages, creating orders, or updating records. The system must confirm whether an operation already succeeded to avoid duplicate execution.
3. The Learning Loop: Turning Task Experience into Verifiable Skills
A learning loop can be understood as the cycle of “execute a task, collect evidence, extract experience, validate the procedure, and use it again.” It does not need to involve model parameter updates, and it should not be equated directly with continuous improvements in model capability.
In engineering practice, a more governable approach is to organize task experience into reusable skill documents. A skill describes how to complete a class of tasks, rather than preserving the complete conversation record of a single execution.
3.1 Skills Need Explicit Applicability Conditions
A reusable skill should at least state:
- The target task and scenarios where it does not apply;
- Required inputs, tools, and permissions;
- Execution steps and intermediate checks;
- Success criteria and result validation methods;
- Failure handling and conditions for human intervention.
For example, “generate a periodic business summary” cannot simply record “read the data and write a summary.” It should also explain data definitions, the time range, rules for handling missing values, and how conclusions map back to source evidence. Only when these conditions are explicit can the skill be reused reliably across different tasks.
3.2 Skill Accumulation Should Not Mean Automatic Publication
A single success may depend on special data, temporary permissions, or a judgment that happened to be correct. If experience is promoted to later tasks without validation, the system may codify accidental behavior into an incorrect procedure.
A safer approach is to generate candidate skills first, then review and test them. Reviews should cover sensitive information, permission requirements, completeness of steps, and applicability scope. Tests should cover normal inputs, abnormal inputs, and boundary conditions. For important business operations, human review should also be retained.
Published skills require version management. Updates should record the reason for the change, test results, and applicable scope, and should support rollback. This makes it possible to answer which version of a procedure was used for the current task and whether a change in results was caused by a skill update.
3.3 Feedback Sources Must Be Distinguished
User approval, task completion, and result correctness are three distinct dimensions. A report being generated successfully does not mean its numbers are accurate. The absence of user objections does not mean the process has no problems.
Feedback should therefore combine task artifacts, rule-based validation, user evaluations, and manual sampling wherever possible. Skill updates should be based on verifiable evidence, not solely on an agent’s description of its own performance.
4. Cross-Session Memory: Preserve Necessary Context, Not Unlimited History
Long-running agents need a degree of continuity, but “persistent memory” should not be designed as indiscriminate storage of every conversation. Excessive historical information not only increases retrieval burden but can also create privacy risks and lead to the misuse of outdated information.
4.1 Classify Memory by Purpose
Information can be divided into three categories:
Task state records current progress, pending items, and checkpoints, mainly to support execution recovery.
User preferences record relatively stable information such as output formats and communication habits. Users should be able to view, correct, and delete this information.
Business context stores project rules, terminology explanations, or authorized document summaries. It should have a clear source and validity scope.
Skills and memory also need to be distinguished: a skill answers “how to complete this type of task,” while memory answers “what necessary background exists for the current user or project.” Mixing the two makes it easy for generic procedures to carry unnecessary personal information.
4.2 Retrieval Must Consider Permissions and Recency
Memory retrieval cannot rely only on semantic similarity. The system should also check the user and project to which the information belongs, its update time, and access permissions.
For facts that may change, such as contact responsibilities or business rules, revalidation conditions should be defined. Memory should serve only as supporting context and cannot replace real-time confirmation from authoritative data sources. Deletion mechanisms should also cover related indexes and caches, so that information deleted from primary storage is not still returned by retrieval.
5. Scheduled Tasks: Reliable Scheduling Behind Natural-Language Interfaces
“Generate a summary every weekday morning” may look simple, but it involves interpreting time, handling overlapping tasks, retrying failures, and delivering messages. Natural language is well suited as a configuration interface, but before formal execution it should be converted into explicit scheduling rules and shown to the user for confirmation.
Items requiring confirmation include time zone, trigger frequency, data scope, recipients, end conditions, and whether automatic sending is allowed. If the system does not have holiday-awareness capabilities, it should not interpret “weekdays” as a complex calendar rule that excludes holidays.
5.1 Handle Duplicate Triggers and Concurrency
Distributed scheduling may produce duplicate triggers because of retries or failure recovery. The system should create a unique identifier for the same logical task and check its state at the execution entry point.
For tasks with short intervals but long execution times, an overlap policy must be defined explicitly: wait for the previous run to finish, skip the current run, or allow parallel execution. This policy should be determined by business requirements, not guessed temporarily by the agent.
5.2 Use Different Strategies for Different Failures
Network timeouts and temporary resource shortages can be retried within limits. Permission expiration, missing data, or rule conflicts usually require pausing execution and notifying the relevant people. Retrying every error uniformly may create duplicate side effects and increase wasteful resource consumption.
Message delivery status should be recorded separately from content generation status. If a report is generated successfully but sending fails, the system should prioritize resuming the delivery step rather than rerunning the entire analysis flow.
6. Multi-Agent Collaboration: Control Complexity Through Task Boundaries
Multiple subagents are suitable for subtasks that can progress independently and whose results can be checked clearly, such as material organization, data validation, and text review. However, increasing the number of agents does not necessarily produce higher accuracy or shorter execution time.
6.1 Split Tasks by Verifiable Results
An effective split should define inputs, output formats, completion conditions, and failure handling. If an agent is given only an abstract role such as “responsible for analysis,” agents can easily duplicate work or miss critical steps.
A coordinating agent should maintain task dependencies and, during aggregation, check whether different results use the same data definitions. When conflicts exist, the system should return to the evidence source for verification rather than simply adopting the majority opinion.
6.2 Control Permissions and Resource Budgets
Subagents should receive only the tools and data permissions needed to complete their own tasks. A material organization task should not have the ability to modify business records by default, and a review task should not automatically receive external sending permissions.
Budgets for total runtime, parallelism, and retry count should also be set. Recursive delegation without budget constraints can create loops and make task cost and runtime unpredictable.
7. Separate the Control Plane from the Execution Plane
Cloud agents are well suited to separating management responsibilities from actual execution responsibilities.
The control plane handles identity authentication, task orchestration, policy management, scheduling, skill versions, and audit queries. The execution plane runs task steps, accesses authorized resources, and produces execution results. The two collaborate through explicit task descriptions and state events.
This separation helps scale execution resources according to task load and reduces direct access from execution environments to core configuration. However, architectural separation alone does not guarantee security. Authentication, communication protection, and state validation must still be implemented.
Task state should have a clear lifecycle, such as pending, running, waiting for confirmation, succeeded, failed, and canceled. The design should also consider tool termination after task cancellation, state cleanup, and handling of results that arrive late.
When integrated with an enterprise communication entry point, the entry point primarily receives messages, associates identities, and presents results. Receiving an instruction should not automatically mean that business authorization has been granted. Operations such as deleting data, changing permissions, or sending sensitive information externally should go through an additional confirmation process.
8. Observability and Effectiveness Evaluation
A long-running system must be able to explain its own behavior. At a minimum, it should record task identifiers, trigger sources, execution steps, tool call status, skill versions, resource consumption, and final results. At the same time, logs should avoid exposing complete credentials or unnecessary sensitive content.
Evaluation should not focus only on call volume or the number of completed tasks. More valuable metrics include:
- Result accuracy and acceptance pass rate;
- Human intervention and rework;
- Duplicate operations and permission violations;
- Failure recovery performance;
- Resource consumption per effective task;
- Quality changes after skill updates.
These metrics need to be designed for the specific business context. For example, material summaries place more emphasis on factual consistency and omissions, while record update tasks place more emphasis on permission compliance, field accuracy, and side-effect control.
Exceptional scenarios should also be tested, including unavailable tools, conflicting materials, mid-task termination, and input content that attempts to induce the system to exceed its authority. Successful execution is only the minimum requirement; business correctness and security compliance are the ultimate goals.
9. Implementation Path: Start Controllable, Then Optimize Continuously
When implementing, start with tasks that have clear inputs, results that are easy to verify, and relatively low risk. Begin with read-only access to validate the flow. Then gradually add restricted tool execution, task recovery, and skill management, rather than opening long-running and high-impact permissions from the beginning.
After the basic flow is stable, introduce cross-session memory and scheduled execution, and define data retention rules, user confirmation mechanisms, and failure notification methods. Only when a task can genuinely be split into independent parts is it necessary to add multi-agent collaboration.
The maturity of cloud agents does not depend on descriptions such as “self-evolution.” It depends on whether experience can be verified, behavior can be constrained, state can be recovered, and results can be audited. Building learning loops, persistent memory, and elastic execution on clear engineering boundaries is what allows agents to move from demonstrations to reliable production practice.
