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
        • nemo_relay
        • adaptive
        • codecs
        • guardrails
        • integrations
        • intercepts
        • llm
        • observability
        • plugin
        • scope
        • scope_local
        • subscribers
        • tools
        • typed
        • utils
      • Node.js Library Reference
      • Rust Library Reference
    • 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
  • Classes
  • ConfigDiagnostic(_ConfigDiagnosticRequired)
  • ConfigReport(TypedDict)
  • PluginContext(Protocol)
  • Methods
  • register_subscriber
  • 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_request_intercept
  • register_llm_execution_intercept
  • register_llm_stream_execution_intercept
  • register_tool_request_intercept
  • register_tool_execution_intercept
  • Plugin(Protocol)
  • Methods
  • validate
  • register
  • ConfigPolicy
  • Methods
  • ConfigPolicy
  • to_dict
  • ComponentSpec
  • Methods
  • ComponentSpec
  • to_dict
  • PluginConfig
  • Methods
  • PluginConfig
  • to_dict
  • Functions
  • validate
  • initialize
  • clear
  • plugin
  • report
  • list_kinds
  • register
  • deregister
  • Type Aliases And Constants
ReferenceAPIsPython Library Reference

nemo_relay.plugin

||View as Markdown|
Previous

nemo_relay.observability

Next

nemo_relay.scope

Generated from python/nemo_relay/plugin.pyi.

Module nemo_relay.plugin.

Generic plugin configuration and registration helpers.

Classes

ConfigDiagnostic(_ConfigDiagnosticRequired)

One plugin validation diagnostic.

ConfigReport(TypedDict)

Validation or activation report for a plugin config.

PluginContext(Protocol)

Component-scoped registration context passed to custom plugin handlers.

Methods

register_subscriber
1def register_subscriber(name: str, callback: Callable[[Event], None]) -> None

Register an infallible event subscriber for this component.

register_tool_sanitize_request_guardrail
1def register_tool_sanitize_request_guardrail(name: str, priority: int, callback: ToolSanitizeGuardrail) -> None

Register a tool sanitize-request guardrail for this component.

register_tool_sanitize_response_guardrail
1def register_tool_sanitize_response_guardrail(name: str, priority: int, callback: ToolSanitizeGuardrail) -> None

Register a tool sanitize-response guardrail for this component.

register_tool_conditional_execution_guardrail
1def register_tool_conditional_execution_guardrail(name: str, priority: int, callback: ToolConditionalExecutionGuardrail) -> None

Register a tool conditional-execution guardrail for this component.

register_llm_sanitize_request_guardrail
1def register_llm_sanitize_request_guardrail(name: str, priority: int, callback: LlmSanitizeRequestGuardrail) -> None

Register an LLM sanitize-request guardrail for this component.

register_llm_sanitize_response_guardrail
1def register_llm_sanitize_response_guardrail(name: str, priority: int, callback: LlmSanitizeResponseGuardrail) -> None

Register an LLM sanitize-response guardrail for this component.

register_llm_conditional_execution_guardrail
1def register_llm_conditional_execution_guardrail(name: str, priority: int, callback: LlmConditionalExecutionGuardrail) -> None

Register an LLM conditional-execution guardrail for this component.

register_llm_request_intercept
1def register_llm_request_intercept(name: str, priority: int, break_chain: bool, callback: LlmRequestIntercept) -> None

Register an LLM request intercept for this component.

register_llm_execution_intercept
1def register_llm_execution_intercept(name: str, priority: int, callback: LlmExecutionIntercept) -> None

Register an LLM execution intercept for this component.

register_llm_stream_execution_intercept
1def register_llm_stream_execution_intercept(name: str, priority: int, callback: LlmStreamExecutionIntercept) -> None

Register an LLM streaming execution intercept for this component.

register_tool_request_intercept
1def register_tool_request_intercept(name: str, priority: int, break_chain: bool, callback: ToolRequestIntercept) -> None

Register a tool request intercept for this component.

register_tool_execution_intercept
1def register_tool_execution_intercept(name: str, priority: int, callback: ToolExecutionIntercept) -> None

Register a tool execution intercept for this component.

Plugin(Protocol)

Custom plugin callback contract.

Methods

validate
1def validate(plugin_config: JsonObject) -> list[ConfigDiagnostic] | None

Validate one component-local config object.

register
1def register(plugin_config: JsonObject, context: PluginContext) -> None

Install middleware and subscribers for one component instance.

ConfigPolicy

Policy for unsupported plugin configuration.

Methods

ConfigPolicy
1def ConfigPolicy(unknown_component: UnsupportedBehavior = 'warn', unknown_field: UnsupportedBehavior = 'warn', unsupported_value: UnsupportedBehavior = 'error') -> None

Create an instance.

to_dict
1def to_dict() -> JsonObject

Serialize this policy to the canonical JSON object shape.

ComponentSpec

One top-level custom plugin component.

Methods

ComponentSpec
1def ComponentSpec(kind: str, enabled: bool = True, config: JsonObject = ...) -> None

Create an instance.

to_dict
1def to_dict() -> JsonObject

Serialize this component to the canonical JSON object shape.

PluginConfig

Canonical plugin configuration document.

Methods

PluginConfig
1def PluginConfig(version: int = 1, components: list[object] = ..., policy: ConfigPolicy = ...) -> None

Create an instance.

to_dict
1def to_dict() -> JsonObject

Serialize this config to the canonical JSON document shape.

Functions

validate

1def validate(config: PluginConfig | JsonObject) -> ConfigReport

Validate a plugin configuration without changing runtime state.

initialize

1async def initialize(config: PluginConfig | JsonObject) -> ConfigReport

Validate and activate a plugin configuration.

clear

1def clear() -> None

Clear the active plugin configuration.

plugin

1def plugin(config: PluginConfig | JsonObject) -> AsyncContextManager[ConfigReport]

Context manager for plugin initialization and cleanup.

report

1def report() -> ConfigReport | None

Return the last successful plugin report.

list_kinds

1def list_kinds() -> list[str]

List registered custom plugin kinds.

register

1def register(plugin_kind: str, plugin: Plugin) -> None

Register a custom plugin implementation.

deregister

1def deregister(plugin_kind: str) -> bool

Deregister a custom plugin kind.

Type Aliases And Constants

  • UnsupportedBehavior