How AI Agents Can Achieve Controlled Self-Evolution Through Plugins and Skill Packages

    As AI agents move beyond one-shot question answering into complex, long-running workflows, they need more than model calls. They must support staged execution, interruption and recovery, cooperation between execution units, and dynamic capability expansion. This article explains how to distinguish sub-agents, background jobs, and persistent goals, and how plugins, skill packages, state management, and governance can enable controlled capability improvement without sacrificing security, observability, or rollback.

    As AI agents evolve from simple question-and-answer systems into complex workflows, they must handle more than a single model invocation. They may need to run for extended periods, proceed through multiple stages, recover after interruptions, coordinate multiple execution units, and acquire new capabilities dynamically.

    In this context, the ideas of “everything as a plugin” and “skill packages” are highly attractive architectural directions. The model interprets the task and creates a plan, plugins connect the system to external capabilities, skill packages preserve reusable methods, and the runtime manages scheduling, memory, permissions, and state.

    However, pluginization does not automatically make a system capable of self-evolution, and skill packages do not give an agent autonomous learning capabilities. The real challenge is enabling an agent to acquire new capabilities continuously without breaking the system’s boundaries, explainability, or security.

    1. Why Modeling Everything as a Task Is a Mistake

    In an agent system, the following scenarios may initially appear similar:

    • Asking another agent to independently organize research materials;
    • Running a program in the background;
    • Continuing to work toward a goal until its completion criteria are satisfied.

    Representing all three with a single Task object can provide a clean interface at first. Each object might contain an identifier, status, result, cancellation method, and error information.

    But once the system adds recovery, permissions, retries, historical context, and lifecycle management, the differences become significant.

    The core of the first scenario is another agent. It requires an independent session context, records of model calls, tool permissions, and a relationship with its parent agent. Its result is usually the output of a delegated execution.

    The second scenario is a background execution process. It may be created by a script, program, message consumer, or child agent. The system mainly needs to know whether it is running, whether its output can be read, whether it should be awaited, and whether resources are released correctly after termination.

    The third scenario is goal progression. It may not correspond to a continuously running process. Instead, the current session repeatedly observes results, revises its plan, and takes action toward the same goal. The end of one execution does not necessarily mean that the goal has been achieved.

    A more robust design should therefore preserve three types of objects:

    Object type Management focus Typical states Completion semantics
    Sub-agent Sub-session, capability scope, parent-child relationship Created, running, waiting, completed, failed A delegated execution has ended
    Background job Runtime identity, output, waiting, termination Running, stopping, completed, failed, terminated The background producer releases resources and submits a terminal state
    Persistent goal Goal definition, phase, revisions, iterations Active, paused, blocked, completed The goal is explicitly determined to have been achieved

    These objects can work together, but they should not replace one another. A sub-agent can act as the producer of a background job, and a background job can support a persistent goal. Their lifecycles and completion semantics should nevertheless remain distinct.

    2. Identify the Managed Object Before Choosing Asynchronous Execution

    “Asynchronous” describes a calling method, not a business object.

    When an architecture sees that work should be handled later or should not block the current flow, it is tempting to create an asynchronous task immediately. This can result in every long-running activity being placed into the same queue, eventually causing confused state management, excessive permissions, and difficult recovery.

    A better design starts by answering three questions.

    2.1 Does the Work Require an Independent Agent Turn?

    If the work requires another agent to independently understand context, call tools, plan steps, and submit a result, the system should create a sub-agent.

    A sub-agent typically needs:

    • An independent or isolated session context;
    • A clearly defined tool allowlist;
    • Separate records of model calls;
    • An association between the parent and child sessions;
    • Structured records for inputs, outputs, and errors.

    The key question is not whether the work runs in parallel. It is whether there is an independent reasoning entity with its own execution process.

    2.2 Does the System Need to Manage a Background Lifecycle?

    If the work can be performed by any producer and the system must support querying, reading output, waiting for completion, and terminating the work, it is better modeled as a background job.

    A background job may be produced by:

    • A controlled program;
    • A data-processing workflow;
    • A sub-agent;
    • A consumer waiting for an external event;
    • A scheduled execution unit.

    The job object should describe the lifecycle, not interpret the producer’s business objective. This prevents program execution, agent reasoning, and goal management from being forced into the same abstraction.

    2.3 Must the System Continue Working Toward the Same Goal?

    If the current agent needs to observe results, adjust its plan, and continue acting within the same session, it should use a persistent goal.

    A goal object generally needs to store:

    • The goal text and structured constraints;
    • The current phase;
    • Completed steps;
    • Unresolved issues;
    • The latest execution result;
    • The current revision;
    • Iteration or resource budgets;
    • Policies governing whether execution may continue.

    Goal management focuses on whether the system should continue, not whether an individual invocation has ended.

    3. The Value of Plugins: Decoupling Capabilities from the Core Runtime

    The primary value of a plugin architecture is not simply increasing the number of available tools. It is separating how capabilities are provided from the core agent logic.

    A plugin can generally be described through the following components:

    1. Plugin identifier
    2. Capability description
    3. Input schema
    4. Output schema
    5. Permission declaration
    6. Execution entry point
    7. Timeout and cancellation policy
    8. Error classification
    9. Audit information

    For example, a document-retrieval plugin should not expose only an ambiguous execution function. It should clearly specify:

    • The accepted query format;
    • Whether access is limited to a defined data scope;
    • Whether it returns source text, a summary, or structured results;
    • Whether it can produce external side effects;
    • How permission errors, network errors, and missing data are distinguished;
    • Whether cancellation and timeouts are supported.

    This gives the model reliable capability boundaries when selecting tools and allows the runtime to enforce validation and governance.

    Plugin interfaces should also remain as stable as possible. Internal implementations may change, but input and output contracts, error semantics, and permission requirements should not change frequently. Otherwise, skill packages and workflows become tightly coupled to implementation details and become difficult to maintain.

    4. A Skill Package Is More Than a Collection of Prompts

    A skill package can be understood as a structured encapsulation of a method for solving a class of problems. It should cover at least four areas.

    4.1 Applicability Conditions

    The skill package should explain when it should and should not be used. For example, a skill may be suitable for structured information but inappropriate for directly modifying production data.

    4.2 Execution Steps

    The steps should be inspectable rather than consisting only of a natural-language description. Each step should ideally specify its inputs, action, expected output, and failure handling.

    4.3 Validation Criteria

    A skill package should not only tell the agent how to perform a task. It should also explain how to determine whether the task was performed correctly. Validation may include format checks, consistency checks, source-completeness checks, and conditions requiring human confirmation.

    4.4 Versions and Dependencies

    A skill package may depend on plugins, data sources, permission scopes, and other skills. It therefore needs version information, dependency records, and compatibility information.

    A mature skill package is closer to a combination of methods, constraints, tools, and validation rules than to a simple prompt template.

    5. “Self-Evolution” Should Be Divided into Three Levels

    The term “self-evolution” is easily misunderstood as a system’s ability to modify its own capabilities freely. From an engineering perspective, it is more useful to divide it into three levels.

    Level 1: Capability Composition

    The agent selects existing plugins and skill packages according to the task and automatically arranges their execution order. This is runtime planning, and its risks are relatively controllable.

    Level 2: Experience Consolidation

    The system extracts process-improvement suggestions from successful and failed executions. For example, it may recommend changing the order of steps, adding a validation stage, or improving exception handling.

    However, experience should not directly overwrite production rules. It should first enter a candidate area, where it can be tested, reviewed, versioned, and then released.

    Level 3: Capability Generation

    The system generates new skill packages, plugin adapters, or execution strategies. This is the highest-risk level and must involve static checks, sandbox testing, permission review, and rollback validation.

    Therefore, practical self-evolution does not mean that a model can freely modify the system. A safer process is:

    1. Execution records
    2. -> Root-cause analysis
    3. -> Improvement suggestions
    4. -> Candidate skill
    5. -> Automated tests
    6. -> Security review
    7. -> Limited rollout
    8. -> Effect monitoring
    9. -> Formal activation or rollback

    6. Persistent Goals Need Explicit Continuation Policies

    One of the most common problems in goal-oriented systems is endless continuation. If a goal is not explicitly marked as complete, the agent may repeatedly initiate new execution rounds.

    A continuation policy should consider at least the following conditions:

    • Whether unfinished steps remain;
    • Whether the latest execution produced meaningful progress;
    • Whether multiple consecutive rounds produced no new information;
    • Whether time, invocation, or cost budgets have been exceeded;
    • Whether a human decision is required;
    • Whether a security policy has been triggered;
    • Whether the result meets the acceptance criteria.

    The continuation decision can be expressed as follows:

    1. if acceptance criteria are met:
    2. complete
    3. elif budget is exceeded:
    4. pause
    5. elif human judgment is required:
    6. blocked
    7. elif there has been no progress for several rounds:
    8. pause
    9. else:
    10. continue

    The complete, pause, and blocked states should not be determined solely by whether a process has exited. They should be decided by goal-management logic based on evidence.

    7. Separate State, Output, and Events

    Many systems place all information into a single object, causing state updates and execution output to interfere with one another. A clearer design separates them into three parts:

    • Current state: Describes the object’s current phase;
    • Execution output: Records the results produced by a program or agent;
    • Lifecycle events: Records changes such as creation, startup, pause, retry, cancellation, and completion.

    Event records are particularly important because they support:

    • Troubleshooting;
    • Operational auditing;
    • State recovery;
    • Process replay;
    • Metrics collection;
    • Strategy optimization.

    State updates should also be as idempotent as possible. If the same completion event is received more than once, the system must not deduct resources repeatedly, send duplicate notifications, or submit the same result multiple times.

    8. Security Boundaries Determine Whether Pluginization Can Last

    The more plugins and skill packages a system has, the larger its attack surface and the greater the risk of misuse. At minimum, it should establish the following controls.

    Least-Privilege Access

    Each plugin should receive only the permissions required to complete its task. An agent’s broader permissions should not automatically grant every plugin access to all capabilities.

    Capability Tiers

    Capabilities can be divided into levels such as read-only, writable, executable, and access to sensitive data. High-risk capabilities should require additional human confirmation.

    Sandboxed Execution

    Code, scripts, and skill packages generated or modified by the system should run in isolated environments with restricted access to files, networks, processes, and system resources.

    Versioning and Rollback

    All plugins and skill packages should be versioned, with change records retained and rapid restoration to the previous stable version supported.

    Output Validation

    A structured response from a plugin should not be treated as trustworthy by default. Important results should still pass format validation, source validation, and business-rule checks.

    A robust agent runtime can be divided into five layers:

    1. Interaction layer: Receives user requests and displays status;
    2. Planning layer: Identifies goals, breaks them into steps, and selects skills;
    3. Execution layer: Schedules sub-agents, background jobs, and plugins;
    4. State layer: Stores sessions, goals, jobs, and events;
    5. Governance layer: Manages permissions, auditing, budgets, testing, and rollback.

    The planning layer should not directly operate low-level resources. It should invoke them through controlled execution interfaces. This creates a clear separation between what the model wants to do and what the system allows it to do.

    Conclusion

    Plugins and skill packages can become an important foundation for continuous agent improvement, but they are capability-extension mechanisms, not the entire answer to self-evolution.

    A mature design needs to address four questions at the same time:

    • Use sub-agents to represent independent reasoning entities;
    • Use background jobs to represent manageable execution lifecycles;
    • Use persistent goals to represent progress across multiple rounds;
    • Use plugins, skill packages, and governance workflows to preserve capabilities and release improvements safely.

    When a system can distinguish who is working, what work is running, and whether a goal has genuinely been completed, it gains the engineering foundation required for stable expansion and continuous improvement.

    Self-evolution should be built on observability, validation, auditability, and rollback—not on uncontrolled automatic modification.