Skip to content

Add tool_call and tool_response rails to sensitive_data_detection library#57

Open
kpunwatk wants to merge 1 commit into
trustyai-explainability:developfrom
kpunwatk:add-sensitive-data-detection-tool-rails
Open

Add tool_call and tool_response rails to sensitive_data_detection library#57
kpunwatk wants to merge 1 commit into
trustyai-explainability:developfrom
kpunwatk:add-sensitive-data-detection-tool-rails

Conversation

@kpunwatk

@kpunwatk kpunwatk commented Jun 23, 2026

Copy link
Copy Markdown

This commit adds the missing rail types to ensure comprehensive coverage:

  • detect sensitive data on tool call
  • mask sensitive data on tool call
  • detect sensitive data on tool response
  • mask sensitive data on tool response

Changes:

  • Updated flows.co (Colang v2) with TOOL OUTPUT and TOOL INPUT rails
  • Updated flows.v1.co (Colang v1) with corresponding subflows
  • Fixed typo in flows.v1.co: RETRIVAL → RETRIEVAL
  • Modified actions.py to accept "tool_call" and "tool_response" sources
  • Tool call/response sources map to output options for validation

All flows now support the five standard rail types: ✅ input
✅ output
✅ retrieval
✅ tool_call (tool output)
✅ tool_response (tool input)

Description

Related Issue(s)

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

…rary

This commit adds the missing rail types to ensure comprehensive coverage:
- detect sensitive data on tool call
- mask sensitive data on tool call
- detect sensitive data on tool response
- mask sensitive data on tool response

Changes:
- Updated flows.co (Colang v2) with TOOL OUTPUT and TOOL INPUT rails
- Updated flows.v1.co (Colang v1) with corresponding subflows
- Fixed typo in flows.v1.co: RETRIVAL → RETRIEVAL
- Modified actions.py to accept "tool_call" and "tool_response" sources
- Tool call/response sources map to output options for validation

All flows now support the five standard rail types:
✅ input
✅ output
✅ retrieval
✅ tool_call (tool output)
✅ tool_response (tool input)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@kpunwatk kpunwatk changed the title Add tool_call and tool_response rails to sensitive_data_detection lib… Add tool_call and tool_response rails to sensitive_data_detection library Jun 23, 2026
sdd_config = config.rails.config.sensitive_data_detection
assert source in ["input", "output", "retrieval"]
options: SensitiveDataDetectionOptions = getattr(sdd_config, source)
assert source in ["input", "output", "retrieval", "tool_call", "tool_response"]
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@6a3cfd1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...drails/library/sensitive_data_detection/actions.py 0.00% 7 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #57   +/-   ##
==========================================
  Coverage           ?   79.79%           
==========================================
  Files              ?      236           
  Lines              ?    23873           
  Branches           ?        0           
==========================================
  Hits               ?    19050           
  Misses             ?     4823           
  Partials           ?        0           
Flag Coverage Δ
python 79.79% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...drails/library/sensitive_data_detection/actions.py 26.08% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants