Skip to content

fix(tool_runner): avoid leaking tool exception details (credit @sebastiondev #814)#823

Open
Bartok9 wants to merge 1 commit into
RobotecAI:bartok9/fixesfrom
Bartok9:salvage/tool-runner-cwe209-814
Open

fix(tool_runner): avoid leaking tool exception details (credit @sebastiondev #814)#823
Bartok9 wants to merge 1 commit into
RobotecAI:bartok9/fixesfrom
Bartok9:salvage/tool-runner-cwe209-814

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Credit

Original investigation, root-cause analysis, and fix approach by @sebastiondev in #814. This salvage rebases the intent onto current main and adds tests so the property stays locked.

Motivation

Tool failures from DB/HTTP/SSH libraries often embed hosts, paths, and credentials in str(e). Feeding that into ToolMessage.content surfaces internals to the LLM prompt and any conversation UI.

Verification

PYTHONPATH=src/rai_core python -m pytest tests/agents/langchain/test_tool_runner_cwe209.py -q
# 2 passed
  • Did NOT change: ValidationError branch, success path, multimodal artifact handling.

Notes for reviewers

Happy to close this in favor of #814 if preferred — the tests can be ported either direction.


Agent-Owner: sera · Platform: hermes · Claim-TTL: 24h

Salvage of RobotecAI#814 by @sebastiondev.

Exception messages raised by tool implementations were embeddedverbatim
into ToolMessage.content returned to the agent. Log full details via
logger.exception server-side and return only the tool name plus exception
class name to the LLM/user. Adds offline regression tests proving secrets
and hosts are not presented in ToolMessage content.

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
@Bartok9 Bartok9 changed the title salvage: fix(tool_runner) avoid leaking tool exception details (credit @sebastiondev #814) fix(tool_runner): avoid leaking tool exception details (credit @sebastiondev #814) Jul 22, 2026
@maciejmajek
maciejmajek changed the base branch from main to bartok9/fixes July 22, 2026 10:04
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.

1 participant