Skip to content

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

Description

@MuneezaAzmat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststatus: needs triageNew issues that have not yet been reviewed or categorized.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions