close
Skip to content

feat(bridges): show tool input and output in channel safely (#803) #FliptheSwitch - #1684

Open
ace-ify wants to merge 2 commits into
sandbox-quantum:mainfrom
ace-ify:feat/803-safe-tool-input-output
Open

ace-ify wants to merge 2 commits into
sandbox-quantum:mainfrom
ace-ify:feat/803-safe-tool-input-output

Conversation

@ace-ify

@ace-ify ace-ify commented Nov 7, 2026

Copy link
Copy Markdown

What this changes

Shows tool call details (inputs and outputs) in collaboration channels safely with secret redaction, size bounding, and room-level disclosure controls:

  • Secret Redaction (switch_core.bridges.collaboration.session.redaction): Masks sensitive credentials including PEM private keys, provider API keys (OpenAI, Anthropic, GitHub, Slack, AWS, Google), JWTs, Bearer tokens, database connection string passwords, MCP/HTTP Authorization headers, and environment variable secret assignments before channel rendering.
  • Bounded Detail Previews: Enforces limits (up to 500 chars for input, 2,000 chars total) with descriptive omission notices so verbose tool outputs don't flood chat channels.
  • Room-Level Privacy Control (RoomStore): Supports tool_detail_off room metadata toggle (tool_detail_enabled_in, tool_detail_enabled, set_tool_detail_enabled). Stored execution detail is preserved in DB and stripped on read/render when the toggle is off.
  • Renderer Integration: Plumbed safe redaction and toggle support into Slack (_plan_task, _plan) and neutral/Mattermost (activity_log, _log_line) collaboration session renderers.

Closes #803

How it was tested

  1. Added unit test suite tests/switch_core/bridges/collaboration/test_safe_tool_redaction.py (10 tests) covering PEM keys, provider tokens, DB URLs, headers, env secrets, and character limit truncation.
  2. Added rendering test suite tests/switch_core/bridges/collaboration/test_safe_tool_rendering.py (5 tests) verifying Slack card detail redaction, neutral activity log masking, and room toggle state behavior.
  3. Verified against existing collaboration bridge suites (test_session_slack_requests.py).
  4. Verified lint and formatting compliance with ruff check and ruff format.
============================= 49 passed in 0.43s ==============================

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@ace-ify

ace-ify commented Nov 7, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

switch-cla-assistant Bot added a commit that referenced this pull request Nov 7, 2026
@ace-ify

ace-ify commented Nov 7, 2026

Copy link
Copy Markdown
Author

recheck

@ace-ify
ace-ify force-pushed the feat/803-safe-tool-input-output branch from 9c88970 to 175f058 Compare November 7, 2026 09:24

This branch has not been deployed

No deployments
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.

Show tool input and output in the channel, safely

1 participant