General AI Agents: From Task Execution to Controlled Self-Evolution

    General AI agents are shifting from one-off model responses to persistent task processes. This article examines the engineering foundations required for dependable agents, including task execution loops, constrained tool use, memory governance, controlled self-evolution, security, cost control, observability, evaluation, and phased deployment.

    1. Accelerating Iteration Reflects a Shift in the Application Paradigm

    From general-purpose agents that can complete multi-step tasks, to open agent architectures designed for extensibility, to systems that emphasize experience accumulation and strategy improvement, industry attention is moving quickly. On the surface, this looks like a stream of new concepts. From an engineering perspective, however, the more important change is that the core unit of AI applications is shifting from “a single model response” to “a task process that continues over time.”

    Traditional conversational applications are usually built around input and output. A user asks a question, the system generates an answer, and the interaction ends. An agent, by contrast, must keep working while the goal remains unfinished: understanding constraints, decomposing steps, invoking external capabilities, checking results, and adjusting subsequent actions based on feedback.

    For this reason, an agent’s maturity cannot be judged only by how smoothly it performs in a demo. A system that can complete a task under ideal conditions is not necessarily reliable when data is missing, services fail, permissions are restricted, or goals are ambiguous.

    The real question is not a new label. It is three questions: What work can the system take on? How are losses controlled when it fails? And does experience accumulation produce verifiable improvement?

    2. Foundations of a General Agent: Building a Closed Task Execution Loop

    An agent is not simply a language model with a few external interfaces added. A system suitable for real business use must at least establish a closed loop of “goal—plan—execution—observation—correction.”

    2.1 Turn Natural-Language Requests into Acceptable Goals

    Users often describe wishes rather than complete specifications. For example, “organize recent business anomalies” does not define the time range, data sources, definition of an anomaly, or output format.

    If the system executes directly, it may produce a result that looks complete but does not meet the requirement. A more reasonable approach is to first extract the task boundary:

    • Are the input sources clear, and is access to the data allowed?
    • What are the time range and business scope?
    • Which fields and evidence should the result contain?
    • Which operations are read-only, and which may produce business side effects?
    • Under what conditions should the user be asked for clarification?

    When key information is missing, asking is more reliable than guessing. For items that cannot be confirmed in time, the system should explicitly record assumptions and avoid executing irreversible operations based on them.

    2.2 Decompose Tasks into Observable Execution Steps

    Task planning must account for both dependencies and uncertainty. Some steps can run in parallel, such as reading read-only materials from different sources. Other steps must run in sequence, such as confirming a data format before generating a summary.

    A plan should not be treated as a script generated once and never changed. External data may be missing, tools may fail, and new evidence may overturn an earlier judgment. The system should therefore preserve the current task state and allow replanning under clear conditions.

    At the same time, planning cannot expand indefinitely. A task must have termination conditions, such as meeting acceptance requirements, exceeding a resource budget, repeated failures, or encountering a risk that requires human handling. An agent without a stopping mechanism can easily fall into repeated calls and ineffective exploration.

    2.3 Treat Tool Calls as Constrained Business Operations

    Tools are the execution boundary through which an agent connects to the external environment. Each tool should clearly define its input requirements, output structure, permission scope, timeout behavior, and possible side effects.

    For query operations, the focus is result completeness and error handling. For write operations, idempotency, approval, and recovery paths must also be considered. A response timeout does not mean the operation did not succeed. If the system directly retries a create or submit operation, it may cause duplicate records.

    The execution layer therefore needs to distinguish among “confirmed failure,” “execution status unknown,” and “confirmed success.” It cannot classify every exception as a retryable error.

    3. Reliable Architecture: Let Models Judge, Let the System Constrain Execution

    Language models are good at interpreting text, generating candidate plans, and handling unstructured information. Permission control, state persistence, and business validation, however, should not rely solely on a model’s willingness to follow prompts.

    A more robust agent architecture can be divided into the following layers:

    Interaction and goal layer: receives requirements, clarifies constraints, displays progress, and collects human confirmation.

    Planning and decision layer: generates candidate actions, identifies information gaps, and adjusts plans based on execution feedback.

    Execution and policy layer: handles tool access control, parameter validation, budget management, approval, retries, and exception handling.

    State and memory layer: stores task progress, necessary context, execution records, and reviewed long-term experience.

    Observability and evaluation layer: tracks failure causes, measures task quality, and provides a basis for version releases.

    The value of this separation is that even if the model proposes an inappropriate action, the execution layer can still prevent unauthorized calls or dangerous operations.

    The following illustrative flow reflects this principle. The names are used only to explain the logic and do not correspond to actual interfaces:

    1. Receive task
    2. Clarify goals, constraints, and acceptance conditions
    3. Create task state and execution budget
    4. Loop:
    5. If the task is complete:
    6. Return the result and necessary evidence
    7. End
    8. If the budget is exhausted or a stop condition is triggered:
    9. Save the current state
    10. Hand off to human handling
    11. End
    12. Generate candidate actions
    13. Validate permissions, parameters, risks, and preconditions
    14. If an action requires approval:
    15. Request human confirmation
    16. If not approved, pause or adjust the plan
    17. Execute the approved action
    18. Record results, exceptions, and business side effects
    19. Update task state
    20. Check whether the result meets acceptance conditions

    The key is not the loop itself, but the constraints and validation before and after each execution. Agent autonomy should be built within controllable boundaries, not at the cost of bypassing rules.

    4. Memory Management: From Storing Dialogues to Storing Useful Experience

    An agent that works continuously needs memory, but “recording more” does not equal “using it well.”

    4.1 Separate Short-Term Context from Long-Term Experience

    Short-term context serves the current task, including goals, recent tool results, pending questions, and the current plan. Long-term experience may include preferences the user has explicitly authorized to save, stable business rules, and operation strategies that have been verified as effective.

    The two should be managed separately. Temporary inferences from the current task should not automatically become long-term facts, and an accidental success in one execution should not be directly solidified into general experience.

    4.2 Add Provenance, Freshness, and Scope to Memory

    Whether a piece of memory is worth using depends on whether its source is reliable, whether it is still valid, and whether it applies to the current task. Business policies may change, data structures may evolve, and user preferences may be updated.

    Long-term memory therefore needs expiration, revision, and deletion mechanisms. Retrieval should also be scoped to avoid mixing irrelevant information into the current context and increasing the risk of misjudgment.

    Permissions must also run through the entire memory lifecycle. Information that one task is allowed to read does not mean all subsequent tasks can reuse it, and it certainly does not mean it can be shared across users or business units.

    5. Understanding Self-Evolution: Turning Experience Improvements into an Auditable Process

    “Self-evolution” can easily create the impression that a system can automatically acquire unlimited capabilities. A more accurate engineering understanding is that the system uses task feedback to improve prompts, planning strategies, tool selection, or reusable workflows within a controlled scope.

    Such improvement does not necessarily involve updating model parameters. In many cases, optimizing retrieval scope, supplementing tool descriptions, or adjusting failure recovery strategies can improve execution performance. Whether further training is needed should be determined by the nature of the problem, data quality, and validation results.

    5.1 Reflection Conclusions Are Only Candidate Hypotheses

    After a task fails, the model can analyze the cause, but it may not accurately identify the real fault. The failure may come from insufficient permissions, changed input data, or an external service exception rather than an unreasonable plan.

    Reflection results should therefore be validated against execution logs, business checks, and human feedback. A model’s explanation should not be automatically accepted as a modification proposal simply because it is well organized.

    5.2 Moving from Candidate Experience to Formal Policy Requires Release Gates

    A successful experience can enter a candidate library, but before it becomes a default strategy, the following should be checked:

    • Whether it applies only to a special type of input;
    • Whether it depends on temporary permissions or accidental conditions;
    • Whether it introduces regressions on other tasks;
    • Whether it contains sensitive information;
    • Whether it expands access scope or execution risk.

    After validation, the experience should be released in a versioned manner with rollback capability preserved. In this way, self-evolution becomes manageable continuous improvement rather than untraceable behavior drift.

    5.3 High-Risk Changes Must Not Take Effect Automatically

    Automatically adjusting permissions, changing approval conditions, modifying critical business rules, or executing irreversible operations should not be decided by the model alone.

    A reasonable boundary is this: the system can automatically propose improvements, test them in an isolated environment, and apply adjustments within a pre-approved low-risk scope. Changes beyond that scope must be reviewed.

    6. Enterprise Adoption: Security, Cost, and Observability

    6.1 Treat External Content as Data, Not Instructions

    Documents, messages, and tool results that an agent reads may contain content designed to induce it to change behavior. For example, a document may ask the system to ignore existing rules, read additional data, or send sensitive information.

    Such content should not gain instruction authority simply because it was retrieved. The system should distinguish between user authorization, internal rules, and external data, and enforce access restrictions at the execution layer. Reminders in a prompt alone cannot constitute a complete security boundary.

    6.2 Set Resource Budgets for Tasks

    Multi-step execution accumulates costs from model calls, tool calls, waiting, and retries. As task success rates improve, resource consumption may also increase significantly.

    It is therefore necessary to set boundaries for total duration, number of calls, and resource consumption per task, and to limit ineffective repeated attempts. Budgets should match business value: auxiliary queries and critical business processing should not use exactly the same execution strategy.

    6.3 Preserve Sufficient Audit Evidence

    When errors occur, teams need to know which materials the system accessed, which tools it called, what side effects it produced, and at which step it deviated from the goal.

    Audit records should include task state changes, summaries of tool inputs and outputs, validation results, approval records, and policy versions. The purpose is not to retain everything indefinitely, but to support troubleshooting and accountability while following data minimization principles.

    For model decisions, concise action rationales and supporting evidence can be stored; lengthy internal reasoning does not need to serve as the basis for audit.

    7. Evaluation: Measure Task Quality, Not Just Answer Quality

    Agent evaluation should cover the entire execution process. Fluent language only shows that the output format is good; it does not prove that the task was completed correctly.

    It is advisable to build test sets that include normal inputs, ambiguous requirements, missing data, permission conflicts, tool exceptions, and malicious content, and to focus on the following dimensions:

    Task completion: Does the result meet predefined acceptance conditions, and are key steps missing?

    Result credibility: Are conclusions supported by verifiable evidence, and are guesses presented as facts?

    Execution safety: Did unauthorized access, unapproved writes, or sensitive information leakage occur?

    Recovery capability: When failures occur, can the system correctly pause, retry, use an alternative, or hand off to a human?

    Resource efficiency: Are the time, number of calls, and resource consumption required to complete the task reasonable?

    Version stability: After a policy update, do new tasks improve, and do existing capabilities regress?

    Evaluation sets should be appropriately isolated from the data used for experience extraction so that the system does not simply memorize existing cases. For high-impact tasks, automated scoring should be supplemented by business rule validation and human spot checks.

    8. Phased Deployment: Establish Boundaries Before Increasing Autonomy

    Enterprises should not start directly with open-ended, long-running, high-permission tasks. A safer path is to expand the execution scope gradually.

    In the first phase, choose read-only tasks such as document summarization, information retrieval, and anomaly explanation. Focus on validating information quality, cited evidence, and permission isolation.

    In the second phase, introduce controlled writes, such as generating drafts for review or creating reversible internal records. All writes should have clear boundaries and necessary approvals.

    In the third phase, carry out multi-step business collaboration while establishing task state persistence, failure recovery, and human takeover mechanisms.

    In the fourth phase, introduce experience accumulation and strategy optimization. Place candidate improvements in an isolated environment for evaluation, release them on a small scale after review, and expand usage only after confirming that there is no obvious regression.

    Each phase should have exit conditions. If the system cannot reliably meet the quality and safety requirements of the current phase, autonomy should not be increased merely because the functionality appears more advanced.

    9. Conclusion: Continuous Improvement Must Be Verifiable

    The rapid evolution of agents shows that AI is moving from content generation to task execution. For developers and enterprises, however, the real value lies not in the speed of concept turnover but in whether the system can reliably complete valuable work.

    Task planning determines how the system acts. Tool governance determines where it can act. Memory management determines how experience is reused. Evaluation and version control determine whether improvements are trustworthy.

    A mature form of self-evolution is not a system that can change itself arbitrarily. It is one in which every change has a basis, a test, a boundary, and the ability to be traced and rolled back. Only when these capabilities are fully established can agents move from impressive demos to business systems worthy of long-term reliance.