Skip to content

Conversation

Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Sep 9, 2025

Introduce tool output/input rails configuration and Colang flows for tool call validation and parameter security checks. Add support for BotToolCall event emission in passthrough mode, enabling tool call guardrails before execution.

must be merged after #1370 #1369 #1366

@Pouyanpi Pouyanpi added this to the v0.17.0 milestone Sep 9, 2025
@Pouyanpi Pouyanpi self-assigned this Sep 9, 2025
@Pouyanpi Pouyanpi added the enhancement New feature or request label Sep 9, 2025
@Pouyanpi Pouyanpi requested a review from Copilot September 9, 2025 10:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for tool output/input rails configuration and Colang flows for tool call validation and parameter security checks. It also enables BotToolCall event emission in passthrough mode, allowing tool call guardrails to be executed before tool execution.

  • Adds ToolOutputRails and ToolInputRails configuration classes with flows support
  • Implements tool output rails flows execution in the Colang runtime
  • Creates BotToolCall events when tool_calls are detected in passthrough mode, bypassing output rails

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_tool_output_rails.py Test suite for tool output rails functionality with validation flows
tests/test_tool_calls_event_extraction.py Tests for tool_calls preservation and event-based extraction
tests/test_tool_calling_passthrough_only.py Tests verifying tool calling only works in passthrough mode
tests/test_tool_calling_passthrough_integration.py Integration tests for passthrough mode tool calling
tests/test_output_rails_tool_calls.py Tests verifying output rails are bypassed for tool calls
tests/test_bot_tool_call_events.py Tests for BotToolCall event handling
tests/runnable_rails/test_tool_calling.py RunnableRails integration tests for tool calling
nemoguardrails/rails/llm/options.py Added tool_output and tool_input options to GenerationRailsOptions
nemoguardrails/rails/llm/llmrails.py Modified to use extract_tool_calls_from_events instead of contextvar
nemoguardrails/rails/llm/llm_flows.co Added tool output rails flow processing
nemoguardrails/rails/llm/config.py Added ToolOutputRails and ToolInputRails configuration classes
nemoguardrails/actions/llm/utils.py Added extract_tool_calls_from_events function
nemoguardrails/actions/llm/generation.py Modified to emit BotToolCall events in passthrough mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Pouyanpi Pouyanpi force-pushed the feat/tool-output-rails branch from df75862 to 56cb9dd Compare September 15, 2025 09:38
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch 2 times, most recently from 49b63a8 to a50901b Compare September 15, 2025 09:45
@Pouyanpi Pouyanpi force-pushed the feat/tool-output-rails branch from 56cb9dd to 44a25f3 Compare September 15, 2025 09:47
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch 2 times, most recently from a0c0e24 to d256fe3 Compare September 15, 2025 09:53
@Pouyanpi Pouyanpi force-pushed the feat/tool-output-rails branch from 44a25f3 to c8a4959 Compare September 15, 2025 09:54
@Pouyanpi Pouyanpi requested a review from tgasser-nv September 15, 2025 10:59
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch 2 times, most recently from 3ac1414 to 1e2f0eb Compare September 22, 2025 08:52
Base automatically changed from feat/runnable-rails-streaming-metadata to develop September 22, 2025 09:00
Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
@Pouyanpi Pouyanpi force-pushed the feat/tool-output-rails branch from c8a4959 to e17edb2 Compare September 22, 2025 09:03
@Pouyanpi Pouyanpi merged commit 3f44a73 into develop Sep 22, 2025
14 checks passed
@Pouyanpi Pouyanpi deleted the feat/tool-output-rails branch September 22, 2025 09:09
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

tgasser-nv pushed a commit that referenced this pull request Sep 22, 2025
…1382)

Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
tgasser-nv pushed a commit that referenced this pull request Sep 22, 2025
…1382)

Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
Pouyanpi added a commit that referenced this pull request Oct 1, 2025
…1382)

Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
tgasser-nv pushed a commit that referenced this pull request Oct 14, 2025
…1382)

Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
tgasser-nv pushed a commit that referenced this pull request Oct 14, 2025
…1382)

Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
tgasser-nv pushed a commit that referenced this pull request Oct 14, 2025
…1382)

Introduce tool output/input rails configuration and Colang flows for
tool call validation and parameter security checks. Add support for
BotToolCall event emission in passthrough mode, enabling tool call
guardrails before execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants