Output guardrail enhancements - #2971
Open
manamittal wants to merge 9 commits into
Open
manamittal wants to merge 9 commits into
manamittal wants to merge 9 commits into
Conversation
added 8 commits
August 27, 2026 13:28
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
manamittal
marked this pull request as ready for review
September 4, 2026 15:41
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
Two additions to guardrail block handling: graceful logout, and letting an output guardrail answer in the model's place.
Needs to be merged in with semoss-ui change https://github.com/SEMOSS/semoss-ui/tree/logout-guardrails
Changes Made
logoutOnBlock — new guardrail config flag on both the input and output reactors, carried through as PipelineReactorUtils.LOGOUT_USER. On a block, PipelineInvocationHandler.logoutIfRequested calls the new User.markPendingRevocation("GUARDRAIL"), which flags the session without clearing loggedInProfiles/accessTokens — so the current request still finishes and carries the block back. The error is tagged with a new PixelOperationType.USER_LOGGED_OUT_ERROR (registered in PixelRunner's errorOpTypes) for the client to show a dialog and then call /api/auth/logout/all itself. Any later engine call from a flagged session is refused up front at the top of invoke. Anonymous users and unresolvable sessions no-op, and the helper returns whether a session was actually revoked so the audit action is accurate.
respondWithGuardrailMessage — on the output side, a failing guardrail can now return its own returnPrompt as an AskStringModelEngineResponse instead of throwing, mirroring the input side's existing canned-response path. It suppresses LOGOUT_USER, and on non-AskModelEngineResponse return types it falls back to the normal block/throw.
Logging — resolveUser picks the user off a Room arg, then an Insight arg, then ThreadStore. The GUARDRAIL_ACTION column gains BLOCK_LOGOUT, and the output path now records RESPOND (it previously only ever logged MASK/BLOCK).
How to Test
Notes