Repository navigation
feat(nemo-guardrails): add NeMo Guardrails plugin 0.1.0 for Relay 0.11 - #17
Open
tgasser-nv wants to merge 3 commits into
Open
tgasser-nv wants to merge 3 commits into
tgasser-nv wants to merge 3 commits into
Conversation
…11 upgrade; format smoke test Signed-off-by: tgasser-nv <200644301+tgasser-nv@users.noreply.github.com>
tgasser-nv
marked this pull request as ready for review
November 9, 2026 21:18
…n develop-branch SHA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add the NeMo Guardrails plugin 0.1.0, a native Relay plugin that checks each tool call with a NeMo Guardrails service before the call runs. The service holds the rails and decides each call: Relay runs an allowed call, blocks a denied call with the service's reason, and reports an error when the check fails.
Register nemo-guardrails-plugin as a remote source for the crates/nemo-guardrails-relay-plugin crate. Track NeMo Guardrails' develop branch and pin commit 537fd774298260261bc4ee15e78d861b9e5814e5, which includes the plugin's CI (NVIDIA-NeMo/Guardrails#2536) and its move to the Relay 0.11 SDK (NVIDIA-NeMo/Guardrails#2538). The plugin sets runtime compatibility to >=0.11.0-rc.1, <1.0; select the published Relay 0.11.0 CLI for tests. Packaging uses the upstream bundle script, which copies the NeMo Guardrails license files, then adds Rust dependency attributions and third-party notices.
The smoke test installs the bundle once, with a local server standing in for the NeMo Guardrails service. It sends Claude Code PreToolUse hooks through nemo-relay hook-forward claude for three results: a denied call, an allowed call, and a failed check (HTTP 500 rail_failed). Each call must reach the server exactly once and return the expected exit code and message.
Extend the shared smoke harness for hook tests, without plugin-specific behavior:
installed_relay_gateway yields the gateway URL with a Relay command runner that shares the gateway's settings, environment, and credentials. Relay 0.11 hook clients need the gateway's client credential and TLS tunnel. installed_gateway wraps the new helper, so Switchyard's smoke test is unchanged.
json_http_fixture accepts a status, and callers can change its response between requests.
Wait until the gateway answers HTTP, not only until it accepts a TCP connection. Relay binds its port before it activates plugins, and hook clients treat a gateway that takes over 500 ms to answer /healthz as an unrelated service.
Update the plugin catalog, documentation, notices, and target counts, and regenerate the Rust attributions. The attributions add 99 entries and leave existing entries unchanged. Git's default diff misaligns repeated license texts; git diff --histogram main -- ATTRIBUTIONS-Rust.md shows 14,730 added lines and no removed lines.
Test Plan
NOTE: The current PR builds the
v0.25.0tag from the NeMo Guardrails repo. For this reason, CI will be red until the new Guardrails release is tagged. The results below were from a specific SHA on thedevelopbranch.Validate plugins
Unit-tests
Plugin build test (MacOS laptop)