Product 20 · SDK / MCP / Plugin / Local API · Wave 2

Plugin Runtime

A governed front door for every plugin your agent loads. Plugin Runtime gives an agent one disciplined path from untrusted to running: register a granted plugin, authorize each capability, clear a handshake gatekeeper, invoke through a mediated MCP bridge, and forensically record everything the plugin touched. It governs the boundary — it does not vouch for the plugin.

Wave 2 · v0.1.1 · on npm
← Product 19: Triad Protocol Framework Next: Product 21 · Wave 2 Webhook & Event Dormancy Manager →

A plugin arrives, and it's already trusted.

Agents are increasingly asked to load third-party plugins and MCP servers — code and tool surfaces the agent author did not write and cannot fully inspect. The usual pattern is to wire the plugin straight into the runtime: it arrives, it is trusted, and it can call tools and read resources from the first message. There is no recorded moment where someone decided this plugin may hold this capability, and no durable trail of what it actually did once it was live.

When something goes wrong — an unexpected resource read, a capability used outside its grant, a plugin that should never have been authorized — the operator is reconstructing intent from logs that were never designed to answer the question. The plugin's permissions, the capabilities it was authorized for, the exact tool it invoked, and the boundary pressure it generated are scattered or absent.

Plugin Runtime adds the missing structure between "a plugin exists" and "a plugin is running." Loading becomes a sequence of explicit, recorded transitions — registration, capability authorization, handshake, gated invocation — each one logged, each one reversible by termination, each one anchored to a session and trace. The runtime is deliberately conservative: a plugin starts untrusted and only ever holds the specific capabilities it was authorized for.

Register → Authorize → Bridge & record

Register the granted plugin

A plugin that already cleared a handshake is admitted with register_plugin_from_grant, which validates the request/grant envelope pair against the canonical MCP contract, asserts correlation/session/trace match, and records the plugin as registered_idle. It holds permissions but no authorized capabilities yet.

Authorize a capability, then handshake-gate the invocation

authorize_capability promotes the plugin from registered_idle to registered_authorized only if the capability's required permissions are a subset of the granted permissions and the policy engine allows it. At invocation, the runtime re-checks the handshake token and that the capability is in the authorized set.

Invoke through the bridge, record to the forensic sink

Authorized, read-only invocations run inside a transient InvocationContext; mediated resource reads go through the allowlisted MCP bridge (invoke_mcp_bridge_resource). Boundary-pressure and rejection telemetry is written to the forensic sink and is later reconstructable with query_plugin_forensic_events.

Plugin Runtime is a decision-support and governance layer. It records and constrains how plugins are loaded and invoked; it does not certify that a plugin is safe, sandbox arbitrary plugin code, or replace human review of what a plugin is allowed to do. It governs the boundary — it does not guarantee plugin safety.

Lifecycle, capability authorization & forensic sink

The model below is derived directly from the originating agent's plugin runtime, registry, and lifecycle modules. The runtime models a small, fail-closed state machine: there is intentionally no free-floating active state and no auto-flip of execution flags (see the lineage note).

Lifecycle stages
StageMeaningAllowed next
untrusted Plugin is known but not admitted. registered_idle
registered_idle Admitted from a validated grant; holds permissions but no authorized capabilities yet. registered_authorized, terminated
registered_authorized At least one capability authorized; invocable, read-only. terminated
terminated Revoked. Terminal — no further transitions. (none)

Every transition is committed only by the host-runtime actor, never the plugin itself, and recorded as an audit-only PluginLifecycleEvent.

Capability authorization

Authorization is a registry-state update, not an execution grant. Even after authorization, execution_enabled, tool_access_enabled, and orchestration_enabled remain False today — the proven slice authorizes capabilities and permits a narrow set of read-only tool invocations, but does not flip a plugin into general execution. Broad execution is proposed, not proven.

CheckRule
Declared Capability must appear in the plugin's declared capabilities.
Permission subset required_permissions ⊆ granted_permissions.
Policy allow The policy engine must allow the capability for the granted set.
Handshake token Token must match the registration record on every invocation.
Mapped tool Only capabilities with an allowlisted read-only tool can be invoked.
Forensic sink & readback
MechanismWhat it does
Boundary-pressure capture A runtime_rejection carrying the boundary_pressure signal is converted into a durable, write-only heat-history row.
Forensic link Each row preserves a receipt_reference: plugin_telemetry:<event_id>, the plugin context in normalized_fields, and the original event in raw_payload.
Readback Reconstructs those rows without inferring causality (causal_inference_performed: false).
Lineage note. The originating agent proved the governance spine — registration, capability authorization, lifecycle, handshake, a narrow allowlisted MCP bridge, and a write-only forensic sink with read-only readback. It deliberately stops short of general plugin execution: invocation is limited to allowlisted read-only tools and execution_enabled / tool_access_enabled / orchestration_enabled stay False. The product extends this into a packaged runtime; broad execution and sandboxing are proposed, not proven. (Source: the originating agent's plugin runtime.)

MCP tools

The MCP tools below ship in the published package (v0.1.1). Each description names the originating agent's service it was extracted from.

Registration & Lifecycle
register_plugin_from_grant
Admit a granted plugin as registered_idle after validating the request/grant envelope pair.
get_plugin_registry_status
Return a plugin's status, granted permissions, authorized capabilities, and execution flags.
terminate_plugin
Move a plugin to the terminal terminated state with a reason.
list_lifecycle_events
Return the audit-only lifecycle transition history for a plugin.
Handshake & Authorization
process_handshake_request
Run one gatekeeper transition: validated request → policy decision → validated grant (with token + expiry).
authorize_capability
Promote a plugin to registered_authorized for one capability under permission-subset + policy checks.
list_authorized_capabilities
Return the plugin's currently authorized capability set.
Invocation & Bridge
invoke_readonly_tool
Run one allowlisted read-only tool for an authorized plugin inside a transient invocation context.
invoke_mcp_bridge_resource
Read an allowlisted repository-local resource through the mediated MCP bridge (text or metadata mode).
Forensic Sink & Readback
persist_plugin_forensic_event
Write heat-style plugin boundary-pressure telemetry to durable local history.
query_plugin_forensic_events
Read plugin-origin forensic rows by telemetry id, plugin, or session, with no causal inference.

Install

Plugin Runtime is a CertaWorks Wave 2 product — the most architecturally substantial in the suite. It is built, tested, and published on npm. The commands below show the package interface — an SDK, an MCP server, a host-agent plugin, and a local HTTP API, consistent with the rest of the suite — so you can see exactly what it exposes.

Running it, or want to help shape what comes next? Use the feedback form below.

Status — published on npm (v0.1.1)

The package @certaworks/plugin-runtime is live on npm. Install it globally, or point your MCP client at it with the config below (its MCP server command is plugin-runtime-mcp).

npm package
npm install -g @certaworks/plugin-runtime
Claude Desktop config
{
  "mcpServers": {
    "plugin-runtime": {
      "command": "npx",
      "args": ["-y", "-p", "@certaworks/plugin-runtime", "plugin-runtime-mcp"]
    }
  }
}

What Plugin Runtime does and does not do

Does
  • Admit plugins only from a validated handshake request/grant pair
  • Authorize capabilities under permission-subset and policy checks
  • Enforce a fail-closed lifecycle (untrusted → idle → authorized → terminated)
  • Mediate external resource access through an allowlisted MCP bridge
  • Forensically record boundary pressure and reconstruct it later
  • Run fully local as an MCP server, SDK, host-agent plugin, and local HTTP API
Does Not
  • Guarantee that any plugin is safe — it governs the boundary, it does not vouch for plugin behavior
  • Execute arbitrary plugin code by default — execution stays read-only and execution_enabled is False (broad execution is proposed)
  • Sandbox or contain arbitrary third-party plugin code (proposed)
  • Grant general execution, tool access, or orchestration — those flags stay False in the proven slice
  • Give plugins direct filesystem, network, or host access; or infer causality across the forensic record
  • Replace human review of which plugins and capabilities to trust

Using Plugin Runtime? Tell us how it goes

Plugin Runtime is part of CertaWorks Wave 2 — a second set of built tools productized from a working cognitive agent. It's on npm now. Tell us what you're running it against, what broke, or what you'd want next — we read every note.

← Product 19: Triad Protocol Framework Next: Product 21 · Wave 2 Webhook & Event Dormancy Manager →