For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • About NVIDIA NeMo Relay
    • Overview
    • Architecture
    • Ecosystem
    • Concepts
    • Release Notes
  • Getting Started
    • Agent Runtime Primer
    • Prerequisites
    • Installation
    • Configuration / Setup
    • Quick Start
  • NVIDIA NeMo Relay CLI
    • About
    • Basic Usage
    • Claude Code
    • Codex
    • Cursor
    • Hermes Agent
  • Supported Integrations
    • About
    • OpenClaw Plugin Guide
    • LangChain Integration Guide
    • LangGraph Integration Guide
    • Deep Agents Integration Guide
  • Instrument Applications
    • About
    • Adding Scopes and Marks
    • Instrument a Tool Call
    • Instrument an LLM Call
    • Add Middleware
    • Code Examples
  • Observability Plugin
    • About
    • Configuration
    • Agent Trajectory Interchange Format (ATIF)
    • Agent Trajectory Observability Format (ATOF)
    • OpenTelemetry
    • OpenInference
  • Adaptive Plugin
    • About
    • Configuration
    • Adaptive Cache Governor (ACG)
    • Adaptive Hints
  • NeMo Guardrails Plugin
    • About
    • Configuration
  • Integrate into Frameworks
    • About
    • Adding Scopes
    • Wrap Tool Calls
    • Wrap LLM Calls
    • Handle Non-Serializable Data
    • Using Codecs
    • Provider Codecs
    • Provider Response Codecs
    • Code Examples
  • Build Plugins
    • About
    • Define a Plugin
    • Validate Plugin Configuration
    • Plugin Configuration Files
    • Register Plugin Behavior
    • Design Plugin Configuration
    • NeMo Guardrails Example Plugin
    • Code Examples
  • Contribute
    • About
    • Development Setup
    • Workflow and Reviews
    • Testing and Documentation
  • Reference
    • APIs
      • Python Library Reference
      • Node.js Library Reference
      • Rust Library Reference
        • nemo-relay
          • api
          • codec
          • config_editor
          • error
          • json
          • observability
          • plugin
            • ConfigDiagnostic
            • ConfigPolicy
            • ConfigReport
            • PluginComponentSpec
            • PluginConfig
            • PluginRegistration
            • PluginRegistrationContext
            • DiagnosticLevel
            • PluginError
            • UnsupportedBehavior
            • Plugin
            • active_plugin_report
            • clear_plugin_configuration
            • deregister_plugin
            • ensure_builtin_plugins_registered
            • initialize_plugins
            • list_plugin_kinds
            • lookup_plugin
            • register_plugin
            • rollback_registrations
            • validate_plugin_config
            • Result
          • plugins
          • stream
          • editor_config
        • nemo-relay-adaptive
        • nemo-relay-ffi
    • Performance
  • Resources
    • Support and FAQs
    • Glossary
    • Troubleshooting Guide
    • Community
    • Legal
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogo
On this page
  • Implementations
  • impl PluginRegistrationContext
  • new
  • with_namespace
  • qualify_name
  • register_subscriber
  • register_llm_request_intercept
  • register_tool_sanitize_request_guardrail
  • register_tool_sanitize_response_guardrail
  • register_tool_conditional_execution_guardrail
  • register_llm_sanitize_request_guardrail
  • register_llm_sanitize_response_guardrail
  • register_llm_conditional_execution_guardrail
  • register_llm_execution_intercept
  • register_llm_stream_execution_intercept
  • register_tool_request_intercept
  • register_tool_execution_intercept
  • add_registration
  • extend_registrations
  • into_registrations
  • Trait Implementations
  • impl Default for PluginRegistrationContext
  • default
ReferenceAPIsRust Library Referencenemo-relayplugin

Struct Plugin Registration Context

||View as Markdown|
Previous

Struct Plugin Registration

Next

Enum Diagnostic Level

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

1pub struct PluginRegistrationContext { /* private fields */ }

Context provided to plugin handlers during runtime registration.

Each register_* call both installs the middleware/subscriber into the NeMo Relay runtime and records the inverse deregistration closure so the host can roll back partial setup on failure.

Implementations

impl PluginRegistrationContext

impl PluginRegistrationContext

new

pub fn new() -> Self

Creates an empty plugin registration context.

with_namespace

pub fn with_namespace(namespace: impl Into<String>) -> Self

Creates a plugin registration context that namespaces all registration names.

qualify_name

pub fn qualify_name(&self, name: &str) -> String

Returns the runtime-qualified name for a plugin-local registration.

Plugin handlers should pass stable component-local names such as "tool" or "subscriber". The host applies the namespace so users do not have to provide component instance ids.

register_subscriber

pub fn register_subscriber(
    &mut self,
    name: &str,
    callback: EventSubscriberFn,
) -> Result<()>

Registers an event subscriber and records its rollback closure.

register_llm_request_intercept

pub fn register_llm_request_intercept(
    &mut self,
    name: &str,
    priority: i32,
    break_chain: bool,
    callback: LlmRequestInterceptFn,
) -> Result<()>

Registers an LLM request intercept and records its rollback closure.

register_tool_sanitize_request_guardrail

pub fn register_tool_sanitize_request_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolSanitizeFn,
) -> Result<()>

Registers a tool sanitize-request guardrail and records its rollback closure.

register_tool_sanitize_response_guardrail

pub fn register_tool_sanitize_response_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolSanitizeFn,
) -> Result<()>

Registers a tool sanitize-response guardrail and records its rollback closure.

register_tool_conditional_execution_guardrail

pub fn register_tool_conditional_execution_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolConditionalFn,
) -> Result<()>

Registers a tool conditional-execution guardrail and records its rollback closure.

register_llm_sanitize_request_guardrail

pub fn register_llm_sanitize_request_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmSanitizeRequestFn,
) -> Result<()>

Registers an LLM sanitize-request guardrail and records its rollback closure.

register_llm_sanitize_response_guardrail

pub fn register_llm_sanitize_response_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmSanitizeResponseFn,
) -> Result<()>

Registers an LLM sanitize-response guardrail and records its rollback closure.

register_llm_conditional_execution_guardrail

pub fn register_llm_conditional_execution_guardrail(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmConditionalFn,
) -> Result<()>

Registers an LLM conditional-execution guardrail and records its rollback closure.

register_llm_execution_intercept

pub fn register_llm_execution_intercept(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmExecutionFn,
) -> Result<()>

Registers an LLM execution intercept and records its rollback closure.

register_llm_stream_execution_intercept

pub fn register_llm_stream_execution_intercept(
    &mut self,
    name: &str,
    priority: i32,
    callback: LlmStreamExecutionFn,
) -> Result<()>

Registers an LLM stream execution intercept and records its rollback closure.

register_tool_request_intercept

pub fn register_tool_request_intercept(
    &mut self,
    name: &str,
    priority: i32,
    break_chain: bool,
    callback: ToolInterceptFn,
) -> Result<()>

Registers a tool request intercept and records its rollback closure.

register_tool_execution_intercept

pub fn register_tool_execution_intercept(
    &mut self,
    name: &str,
    priority: i32,
    callback: ToolExecutionFn,
) -> Result<()>

Registers a tool execution intercept and records its rollback closure.

add_registration

pub fn add_registration(&mut self, registration: PluginRegistration)

Adds a prebuilt registration to the context.

extend_registrations

pub fn extend_registrations(&mut self, registrations: Vec<PluginRegistration>)

Extends the context with prebuilt registrations.

into_registrations

pub fn into_registrations(self) -> Vec<PluginRegistration>

Consumes the context and returns the recorded registrations.

Trait Implementations

impl Default for PluginRegistrationContext

impl Default for PluginRegistrationContext

default

fn default() -> PluginRegistrationContext