-
Notifications
You must be signed in to change notification settings - Fork 550
feat(tool-rails): add support for tool output rails and validation #1382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
df75862
to
56cb9dd
Compare
49b63a8
to
a50901b
Compare
56cb9dd
to
44a25f3
Compare
a0c0e24
to
d256fe3
Compare
44a25f3
to
c8a4959
Compare
3ac1414
to
1e2f0eb
Compare
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.
c8a4959
to
e17edb2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…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.
…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.
…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.
…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.
…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.
…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.
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