Everything is a Plugin: Deconstructing the Design and Implementation of Agent Runtime Frameworks
AI agent frameworks have evolved to turn large language models (LLMs) from mere chatbots into capable workers through a "Harness" architecture. This article explores the five-layer design of agent harnesses and examines the emerging "everything is a plugin" approach, weighing its benefits against its trade-offs. It also provides a practical guide to setting up a secure agent environment from scratch, including installation, API key management, and sandbox configuration, followed by insights into selecting the right plugins, with a focus on knowledge distillation and security.
1. Harness: From Chatbots to Capable Workers
In the AI domain, the word “Harness” refers to putting raw power into a controllable structure. An LLM itself is merely an inference engine. It lacks file system access, has no persistent memory, cannot directly call external APIs, and cannot execute code. To enable the model to perform actual work, an outer runtime layer is required to provide these capabilities. This layer is the Harness.
A typical Agent Harness usually consists of five layers:
| Layer | Responsibility | Common Implementation | Failure Risk |
|---|---|---|---|
| Model Access Layer | Unified model invocation, managing context windows, streaming output, and multi-model switching | Unified SDK, model adapters | Context limit exceeded, API rate limiting |
| Tool Execution Layer | Mapping function calls to file reading/writing, command execution, and web access | Function Calling and tool registries | Tool privilege escalation, parameter errors |
| Session & Memory Layer | Maintaining multi-turn dialogue state, long-term memory, and task context | Session storage, vector databases | Memory pollution, context loss |
| Sandbox Layer | Isolating code execution environments to protect the host system | Containers, restricted processes | Incomplete isolation, sandbox escape |
| UI & Interaction Layer | Providing terminal, web, or desktop interfaces | Command line, web console | Lack of approval workflows, accidental operations |
Understanding these five layers makes it clear why the open-source community is enthusiastic about open-source Harnesses. It abstracts the infrastructure that every team otherwise has to repeatedly develop into a shared foundation.
2. The “Everything is a Plugin” Approach: Pros and Cons
Traditional agent frameworks are usually feature-rich, offering out-of-the-box capabilities such as file reading/writing, image recognition, and web search. Recently, a new category of frameworks has taken a different route: keeping the core lean while integrating models, tools, skills, session management, sandboxes, and UIs through a unified plugin interface. This allows teams to replace and combine components like building blocks.
The advantages of this approach are threefold:
- Lean Core, Community-Driven Expansion: The framework itself only maintains the plugin protocol and scheduling mechanism. Feature growth primarily comes from the plugin ecosystem, which tends to expand rapidly.
- High Customization: Teams can tailor capabilities based on the same foundation. For example, they can enable only internal network tool plugins while disabling internet access plugins.
- Low Contribution Barrier: With a clear plugin protocol, developers can quickly add new capabilities to the ecosystem.
The trade-offs are equally clear. Basic capabilities must be supplemented by plugins. Features common in other frameworks—such as image recognition, file references, and context compression—require users to select or write plugins themselves in this type of framework. New users often find the initial experience lacking in features and difficult to get started with.
Therefore, the correct sequence for using such a framework is: first, complete the basic plugins, and then expand as needed.
3. From Scratch: Installation and Initialization
Pre-Installation Checklist
- Node.js version meets the official documentation requirements (verify using
node -v). - The appropriate package manager (such as npm or pnpm) is installed.
- Network access to the official download addresses is available; configure a proxy if necessary.
- An API Key is prepared on the model service platform and planned to be stored in environment variables.
- The directories and network ranges accessible to the Agent are planned out, implementing a least-privilege sandbox.
Installation Methods
There are three common installation methods: script installation, package manager installation, and source compilation. It is recommended to copy the installation command for the current version from the official documentation and specify the exact version number for easier rollback if issues arise.
If using script installation, download the script first, verify it, read its contents, and then execute it. Do not pipe a remote script directly to bash.
node -v # Verify Node.js versioncurl -fsSLO <official-script-url> # Download script only, do not execute yetshasum -a 256 <script-filename> # Compare with official SHA-256 value (sha256sum on Linux)less <script-filename> # Read through the script contentbash <script-filename> # Execute after confirming no issues
If the official checksum is not provided, verify the script source in the official repository or release page. Back up existing configuration directories before installation for rollback purposes.
Startup and Ports
After installation, the service usually starts locally. The actual listening address and port should be based on the startup logs. If a port is occupied, use lsof -i :<port> to find the occupying process and decide whether to stop it or change the port in the configuration. Open the address provided in the logs in a browser to access the console. If inaccessible, check your firewall and local proxy settings.
Configuring the API Key
After creating the key on the model service platform, do not hardcode it into your code repository. Using environment variables or a local secret management tool is recommended:
export LLM_API_KEY="your_api_key"
The export command typed directly in the terminal might remain in the shell history. You can write it to a local file readable only by the current user (e.g., by running chmod 600), ensuring that this file is not committed to version control.
Configuring a Least-Privilege Sandbox
Restrict the Agent’s access to the file system and network. Even if a prompt injection induces the model to execute unauthorized operations, the impact can be contained within a small boundary.
4. The Plugin Ecosystem: Selection Strategies
One direction worth noting in the plugin ecosystem is organizational knowledge distillation plugins. Unlike common web search tools, these address the issue of experience retention and personnel handover.
A notable plugin in this category represents this approach well. Its starting point addresses a specific question: When a colleague leaves, how do you retain their way of working?
Traditional handovers rely on documentation, which only carries explicit knowledge. A person’s decision-making habits, code style preferences, troubleshooting sequences for production incidents, and tacit communication默契 with collaborators are rarely documented, yet they determine their work effectiveness.
The approach of such plugins is “distillation.” It feeds raw materials—such as messaging app logs, chat records, emails, and PDF documents—into the model for processing. It then combines subjective descriptions of the person from team members as supplementary signals to generate a structured Skill. A Skill is an AI capability package that can roughly continue their working mode. These plugins involve a large amount of personal data, so before use, it is necessary to obtain consent from the individuals involved and comply with your organization’s data compliance requirements.
In addition to knowledge distillation, the following types of plugins should also be considered in practice:
| Plugin Type | Use Case | Primary Risk | Suggested Priority |
|---|---|---|---|
| Security Audit | Operation logs, sensitive word filtering, blocking high-risk commands | Incomplete rules leading to missed blocks | Highest, install first |
| Context Engineering | @file references, long context compression, session persistence | Loss of key information during compression | High |
| Multimodal Perception | Image recognition, OCR, screenshot understanding | Uploading private data to external services | Install as needed |
| Tool Integration | Database queries, browser automation, code execution | Unauthorized access, accidental data modification | Install as needed, requires sandbox |
| Knowledge Distillation | Personnel handover, experience retention | Personal data compliance, result bias | Evaluate cautiously |
When selecting plugins, check the maintenance activity, permission declarations, licenses, and the number of unresolved issues. Ensure that the scope of permission declarations is strictly limited to what is necessary for the plugin to function.
