بنقرة واحدة
add-middleware
Add a new guardrail or intercept type to the NeMo Relay middleware pipeline
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add a new guardrail or intercept type to the NeMo Relay middleware pipeline
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Compare NeMo Relay release branches and draft or update the documentation-site release notes. Use when preparing a release-notes update under docs/about-nemo-relay/release-notes, reviewing release-to-release changes, or gathering evidence for a current release summary.
Contribute documentation or example changes that stay aligned with NeMo Relay public behavior
Build and package reusable NeMo Relay runtime behavior as a config-activated plugin with validation and rollback-safe registration
Add or change a public NeMo Relay API surface across the core runtime and every affected binding
Maintain or extend NeMo Relay observability surfaces across ATIF, OpenTelemetry, and OpenInference
Maintain or extend the NeMo Relay adaptive surface across config, plugins, docs, and bindings; use this when users still say optimizer
| name | add-middleware |
| description | Add a new guardrail or intercept type to the NeMo Relay middleware pipeline |
| author | NVIDIA Corporation and Affiliates |
| license | Apache-2.0 |
Use karpathy-guidelines alongside this skill for implementation or review
work. Keep changes scoped, surface assumptions, and define focused validation
before editing.
NeMo Relay supports guardrails (validate/gate) and intercepts (transform) at various pipeline stages. Adding a new middleware type requires changes across all layers.
Use this skill when introducing a new middleware registration surface or adding middleware behavior to a new pipeline stage.
Decide these before editing code:
event.input and event.output after this
middleware runs?See docs/about/concepts/middleware.md for the full diagrams.
crates/core/src/api/runtime/callbacks.rs.pub type MyNewFn = Box<dyn Fn(&str, Json) -> Json + Send + Sync>;
NemoRelayContextState in
crates/core/src/api/runtime/state.rs.Add a SortedRegistry<GuardrailEntry<MyNewFn>> or SortedRegistry<Intercept<MyNewFn>>
field to the state struct.
crates/core/src/api/.Use the existing global_*_registry_api! and scope_*_registry_api! macro
patterns in crates/core/src/api/registry.rs. Both global and scope-local
variants are needed unless the design explicitly rules one out.
NemoRelayContextState in
crates/core/src/api/runtime/state.rs.Follow the pattern of tool_sanitize_request_chain or tool_request_intercepts_chain.
Update crates/core/src/api/tool.rs or crates/core/src/api/llm.rs to call
the new chain method at the appropriate pipeline stage.
Follow the add-binding-feature skill for the cross-binding implementation checklist.
crates/core/src/api/tool.rs, crates/core/src/api/llm.rscrates/core/src/api/runtime/callbacks.rscrates/core/src/api/runtime/state.rscrates/core/src/context/registries.rscrates/core/src/registry.rsdocs/about/concepts/middleware.mddocs/about/architecture.mddocs/instrument-applications/advanced-guide.mdvalidate-change