The Reversible Design of Plugin-Based Agent Runtimes: From “Everything Is a Plugin” to “Everything Is a Delta”
This article explains how reversible computation can provide a formal foundation for plugin-based Agent runtimes. It distinguishes reversible structural changes from irreversible business side effects, and shows how treating plugins as composable delta units enables predictable composition, precise rollback, and runtime reconciliation. It also outlines practical principles for designing declarative, reversible plugins.
1. Why Agent Frameworks Need a Runtime Harness
As large language model applications evolve from single requests into long-running, multi-step Agent systems, the community is reaching a common conclusion: the complexity of an Agent system comes less from the model itself than from the orchestration layer.
Tool-calling loops, memory management, context assembly, authorization, and subtask delegation are distributed across different frameworks, each with substantially different implementation patterns.
A new class of runtime frameworks—often described as a Harness, or a structural environment for running Agents—has proposed an ambitious architectural principle:
Everything is a plugin, and every plugin is reversible.
Formal papers accompanying this idea have provided mathematical definitions for the underlying plugin runtime from the perspective of category theory. The community response has been divided. Some see a paradigm-level innovation, while others have raised several questions:
- Agent Loops and memory systems are fundamentally different. What is gained by representing both as the same type of “plugin”?
- Plugin-based design is not new. Aren’t existing frameworks already highly configurable?
- “Reversible plugins” sound counterintuitive. Side effects are unavoidable, so how can a plugin really be reversible?
- Why are dynamically updating plugins necessary? Isn’t version management sufficient?
This article examines these questions from the perspective of reversible computation and provides an explanation that is both accessible and technically precise.
2. From “Everything Is a Plugin” to “Everything Is a Delta”
“Everything is a plugin” can be expressed through an additive formula:
App = Base + Plugin1 + Plugin2 + ... + PluginN
At first glance, this looks no different from ordinary modular design. The critical question, however, is whether the plus sign has a strict mathematical definition.
In most frameworks, a plugin is a loose combination of extension points and callback functions. A plugin may register hooks, intercept requests, or modify behavior, but the way two plugins interact, the order in which they are composed, and how conflicts are resolved are usually determined by framework-specific conventions. There is no unified algebraic rule for describing these operations.
In a runtime with a formal foundation, a plugin is defined as a delta unit. It is not arbitrary code, but a structural modification to the runtime’s structure space—an integrated space consisting of tools, prompt templates, state channels, control-flow nodes, and other runtime elements.
Plugin-based design is therefore elevated into a model with the following properties:
- Composable: The combination of any two plugins follows a defined composition rule, similar to function composition or partial-order merging.
- Semantically analyzable with respect to ordering: The impact of composition order on the final structure can be derived rather than being an implicit consequence of registration order.
- Reversible: Given a delta, there is a well-defined inverse delta that can precisely remove its effects from the structure space.
This answers the first objection. The value of representing both the Agent Loop and memory as plugins is not merely formal consistency. It is that both can be incorporated into the same delta algebra, giving their composition predictable and verifiable behavior.
3. What Does “Reversible” Actually Mean?
This is the point most likely to be misunderstood. “Reversible” does not mean running an Agent execution backward. Side effects produced by model execution—such as messages sent to external systems or records written to a database—cannot simply be erased.
Instead, reversibility applies to a different category of side effect: changes to the runtime’s structure space.
More specifically:
- Installing a plugin applies a change Δ to the structure space. For example, it may add a tool, replace part of a prompt, or modify a control-flow node.
- Uninstalling or rolling back the plugin applies an inverse change Δ⁻¹, returning the structure space precisely to its previous state.
- The rollback must be complete and exact, without leaving behind dirty remnants—for example, a tool registered by the plugin that was never removed, or a modified configuration that was not restored.
This distinction is important. Such runtimes do not attempt to control every side effect produced during Agent execution. That would be neither possible nor necessary. Instead, they manage a specific type of side effect: structural changes that affect how multiple plugins compose and interact.
This narrower definition turns reversibility from a philosophical slogan into an engineering constraint that can be implemented in practice.
4. The Relationship to Reversible Computation
The central idea of reversible computation is that software construction should be based on generation plus delta. Any system can be represented as:
App = Generator + Delta
The delta is then operated on through a set of algebraic rules: it can be added, reversed, and composed. These rules already have mature formal applications in the compile-time structure space, including declarative modeling, delta merging, and reconciliation mechanisms across configuration, model, and code-generation layers.
The relationship can be summarized as follows:
| Dimension | Reversible computation theory | Plugin runtime |
|---|---|---|
| Scope | Compile time and construction time | Runtime |
| Delta objects | Models, configurations, and code structures | Tools, prompts, control flow, and state channels |
| Degree of formalization | A complete delta algebra | Mechanisms exist, but the algebraic foundation is not yet complete |
| Reversible implementation | Declarative deltas and generator-based rollback | Dynamic installation and removal with runtime reconciliation |
The conclusion is that this type of plugin runtime can be viewed as a concrete application of reversible computation to the runtime structure space.
Plugins are indeed defined as structured delta units. However, fully realizing reversibility still requires the broader formal methods already used at compile time. Existing implementations demonstrate elements such as declarative configuration and runtime reconciliation, but their delta algebra is not yet fully formalized.
5. Practical Guidance for Using This Architecture
Developers adopting this architecture should keep the following principles in mind.
1. Define plugins declaratively
A plugin should describe what change it makes to the structure space, rather than simply specifying what code it should execute. This is a prerequisite for reversibility.
For example:
plugin: web-search-tooldelta:add-tools:- name: web_searchschema: ...patch-prompt:path: system.tools.guidancemode: append
2. Rely on runtime reconciliation instead of manual registration and deregistration
When plugins are installed or removed, the runtime should calculate the difference between the old and new structure spaces and perform reconciliation consistently. This helps prevent residual artifacts such as “ghost tools” or ineffective prompt modifications.
3. Design plugins as composable deltas
When designing a plugin, ask:
- What is its inverse operation?
- How should it resolve conflicts with neighboring plugins acting on the same structural node?
The answers should be made explicit in the declaration.
4. Distinguish between two types of side effects
Business side effects—such as calling an external API or writing to a database—should be managed by the Agent’s sandbox and transaction mechanisms.
Structural side effects—such as changing the runtime’s shape—should be managed by the delta mechanism.
Confusing these two categories is a major reason why this type of architecture can fail in practice.
6. Conclusion
The essence of “everything is a plugin, and every plugin is reversible” is to elevate plugins from informal extension points into mathematically definable delta units. This gives Agent runtime evolution an engineering foundation that is predictable, rollback-capable, and verifiable.
The idea is closely aligned with reversible computation. The plugin runtime applies the concept to the runtime structure space, while reversible computation has already established formal methods for the compile-time structure space.
Once it is clear that reversibility does not mean reversing execution, but reversing structural changes, the mathematical notation becomes easier to interpret. More importantly, the architectural innovation becomes clear: it provides a principled way to compose, reconcile, and roll back the evolving structure of an Agent runtime.
