Generated banner for Nemo Relay Instrument Context Isolation
Generated logo for Nemo Relay Instrument Context Isolation

Nemo Relay Instrument Context Isolation

NVIDIAOfficialCreated by NVIDIA Corporation and Affiliates

  • Skill
  • Guidelines
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Use this skill when concurrent requests, async tasks, threads, workers, goroutines, or agents need independent NeMo Relay scope stacks and correct ancestry propagation.
— the description by NVIDIA Corporation and Affiliates

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides essential patterns for managing scope-stack isolation within applications that utilize concurrent requests, asynchronous tasks, or multi-threaded execution. It emphasizes that each independent unit of work must maintain its own scope stack to prevent data leakage, incorrect event parentage, and cross-request middleware interference. The guidelines cover the conceptual model of scope hierarchies and provide language-specific implementation strategies for Python, Rust, Go, and Node.js to ensure proper ancestry propagation.

What it does

  • Defines rules for maintaining independent scope stacks in concurrent environments.
  • Explains the hierarchical nature of root and child scopes within NeMo Relay.
  • Provides language-specific implementation patterns for context propagation.
  • Identifies common failure modes like scope-local middleware leakage.
  • Outlines standard scope types for agents, tools, and LLM interactions.

When to use it

  • When implementing concurrent request handling in a single process.
  • When using worker pools, goroutines, or async tasks that require distinct telemetry.
  • When debugging issues where events from different requests appear under a single root UUID.
  • When scope-local middleware is incorrectly persisting across unrelated tasks.

Advantages

  • Prevents cross-contamination of scope-local middleware and state.
  • Ensures accurate event parentage and ancestry tracking in complex systems.
  • Provides clear guidance for language-specific context management.
  • Reduces debugging time for concurrency-related telemetry issues.

Usage examples

“How do I ensure my goroutines have independent scope stacks in NeMo Relay?”
The agent explains the use of NewScopeStack() and ScopeStack.Run() to ensure goroutine-safe execution and proper ancestry propagation.
“Why are my request events appearing under the same root UUID?”
The agent identifies that the application is likely sharing a mutable scope stack across concurrent requests and suggests implementing per-request stack isolation.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/nemo-relay-instrument-context-isolation/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip nemo-relay-instrument-context-isolation.zip -d .agents/skills

Documentation by NVIDIA Corporation and Affiliates

Use Context Isolation

Use this skill when an application runs concurrent requests, worker pools, async tasks, goroutines, or multiple agents in the same process. Treat scope-stack ownership as part of the request boundary.

Core Rule

Each independent request, agent, or workflow needs its own scope stack. Do not share one mutable stack across unrelated concurrent work unless you want shared ancestry and shared scope-local middleware.

Embedded Scope Model

  • A root scope is always present, and pushed scopes form a parent-child tree beneath it.

  • Scope hierarchy determines event parentage, lifetime boundaries, and visibility for scope-local middleware and subscribers.

  • Standard scope types include Agent, Function, Tool, Llm, Retriever, Embedder, Reranker, Guardrail, Evaluator, Custom, and Unknown.

  • Scope start and end events can carry semantic input and output payloads when the scope represents a request, task, or meaningful result boundary.

  • Scope-local registrations disappear when the owning scope closes; use them for behavior that should not outlive a request or agent run.

  • Mark events are useful for retries, checkpoints, interrupts, and important state transitions that are not full spans.

Per-Language Defaults

  • Python: rely on task-local behavior via get_scope_stack() and contextvars, or explicitly propagate when work leaves the current execution context

  • Rust core: use runtime helpers such as create_scope_stack(), current_scope_stack(), and set_thread_scope_stack(...) when an integration needs explicit stack ownership

  • Go: use NewScopeStack() and ScopeStack.Run(...) for goroutine-safe usage

  • Node.js: create and set a scope stack explicitly for the current execution path with createScopeStack() and setThreadScopeStack(...)

Common Failures

  • Events from different requests appear under one root UUID

  • Scope-local middleware leaks across requests

  • Worker-thread work runs without the expected active scope

  • Integrations activate NeMo Relay without an explicitly initialized stack

  • Relying on a thread-local stack after crossing async tasks, goroutines, or JS worker boundaries

  • nemo-relay-instrument-calls

  • nemo-relay-plugin-observability

  • nemo-relay-debug-runtime-integration

Files

BENCHMARK.md

Evaluation Report

Evaluation of the nemo-relay-instrument-context-isolation skill before publication through NVSkills-Eval.

This benchmark summarizes 3-Tier Evaluation from NVSkills-Eval results for the skill. The goal is to document whether the skill is safe, discoverable, effective, and useful for agents before it is published for broader workflow use.

Evaluation Summary

  • Skill: nemo-relay-instrument-context-isolation

  • Evaluation date: 2026-07-15

  • NVSkills-Eval profile: external

  • Environment: astra-sandbox

  • Dataset: 4 evaluation tasks

  • Attempts per task: 1

  • Pass threshold: 50%

  • Overall verdict: PASS

Agents Used

  • claude-code

  • codex

Metrics Used

Reported benchmark dimensions:

  • Security: checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access.

  • Correctness: checks whether the agent follows the expected workflow and produces the correct final output.

  • Discoverability: checks whether the agent loads the skill when relevant and avoids using it when irrelevant.

  • Effectiveness: checks whether the agent performs measurably better with the skill than without it.

  • Efficiency: checks whether the agent uses fewer tokens and avoids redundant work.

Underlying evaluation signals used in this run:

  • security (Security): checks for unsafe operations, secret leakage, and unauthorized access.

  • skill_execution (Skill Execution): verifies that the agent loaded the expected skill and workflow.

  • skill_efficiency (Efficiency): checks routing quality, decoy avoidance, and redundant tool usage.

  • accuracy (Accuracy): grades final-answer correctness against the reference answer.

  • goal_accuracy (Goal Accuracy): checks whether the overall user task completed successfully.

  • behavior_check (Behavior Check): verifies expected behavior steps, including safety expectations.

  • token_efficiency (Token Efficiency): compares token usage with and without the skill.

Test Tasks

The benchmark dataset contained 4 evaluation tasks:

  • Positive tasks: 3 tasks where the skill was expected to activate.

  • Negative tasks: 1 tasks where no skill was expected.

  • Unlabeled tasks: 0 tasks where positive/negative intent could not be inferred.

Task composition is derived from the evaluation dataset when possible. Entries with expected_skill set are treated as positive skill-activation cases, while entries with expected_skill: null are treated as negative activation cases.

Results

DimensionNumclaude-codecodex
Security4100% (+0%)100% (+0%)
Correctness4100% (+65%)91% (+23%)
Discoverability4100% (+75%)84% (+31%)
Effectiveness4100% (+52%)98% (+34%)
Efficiency495% (+51%)82% (+26%)

Score values show skill-assisted performance. Values in parentheses show uplift versus the no-skill baseline when baseline data is available.

Tier 1: Static Validation Summary

Tier 1 validation passed with observations. NVSkills-Eval ran 1 checks and found 3 total findings.

Top findings:

  • MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Instructions' (skills/nemo-relay-instrument-context-isolation/SKILL.md)

  • MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Examples' (skills/nemo-relay-instrument-context-isolation/SKILL.md)

  • LOW SCHEMA/author_format: Author must be of the form 'Name <email@host>' (skills/nemo-relay-instrument-context-isolation/SKILL.md)

Tier 2: Deduplication Summary

This tier was not run or did not produce findings in this report.

Publication Recommendation

The skill is suitable to proceed toward NVSkills-Eval publication based on this benchmark. Skill owners should keep this file with the skill and refresh it when the evaluation dataset, skill behavior, or target agents materially change.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA Corporation and Affiliates
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/nemo-relay-instrument-context-isolation · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA Corporation and Affiliates or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nemo-relay-instrument-context-isolation.zip