Guardrails: migrate guardrails to the v1/checks endpoint - #1161
Conversation
6d04d43 to
18b9204
Compare
praxis-bot
left a comment
There was a problem hiding this comment.
PR Review
Migrates the NeMo guardrails provider from /v1/guardrail/checks to /v1/checks, parsing the new response shape and issuing cumulative per-message evaluations.
Assessment
Clean migration with solid test coverage for the new response mapping and cumulative evaluation logic. Two findings.
| Severity | Count |
|---|---|
| Large | 1 |
| Medium | 1 |
leseb
left a comment
There was a problem hiding this comment.
P1 – modified short-circuits evaluation. A modified earlier message causes later blocked messages to go unchecked and pass through.
P1 – wrong NeMo rail direction. Mixed user/assistant history auto-runs both rail types; request-phase modifications can be reported as passed. Send phase-specific rail_types.
P1 – unbounded callout amplification. One request can trigger arbitrarily many sequential NeMo calls, each with its own timeout. Add a call limit or overall deadline.
10a2db9 to
ef1bb3b
Compare
Addressed - modified no longer short-circuits the loop; only blocked fails fast. See apply_slice_result.
Addressed - we now send explicit rail_types (["input"] for request phase, ["output"] for response phase) to prevent NeMo from auto-running both rail families on mixed-role slices.
Addressed - same max_message_checks limit as item 1. |
ef1bb3b to
f9c80bf
Compare
|
P1: timeout_ms restarts for each of up to 32 sequential calls, permitting roughly 320 seconds total by default. Use one overall evaluation deadline. |
f9c80bf to
c619c09
Compare
Done. |
c619c09 to
a94d2ee
Compare
|
@liavweiss lint is failing |
Signed-off-by: Liav Weiss <lweiss@redhat.com>
Head branch was pushed to by a user without write access
a94d2ee to
26a6a9a
Compare
Summary
ai_guardrailsNeMo provider from/v1/guardrail/checksto/v1/checkspassed/blocked/modified+content+rail)"error"status)Breaking change
NeMo
endpointURLs in proxy config must use/v1/checksinstead of/v1/guardrail/checks.Out of scope
modified/contentredaction to request/response bodies (follow-up: ai_guardrails: NeMo mask / redact action #49)Test plan
cargo test -p praxis-ai-filters guardrails(70 tests)cargo test -p praxis-tests-integration guardrails(35 tests)close: #1044