Agent Harness: How "Everything Is a Plugin" Drives Self-Evolution

    This article explains what an agent harness is, how it differs from an evaluation harness, and why it matters for building capable AI agents. It walks through the minimal runtime loop, the five pluggable slots behind the "everything is a plugin" design, and how reusable skill packages turn successful runs into lasting capability. It also outlines the feedback loops that make self-evolution possible, the observability and isolation requirements, and a practical rollout path for teams starting with a minimal, low-risk setup.

    1. First, Clear Up the Concept: Two Kinds of “Harness” Are Not the Same

    In agent engineering, the term “harness” has long been used for two completely different things, which creates a lot of communication overhead.

    One is an evaluation harness: it hands the model an exam, collects answers, and scores them to measure “can it answer correctly?” This approach is common in academic and open-source communities, typically running standardized datasets and outputting scores.

    The other is a runtime (Agent Runtime): it gives the model tools, lets it take action, and records logs to measure “can it get work done?” Its counterparts are various AI coding tools and terminal agents.

    In one sentence: an evaluation harness is an exam room; an agent harness is a workstation. This article discusses the latter.

    Using the most common analogy:

    • A chat model is like a consultant. You ask, it answers. It cannot see your local files or execute commands; you copy code in, and you copy suggestions out.
    • An agent is like an intern. You say “the tests in this project are failing, help me fix it,” and it browses directories, reads source code, runs tests, changes a couple of lines, runs them again, and reports back.
    • The runtime is not the intern, but the intern’s workstation: a desk (working directory), a computer (command executor), a work order (task and context), and an access control system (permissions and audit).

    Understanding this is key: an agent’s capability ceiling depends less on the model itself and more on how well the workstation is configured.

    2. How the Runtime Actually Works: A Minimal Loop

    Any usable agent runtime is essentially running the same loop:

    1. Load context → Model inference → Select tool → Execute action
    2. ↑ ↓
    3. └────────── Observe result fed back ←─────────┘

    There are four engineering essentials in this loop, and none can be missing:

    1. Context loading: Pack the task description, directory structure, relevant file snippets, and history of operations into a limited context window. How well this is done directly determines whether it “flails around blindly.”
    2. Tool-calling protocol: What the model outputs is not natural language but a structured call intent (tool name + parameters). The runtime is responsible for validation, execution, and feeding standardized results back.
    3. State and rollback: File changes and command side effects must be traceable. The mature approach is workspace snapshots plus diff review, rather than letting loose directly in a production directory.
    4. Termination conditions: There must be a clear “completion判定” and a circuit breaker for “max steps / max duration,” otherwise repeated retries and infinite loops are likely.

    It is worth emphasizing that this loop is vendor-agnostic and is a widely recognized agent runtime paradigm. Any claim of a “proprietary loop” is not rigorous.

    3. “Everything Is a Plugin”: Splitting the Workstation into Pluggable Slots

    The core claim of “everything is a plugin” is: keep the runtime kernel minimal, and externalize all capabilities. It can usually be split into five types of slots:

    Slot Responsibility Typical Implementation
    Tool slot Read/write files, execute commands, retrieve Local process invocation
    Model slot Inference backend Switchable model service
    Storage slot Memory, artifacts, logs Object storage / local disk
    Interface slot Human-machine interaction entry CLI / script invocation
    Policy slot Permissions, audit, rate limiting Middleware interception

    This design brings three direct benefits:

    • Replaceable: The model slot and tool slot are decoupled, so switching models does not change business code.
    • Testable: The policy slot can record and replay, turning a real execution into a regression test case.
    • Governable: All actions pass through the policy slot, so permissions and audit are centralized instead of reimplemented in every tool.

    The cost is also clear: the more plugins, the higher the maintenance cost of interface contracts. So pluginization must be paired with version constraints and contract tests; otherwise “everything is a plugin” degrades into “everything is uncontrollable.”

    4. Skill Packages: Let Capabilities Accumulate Instead of Reasoning from Scratch Every Time

    If plugins solve “what can be done,” skill packages solve “how to do it right.” A skill package is essentially a set of reusable structured knowledge + operation scripts + validation rules, usually containing three layers:

    1. Knowledge layer: Domain conventions, directory standards, common pitfalls checklist.
    2. Process layer: Solidify multi-step operations into ordered steps, reducing the model’s room for free improvisation.
    3. Validation layer: Acceptance criteria and automated checks for each step; fail and roll back.

    Take a test scenario as an example. An “API regression skill package” can be organized like this:

    1. skill: api-regression
    2. knowledge:
    3. - Environment variables and configuration sources
    4. - How to distinguish auth failures from rate-limit errors
    5. steps:
    6. - Start dependent services and wait for health checks
    7. - Run the test suite and output a structured report
    8. - Cluster logs for failed items and flag suspected root causes
    9. verify:
    10. - Report field completeness check
    11. - Failed cases must include reproducible steps

    The key design principle is: skill packages should be “narrow and deep.” One skill package covers only one verifiable workflow, with clear inputs and outputs and rollback on failure. A broad “do-everything skill package” almost inevitably leads to behavior drift in practice.

    5. Why This May Be a Path to Self-Evolution

    “Self-evolution” sounds abstract, but in engineering terms it comes down to three observable feedback loops:

    • Execution feedback: Action results are fed back into context, and the model corrects the next step accordingly. This is the innermost and fastest loop.
    • Skill feedback: Successful trajectories are abstracted into new skill packages, and failed trajectories are written into the pitfalls checklist. Capability thus accumulates instead of disappearing with the session.
    • Policy feedback:统计 high-frequency misoperations, tighten permissions or add pre-checks, lowering the system’s overall error rate.

    Together, these three loops form the mechanism of “getting stronger with use.” Its prerequisite is observability: without complete action logs, diff records, and failure clustering, evolution is just an illusion.

    A cold splash of water is needed: current mainstream runtimes are still in an early stage, and interfaces and behavior may change; they are suitable for early trials and internal pilots, not for locking directly into production-critical paths. At the same time, because it actually modifies files and executes commands, isolation is a hard requirement: a separate working directory, a least-privilege account, a disposable container environment, and a clear credential budget and usage alerts—none can be skipped. Missing credentials mean the core path cannot run, and there are real invocation costs; these must be factored in during evaluation.

    6. Implementation Advice: Start from the Minimum Viable Setup

    The recommended order for teams:

    1. Define boundaries first: Pick a low-risk task that can be automatically accepted (e.g., log clustering, test case completion); do not let it modify core modules right away.
    2. Then isolate: Containerized workspace + read-only mounted source code + separate output directory, with command execution going through a whitelist.
    3. Then pluginize: Extract only two slots—the tool slot and the model slot—and expand after verifying contract stability.
    4. Finally accumulate skill packages: Write proven trajectories into skill packages, add a validation layer, and put them under version control.
    5. Observability throughout: Collect action logs, diffs, duration, and failure reasons in a unified way, using cloud logging services and monitoring alerts.

    To reduce self-build costs, you can also directly adopt a combination of general capabilities from cloud vendors: a container platform to host the isolated environment, object storage to hold artifacts and skill packages, logging services and monitoring alerts for observability, and a message queue for task decoupling. This lets you focus energy on skill package and policy design rather than rebuilding infrastructure.

    7. Conclusion

    “Everything is a plugin + skill packages” is seen as a candidate path for agents toward self-evolution not because it is mysterious, but because it breaks evolution down into engineering problems: pluginization provides a replaceable capability surface, skill packages provide an accumulable knowledge surface, and feedback loops provide a measurable improvement surface. Only when all three are in place can a system get stronger with use; missing any one, it is just a fancier chat box. For developers, the most rational stance now is: pilot in a small scope, isolate strictly, and put observability ahead of features.