Use this guide when a plugin needs more than a single flag or string to configure it safely.
You will define the plugin’s configuration contract, validation rules, advanced configuration patterns, and runtime registration plan. The goal is to make plugin activation predictable for operators while keeping runtime objects and business logic inside the plugin implementation.
A NeMo Relay plugin has four practical parts:
The top-level plugin document keeps activation consistent across bindings:
Keep the component config portable:
enabled: false as disabled for activation, not as a reason to skip validation.Validation should be deterministic and side-effect free. It should inspect config and return diagnostics; it should not register middleware, open network connections, create clients, or mutate process state.
Check these areas:
Diagnostics should be actionable and stable enough for tests or deployment automation:
Use warning when the config can still activate but deserves operator attention. Use error when initialization should not proceed.
These patterns help plugin authors keep configuration stable as components evolve.
Use a field such as config.version when the plugin’s config schema needs independent compatibility handling. Keep the top-level version for the NeMo Relay plugin document itself.
When a plugin can be instantiated more than once, require explicit instance identity in config:
Use the instance identity in logs, diagnostics, and downstream resource names. Let the NeMo Relay plugin system qualify runtime registration names; do not hand-build global names to avoid collisions.
Presets are useful when most deployments use a known shape:
Validate the resolved result, not only the literal input. Unknown preset names should be error diagnostics because the plugin cannot know what behavior to install.
For behavior that can affect execution, include explicit rollout fields:
mode: for example observe_only, enforce, or disabled.priority: where middleware should run relative to other registrations.break_chain: whether a request intercept should stop later intercepts.sample_rate or tenants: when behavior should apply only to part of traffic.Prefer observe-only defaults for new policies and execution-affecting intercepts.
PluginContext is the component-scoped surface used during registration. It connects validated config to real runtime behavior.
Use PluginContext to register:
The context gives the plugin system enough information to qualify runtime names and roll back partial setup if registration fails. Put all runtime registration work inside the registration hook so rollback can clean up correctly.
Avoid these patterns:
Before publishing a plugin config contract:
Use these links to continue from this workflow into the next related task.