NeMo-Relay: Skill for Claude Code

.agents/skills/add-middleware/SKILL.md

add-middleware is a skill for Claude Code, Codex from NVIDIA/NeMo-Relay. It costs 38 tokens per session (1,112 once invoked), scanned A, original, Apache-2.0.

A guide for adding a new guard or interception point to the NeMo Relay middleware pipeline. Middleware is code that checks or changes data as it moves through a program.

In plain words
What is it for?
Use it when adding middleware for tools, language-model calls, scope events, requests, stream chunks, or final responses.
Why use it?
Adding middleware affects several parts of the system, so the guide makes behavior, registration, errors, events, and execution stages explicit before coding.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is NVIDIA/NeMo-Relay's own configuration. It tells Claude Code and Codex how to work on NeMo-Relay itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything NeMo-Relay configures →

About the project

NVIDIA/NeMo-Relay is a runtime and library that gives coding agents and applications shared control over agent execution scopes, policies, plugins, lifecycle events, and observability data. It is for developers who need to inspect or instrument runs from agents such as Codex or Claude Code, or integrate frameworks and export traces and trajectories. The catalogue entries provide Relay plugins, hooks, instructions, skills, and an MCP server for those workflows.

NVIDIA/NeMo-Relay · 212 stars · on GitHub · docs.nvidia.com

Reuse

Borrowing it

Nothing to install: this file belongs to NVIDIA/NeMo-Relay. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/NVIDIA/NeMo-Relay/main/.agents/skills/add-middleware/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/NeMo-Relay

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-middleware

README.md
[![agentmods](https://agentmods.dev/badge/skills/nvidia/nemo-relay/add-middleware/github.svg)](https://agentmods.dev/skills/nvidia/nemo-relay/add-middleware)
Your own site
<a href="https://agentmods.dev/skills/nvidia/nemo-relay/add-middleware"><img src="https://agentmods.dev/badge/skills/nvidia/nemo-relay/add-middleware/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-middleware

Your own site · 80×15
<a href="https://agentmods.dev/skills/nvidia/nemo-relay/add-middleware"><img src="https://agentmods.dev/badge/skills/nvidia/nemo-relay/add-middleware.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,112 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01112
Opus 5.5 $0.00015 $0.00445
Sonnet 5.5 $0.00008 $0.00222
Haiku 4.5 $0.00004 $0.00111

Measured 1mo ago against content hash ce6cc9f87cc4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-middleware scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/add-middleware/SKILL.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add a Middleware Type

NeMo Relay supports guardrails (validate/gate) and intercepts (transform) at various pipeline stages. Adding a new middleware type requires checking every layer that exposes the new contract.

Use this skill when introducing a new middleware registration surface or adding middleware behavior to a new pipeline stage.

Lock The Design First

Decide these before editing code:

  • Is this for tools, LLMs, marks, scope events, or a combination?
  • Is it a conditional guardrail, sanitize guardrail, request intercept, or execution intercept?
  • Does it run on request input, inner callable execution, stream chunks, or final response output?
  • Is the callback fallible, and how should callback failures propagate?
  • Does it need both global and scope-local registration?
  • What should subscribers and exporters observe in the event payload after this middleware runs?
  • If this is an event sanitizer, which of data, category_profile, and metadata can change, and is the event used only as immutable context?

Pipeline Order

Refer to docs/about-nemo-relay/concepts/middleware.mdx for the full diagrams.

  • Tool execute: conditional guardrails -> request intercepts -> sanitize request (for events) | execution intercept chain(callable) -> sanitize response
  • LLM execute: conditional guardrails -> request intercepts -> sanitize request (for events) | execution intercept chain(callable) -> sanitize response
  • Mark and scope events: specialized tool or LLM sanitizer (when applicable) -> mark or scope event sanitizer -> subscriber and exporter dispatch

Tool execution callbacks and each execution-intercept next continuation return the canonical ToolExecutionResult { result, annotation }. A forwarding intercept must preserve both fields in ToolExecutionInterceptOutcome; Relay retains pending_marks separately. Tool sanitize-response guardrails receive only result. Scope-end event sanitizers govern the annotation after Relay projects it to category_profile.tool_result_annotation.

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -5 lines · +19 tokens per session ce6cc9f87cc4
  2. 1mo ago First seen · 122 lines · 19 tokens per session scan A eaa57234ebde

Subscribe to this mod's changes

add-middleware is a skill published in the GitHub repository NVIDIA/NeMo-Relay (212 stars, last pushed today), licensed Apache-2.0. It adds 38 tokens to every session and 1,112 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

python-sdk

Implement or modify Python SDK behavior under python/composio, including tools, toolkits, sessions, auth configs, connected accounts, client integration, and shared Python models. Use for Python core runtime/API work; pair with python-testing and cross-sdk-parity when TypeScript must match.

ComposioHQ/composio · 60 tokens

azure-eventhub-dotnet

Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming"…

microsoft/skills · 94 tokens

azure-search-documents-dotnet

Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search applications with full-text, vector, semantic, and hybrid search. Covers SearchClient (queries, document CRUD), SearchIndexClient (index management), and SearchIndexerClient (indexers, skillsets). Triggers: "Azure Search .NET"…

microsoft/skills · 102 tokens

azure-mgmt-botservice-py

Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring Azure Bot Service resources. Triggers: "azure-mgmt-botservice", "AzureBotService", "bot management", "conversational AI", "bot channels".

microsoft/skills · 59 tokens

azure-communication-common-java

Azure Communication Services common utilities for Java. Use when working with CommunicationTokenCredential, user identifiers, token refresh, or shared authentication across ACS services.

microsoft/skills · 35 tokens

azure-messaging-webpubsubservice-py

Azure Web PubSub Service SDK for Python. Use for real-time messaging, WebSocket connections, and pub/sub patterns. Triggers: "azure-messaging-webpubsubservice", "WebPubSubServiceClient", "real-time", "WebSocket", "pub/sub".

microsoft/skills · 64 tokens