feat(guardrails): add NeMo Provider#285
Open
christinaexyou wants to merge 2 commits into
Open
Conversation
|
Missing Signed-off-by: 25b82fc. All commits require sign-off (via |
25b82fc to
3803297
Compare
|
Unsigned commits: 3803297. Please sign your commits. |
05bb6a1 to
97f4123
Compare
aslakknutsen
requested changes
Jul 6, 2026
praxis-bot
reviewed
Jul 7, 2026
praxis-bot
left a comment
Collaborator
There was a problem hiding this comment.
NeMo Provider Review
Solid implementation of the NeMo guardrails provider with correct request-side integration, good error handling structure, and functional integration tests covering all three verdict paths plus provider-down scenarios.
Findings
| # | Severity | File | Summary |
|---|---|---|---|
| 1 | Large | nemo.rs |
Content-Length size check bypassed for chunked responses |
| 2 | Large | nemo.rs |
No unit tests for map_nemo_response or blocked_rail_names |
| 3 | Large | filter.rs |
No unit tests for extract_messages |
| 4 | Large | tests.rs |
Only happy-path on_request_body test; no block/redact/error path tests |
| 5 | Medium | nemo.rs |
Short-form separator comment |
| 6 | Medium | filter.rs |
Short-form separator comment |
Non-inline findings
[Medium] filters/src/guardrails/filter.rs and examples/configs/nemo-guardrails.yaml are both missing POSIX trailing newlines (\ No newline at end of file in the diff). Add a final newline to each.
| /// | ||
| /// Returns [`FilterError`] if the body is not valid JSON or does not | ||
| /// contain a recognizable messages field. | ||
| fn extract_messages(body: &Bytes) -> Result<Vec<serde_json::Value>, FilterError> { |
Collaborator
There was a problem hiding this comment.
[Large] extract_messages has no unit tests. Add tests for:
- Valid body with
"messages"array (happy path) - Invalid JSON (verify error message)
- Valid JSON without a
"messages"key "messages"present but not an array (e.g. a string)- Empty
"messages"array (should succeed, returns empty vec)
97f4123 to
c923966
Compare
Signed-off-by: Christina Xu <chrxu@redhat.com>
1509095 to
55c5f0b
Compare
55c5f0b to
5a1ad8b
Compare
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.
Refactor of praxis-proxy/praxis#700
Implements the NeMo provider for the ai_guardrails filter, completing request-side evaluation against NeMo Guardrails. Addresses #48.
The following changes were made:
providers/nemo.rsfilter.rs