NVIDIA-NeMo / NVIDIA-NeMo/Guardrails

feature: add human-in-the-loop approval rail for Colang v2 output rails

Open
#2,121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement status: needs triage
Dominant language
Python
Stars
7.2k
Forks
842
Avg merge
3d 1h
Merged PRs (30d)
25

Description

Did you check the docs?
  • I have read all the NeMo-Guardrails docs
Is your feature request related to a problem? Please describe.

NeMo Guardrails has strong automated input/output rails, but there is no built-in library rail for human-in-the-loop (HITL) approval when bot output matches sensitive patterns (e.g. destructive SQL, shell commands). Teams building agentic or tool-using apps often need a reviewer to approve or reject specific bot responses before they are released to the user.

Describe the solution you'd like

Add a new library rail under nemoguardrails/library/human_approval/ for Colang v2 output rails:

  • Configurable regex patterns that trigger approval when matched in bot output
  • Configurable approval_keywords (e.g. approve, yes)
  • Customizable approval_message / rejection_message
  • Colang flow human approval on bot output $output_text that:
    - Checks output against patterns
    - Prompts the human if matched
    - Releases original output on approval, or aborts with rejection message on deny
  • HumanApprovalConfig on RailsConfigData
  • Example config at examples/configs/human_approval_v2/
  • Unit tests + Colang v2 integration tests
summary

Add a Colang v2 output rail library module with regex pattern matching on bot output, an interactive approve/reject flow using configured keywords, and HumanApprovalConfig on RailsConfigData. Wire via standard output rails (import guardrails + flow output rails).

Describe alternatives you've considered
  • Tool output rails: Custom tool output rails are not wired in the v2 passthrough/dialog path (guardrails.co only hooks input/output text rails). This proposal uses output rails to gate bot text before release.
Additional context

I have a working branch (feat/human-approval-rail) on my fork with:

  • HumanApprovalCheckAction / HumanApprovalMatchesKeywordsAction
  • 17 unit tests + 2 v2 integration tests (approve / reject paths)
  • Example wiring via import guardrails + custom flow output rails

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed library path nemoguardrails/library/human_approval/, RailsConfigData, the example at examples/configs/human_approval_v2/, and standard output-rail wiring. Compare the working feat/human-approval-rail branch and its 17 unit tests plus two Colang v2 integration tests with the listed requirements. Done means the configuration, approval and rejection flow, example, and tests cover the stated behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, backend-api-design, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.