Skip to content

fix(guardrails): update jailbreak-detect model deployment to match ne… - #287

Merged
albcui merged 4 commits into
mainfrom
albcui/fix-jailbreak-detect-integration-with-models
Jun 12, 2026
Merged

fix(guardrails): update jailbreak-detect model deployment to match ne…#287
albcui merged 4 commits into
mainfrom
albcui/fix-jailbreak-detect-integration-with-models

Conversation

@albcui

@albcui albcui commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

…w schema

Summary by CodeRabbit

  • Documentation
    • Streamlined jailbreak detection deployment with inline commands, Docker notes, and a full end-to-end integration walkthrough (guardrails, inference gateway, middleware, and example validations)
  • Bug Fixes
    • Model discovery now reports model ownership consistent with the configured model identifier
  • Tests
    • Added tests covering model-id resolution and the model discovery response

@albcui
albcui requested review from JashG and benmccown June 11, 2026 21:06
@github-actions github-actions Bot added the fix label Jun 11, 2026
@albcui
albcui marked this pull request as ready for review June 11, 2026 21:15
@albcui
albcui requested review from a team as code owners June 11, 2026 21:15
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 19033/25227 75.4% 61.3%
Integration Tests 11028/23999 46.0% 20.4%

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ca165445-b84f-4882-b308-87ab2c57efcb

📥 Commits

Reviewing files that changed from the base of the PR and between 08696a1 and fef9209.

📒 Files selected for processing (3)
  • services/jailbreak-detect/README.md
  • services/jailbreak-detect/model/server.py
  • services/jailbreak-detect/tests/test_server.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/jailbreak-detect/README.md

📝 Walkthrough

Walkthrough

Server model discovery now resolves MODEL_ID from env vars and derives owned_by from that namespace; tests cover resolver and /v1/models output. README replaces the file-based deployment config with an inline nemo CLI command and expands IGW + guardrails end-to-end wiring and testing steps.

Changes

Jailbreak Detect Combined Changes

Layer / File(s) Summary
Server: model-id resolution and /v1/models owned_by
services/jailbreak-detect/model/server.py
Adds _resolve_model_id() and sets MODEL_ID from JAILBREAK_MODEL_IDNIM_SERVED_MODEL_NAME → fallback; /v1/models derives owned_by from the resolved namespace.
Tests: model-id resolver and /v1/models assertions
services/jailbreak-detect/tests/test_server.py
Adds tests for default resolver behavior, precedence of JAILBREAK_MODEL_ID, fallback to NIM_SERVED_MODEL_NAME, and that /v1/models returns id and owned_by matching the MODEL_ID namespace.
README: inline deployment CLI and IGW/guardrails walkthrough
services/jailbreak-detect/README.md
Replaces deploy/deployment-config.json usage with an inline nemo inference deployment-configs create command, documents Docker daemon/colima guidance, shows IGW provider passthrough vs gateway model post calls, provides nemo guardrail configs create wiring to IGW, and adds end-to-end chat VirtualModel wiring and test commands demonstrating content_filter short-circuiting.

Sequence Diagram(s)

Possibly related PRs

  • NVIDIA-NeMo/nemo-platform#134: Prior changes to the jailbreak-detect server’s model-discovery behavior and /v1/models response that relate to MODEL_ID/owned_by logic.

Suggested reviewers

  • JashG
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive Title is truncated and incomplete; the full intent (new schema details) is cut off at 70 characters. Complete the title to clarify what 'new schema' refers to, or rephrase to fit the character limit while preserving clarity.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch albcui/fix-jailbreak-detect-integration-with-models

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
services/jailbreak-detect/README.md (1)

6-266: 🏗️ Heavy lift

Split this README into one Diataxis quadrant.

It mixes explanation, how-to, and reference content, and it still lacks the required prerequisites-at-top / Next Steps framing. Keep this page as a short entry point with cross-links, and move the walkthroughs into separate docs. As per coding guidelines, each documentation page should fit ONE Diataxis quadrant, list prerequisites first, and include a Next Steps section at the end.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@services/jailbreak-detect/README.md` around lines 6 - 266, README.md
currently mixes Diataxis quadrants; split it into a short entrypoint README
(keep the top-level description, HTTP contract, prerequisites-first, and add a
"Next Steps" with cross-links) and move procedural/how-to content into separate
focused docs (e.g., a "Local development (uv)" quickstart, "Build the image" &
"Deploy via Models + Inference Gateway" how-to, "Wire it end-to-end with a chat
model" walkthrough, and an "Evaluating the model" / "Tests" reference), update
links in the entry README to point to those new pages, and ensure references to
model/server.py and scripts/eval.py remain accurate (mention they live in the
repo) so readers can find the runnable examples.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@services/jailbreak-detect/README.md`:
- Around line 6-266: README.md currently mixes Diataxis quadrants; split it into
a short entrypoint README (keep the top-level description, HTTP contract,
prerequisites-first, and add a "Next Steps" with cross-links) and move
procedural/how-to content into separate focused docs (e.g., a "Local development
(uv)" quickstart, "Build the image" & "Deploy via Models + Inference Gateway"
how-to, "Wire it end-to-end with a chat model" walkthrough, and an "Evaluating
the model" / "Tests" reference), update links in the entry README to point to
those new pages, and ensure references to model/server.py and scripts/eval.py
remain accurate (mention they live in the repo) so readers can find the runnable
examples.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5e271197-d504-4f02-9647-8cd4ba3b189e

📥 Commits

Reviewing files that changed from the base of the PR and between 53b6c8b and 08696a1.

📒 Files selected for processing (2)
  • services/jailbreak-detect/README.md
  • services/jailbreak-detect/deploy/deployment-config.json
💤 Files with no reviewable changes (1)
  • services/jailbreak-detect/deploy/deployment-config.json

albcui added 3 commits June 12, 2026 12:34
…w schema

Signed-off-by: Albert Cui <albcui@nvidia.com>
Signed-off-by: Albert Cui <albcui@nvidia.com>
Signed-off-by: Albert Cui <albcui@nvidia.com>
@albcui
albcui force-pushed the albcui/fix-jailbreak-detect-integration-with-models branch from fef9209 to 70ece41 Compare June 12, 2026 16:34
Signed-off-by: Albert Cui <albcui@nvidia.com>
@albcui
albcui added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit 34a46f2 Jun 12, 2026
46 of 47 checks passed
@albcui
albcui deleted the albcui/fix-jailbreak-detect-integration-with-models branch June 12, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants