Skip to content

fix(v2): clear output_rails_in_progress after output-rail abort - #2208

Draft
MuneezaAzmat wants to merge 1 commit into
NVIDIA-NeMo:developfrom
MuneezaAzmat:fix/2067-output-rails-abort-flag
Draft

fix(v2): clear output_rails_in_progress after output-rail abort#2208
MuneezaAzmat wants to merge 1 commit into
NVIDIA-NeMo:developfrom
MuneezaAzmat:fix/2067-output-rails-abort-flag

Conversation

@MuneezaAzmat

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Colang v2 $output_rails_in_progress staying True after an output rail abort, which caused later turns in the same session to skip output rails (bug(v2): output rails silently stop firing after first abort in multi-turn conversations. #2067).
  • Updates run output rails in guardrails.co to use when/else: clear the flag on both success and failure, then re-abort on failure so blocked bot text is still not uttered.
  • Adds a multi-turn regression test plus a pass-through case that confirms the success path still clears the flag.

Approach

Per maintainer guidance on #2067: reset the flag whether the rail passes or aborts, while still preventing rejected output from being sent. Nested bot say from inside rails remains protected while the flag is set.

Test plan

Fixes #2067

Made with Cursor

When an output rail aborted, run output rails never cleared the
reentrancy flag, so later turns in the same session skipped output
rails. Catch success and failure with when/else, reset the flag on
both paths, and re-abort on failure so blocked text is still withheld.

Fixes NVIDIA-NeMo#2067

Signed-off-by: Muneeza Azmat <muneezaazmat@utexas.edu>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added status: needs triage New issues that have not yet been reviewed or categorized. size: M labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M status: needs triage New issues that have not yet been reviewed or categorized.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(v2): output rails silently stop firing after first abort in multi-turn conversations.

1 participant