Feat: adding capabilities and Common Message Format to plugin framework#8
Open
Feat: adding capabilities and Common Message Format to plugin framework#8
Conversation
7e41bd8 to
5768444
Compare
added 4 commits
March 20, 2026 12:01
Signed-off-by: Teryl Taylor <terylt@ibm.com>
Signed-off-by: Teryl Taylor <terylt@ibm.com>
Signed-off-by: Teryl Taylor <terylt@ibm.com>
Signed-off-by: Teryl Taylor <terylt@ibm.com>
5768444 to
ac6fdde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As the plugin framework grows to support multi-tenant deployments, security-sensitive
workloads, and diverse authentication methods, plugins increasingly need access to
contextual metadata — who is making the request, what security labels apply, which
HTTP headers were sent, what agent is orchestrating the call. Today this metadata is
either unavailable to plugins or scattered across payload fields (like the
now-deprecated headers). Extensions solve this by providing a single, structured
envelope of contextual metadata that travels alongside every hook invocation. But not
every plugin should see everything — a logging plugin doesn't need the user's security
clearance, and no plugin should be able to forge identity claims. Capabilities govern
this: each plugin declares what it can read and write, and the framework enforces
those boundaries automatically. Together, extensions and capabilities give plugin
authors rich context while giving platform operators fine-grained control over what
each plugin can access and modify.
metadata slots — security (subject, labels, classification, objects, data), HTTP
headers, agent context, MCP metadata, provenance, request context, LLM parameters, and
custom fields — that flow through the plugin pipeline as structured, frozen Pydantic
models
levels:
can read with the right capability but never modify
superset validation on merge
modify
copying in only the slots the plugin's declared capabilities grant access to — secure
by default, new slots are hidden unless explicitly included
plugins: immutable slots silently ignored, monotonic slots validated for superset,
mutable slots accepted — no costly before/after diff needed
for all slot registry keys and Pydantic field names, preventing typo-induced
duplicates
an extensions parameter to their hook method; the signature is inspected once at
registration time and stored as a boolean on HookRef, with a single branch at
dispatch. All 30+ existing 2-param plugins work unchanged with zero overhead.
Extensions are filtered per-plugin via filter_extensions(extensions,
plugin.capabilities) at the dispatch site
shared across all plugins (zero copies unless a plugin modifies it); only the small
Extensions object is filtered/copied per-plugin. This maps directly to Rust's
Arc + per-plugin stack value pattern
multi-modal conversations, with message hooks (message_pre_invoke,
message_post_invoke) for pipeline processing
payloads (superseded by extensions.http.headers), using
warnings.warn(DeprecationWarning) which fires once per call site
Test plan
superset, mutable accepted
slots
removal