Nemo Relay Instrument Context Isolation
NVIDIAOfficialCreated by NVIDIA Corporation and Affiliates
- Skill
- Guidelines
- Software development
- Apache-2.0
- Medium risk
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
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/nemo-relay-instrument-context-isolation/downloadUnzip 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, andUnknown.Scope start and end events can carry semantic
inputandoutputpayloads 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()andcontextvars, or explicitly propagate when work leaves the current execution contextRust core: use runtime helpers such as
create_scope_stack(),current_scope_stack(), andset_thread_scope_stack(...)when an integration needs explicit stack ownershipGo: use
NewScopeStack()andScopeStack.Run(...)for goroutine-safe usageNode.js: create and set a scope stack explicitly for the current execution path with
createScopeStack()andsetThreadScopeStack(...)
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
Related Skills
nemo-relay-instrument-callsnemo-relay-plugin-observabilitynemo-relay-debug-runtime-integration
Files
- ATTRIBUTION.mdAdded by AutoGineer1002 B
- BENCHMARK.md3.8 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md2.6 KiB
- evals/evals.json5.0 KiB
- skill-card.md3.9 KiB
- skill.oms.sig4.5 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "nemo-relay-instrument-context-isolation", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: fce3cca4170be75e82c64920654d56ee2811b005
Created by: NVIDIA Corporation and Affiliates (https://github.com/NVIDIA/skills/tree/fce3cca4170be75e82c64920654d56ee2811b005/skills/nemo-relay-instrument-context-isolation)
Publisher: NVIDIA (https://github.com/NVIDIA)
Licence: Apache License 2.0 (https://spdx.org/licenses/Apache-2.0.html)
Licence evidence: declared in the frontmatter ("license: Apache-2.0")
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE-APACHE
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