Understanding Pluggable Agent Harnesses: A Modular Runtime Framework for AI Agents
This article explains why a pluggable, recomposable agent harness is worth considering when framework hype fades. It compares fixed-loop coding tools with modular runtimes, outlines a layered code structure that separates the core from business logic, defines the meta-framework's role as a plugin scheduler, and covers append-only logging, replay, and self-evolution. It closes with practical adoption advice centered on replacing the layer you change most through configuration.
1. Why Recomposition Matters More Than Framework Hype
The buzz around a new framework often fades as quickly as it appears, but declining attention does not mean the technology has lost its value. For engineering teams, the real question is not whether a framework is being discussed frequently, but whether it solves the layer that is hardest to change. In agent engineering, the most difficult problems are rarely connecting a model or writing a few tools. The pain appears when business rules change and the execution loop, permission policies, logging, and replay are difficult to replace, eventually forcing the team to fork the entire codebase.
This article sets aside specific product attributes and focuses on a general technical approach: a recomposable agent runtime that uses plugins as its only extension surface. Its guiding principle can be summarized as “everything is a plugin”—breaking system capabilities into replaceable modules and swapping them through configuration rather than source changes.
2. Two Design Approaches: Finished Tools vs. Recomposable Chassis
Common solutions in the industry fall into two categories.
The first is the out-of-the-box coding agent. Its core loop is fixed, and extension relies mainly on hooks or external protocol integrations. The advantage is a fast start; the drawback is that changing core execution logic requires modifying source code.
The second is the recomposable runtime, which treats the loop itself as a plugin. Session logs use an append-only structure and support replay, branching, and resume-from-breakpoint. Secondary development only requires swapping plugin configuration instead of forking the project.
| Dimension | Recomposable Chassis | Fixed-Loop Tool | Workflow State Runtime |
|---|---|---|---|
| Positioning | Assembleable agent base | Finished coding agent | State transition orchestration |
| Extension method | All capabilities as plugins, replaced via configuration | Hook/protocol extension | Graph node orchestration |
| Loop modifiability | Loop is a plugin, replaceable and rewritable | Built-in and fixed; changes require source edits | No built-in coding capability |
| Logging and replay | Append-only logs, supports branching and resume | Memory-dependent, limited capability | Relies on state checkpoints |
The conclusion is clear: choose a finished tool for immediate use; when you need to change the agent’s most core execution logic, a recomposable chassis offers significantly lower replacement costs.
3. Layered Code Structure: Full Decoupling of Core and Business Logic
A typical pluggable base is organized into the following directory layers (illustrative):
agent-harness/├── apps/ # Product entry points: CLI, web├── packages/core/ # Sessions, agent loop, tool registry, prompt assembly├── packages/boot/ # Kernel startup, config loading, plugin resolution├── packages/llm/ # Model adapters for compatible interfaces├── packages/* # Feature plugins: files, command sandbox, sub-agents, approval, persistence├── vendor/ # Built-in meta-framework source├── examples/ # Config samples and plugin development examples└── docs/ # Architecture and plugin development docs
Each layer must have clearly separated responsibilities:
- The core layer is the center of business logic. It defines sessions, turns and steps, tool registration, and system prompt assembly.
- The boot layer plus the built-in meta-framework only handles plugin lifecycle, dependency management, and event dispatch, with no business logic.
- The llm layer provides a unified wrapper for model calls. Adding a model only requires writing an adapter plugin, with zero changes to upper-layer business logic.
- Feature plugins cover command execution, file read/write, sandbox isolation, sub-agents, and log persistence, and can be enabled or disabled as needed.
The engineering value of this layering is that the kernel stays stable while business evolution is confined to plugin boundaries, avoiding changes that ripple across the entire system.
4. The Meta-Framework’s Boundary: A Plugin Scheduler, Not a Business Library
The meta-framework supporting the base is positioned as a scheduler. Its core capabilities fall into four categories: mounting and unmounting plugins, dependency resolution and topological sorting, event dispatch, and automatic resource cleanup. Resource cleanup is especially important—when a plugin is unmounted, it must reclaim its registered tools, listeners, and temporary directories; otherwise, long sessions will suffer state leaks.
An illustrative plugin definition:
def apply(ctx, config):# Register tools and event listeners, return a disposerctx.on("step_start", on_step_start)ctx.register_tool("read_file", read_file)return lambda: ctx.dispose("read_file")
5. Logging, Replay, and Self-Evolution
An append-only session log records each step’s input, model output, tool calls, and results in order. This naturally provides three capabilities: replay to locate problems, branching from any node to try different strategies, and resume-from-breakpoint to save compute. Self-evolution does not mean the model rewrites itself; it means continuously replacing and combining plugins based on replay data—for example, adjusting the prompt assembly plugin, swapping the approval policy plugin, or adding a retrieval plugin—forming a controlled iteration loop.
6. Adoption Recommendations
- Solidify the kernel contracts first, then extend with plugins to avoid repeated interface changes.
- Define a clear configuration schema and failure fallback strategy for each type of plugin.
- Enable permission approval and sandbox isolation by default.
- Connect logging and monitoring alerts to a general logging service and monitoring system.
- Build a library of configuration samples to capture reusable combinations and lower the onboarding cost for teams.
In summary, there is only one criterion for judging whether this kind of base is worth adopting: whether the layer you change most often can be replaced through configuration. If it can, then hype no longer matters.
