Skip to content

Commit 68cb0fc

Browse files
LiLan0125claude
andcommitted
fix(outbound): sanitize message.send arguments to prevent runtime scaffolding leaks
Weak tool-calling models (MiniMax, Kimi, small Ollama models) can verbatim-echo the runtime Delivery: hint and Conversation info / Sender (untrusted metadata) JSON envelopes into message.send tool arguments. The runtime forwarded them unfiltered to channel adapters, leaking internal metadata into real human conversations. Apply the existing stripInboundMetadata sanitizer to outbound message.send arguments so the same sentinels stripped from inbound prompts are also stripped from outbound tool-call text before delivery. Closes #89100 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 2c0e835 commit 68cb0fc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Docs: https://docs.openclaw.ai
4545

4646
### Fixes
4747

48+
- Outbound: sanitize `message.send` arguments through `stripInboundMetadata` so weak models that echo runtime delivery hints and untrusted-metadata blocks into tool arguments no longer leak internal scaffolding (chat_id, sender_id, inbound_event_kind, sender display name/phone) into real conversations on WhatsApp, Signal, Telegram, and SMS channels. (#89100)
4849
- Agents/TUI: keep local custom provider runs from loading plugin runtime and auth alias metadata when plugins are disabled.
4950
- Agents/TUI: restore in-flight TUI run switch-back behavior, keep no-policy native hook fallback available, guard vanished workspaces, and keep lightweight isolated subagents lightweight.
5051
- Agents/media: keep async image, music, and video generation starts from ending the Codex turn, so mixed requests can continue with summaries or other work while media renders in the background.

src/infra/outbound/message-action-runner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { hasPollCreationParams } from "../../poll-params.js";
3838
import { resolvePollMaxSelections } from "../../polls.js";
3939
import { resolveFirstBoundAccountId } from "../../routing/bound-account-read.js";
4040
import { stripUnsupportedCitationControlMarkers } from "../../shared/text/citation-control-markers.js";
41+
import { stripInboundMetadata } from "../../auto-reply/reply/strip-inbound-meta.js";
4142
import { stripFormattedReasoningMessage } from "../../shared/text/formatted-reasoning-message.js";
4243
import { parseInlineDirectives } from "../../utils/directive-tags.js";
4344
import {
@@ -983,7 +984,9 @@ async function buildSendPayloadParts(params: {
983984
mergedMediaUrls.length = 0;
984985
mergedMediaUrls.push(...normalizedMediaUrls);
985986

986-
message = stripPlainTextToolCallBlocks(stripUnsupportedCitationControlMarkers(parsed.text));
987+
message = stripInboundMetadata(
988+
stripPlainTextToolCallBlocks(stripUnsupportedCitationControlMarkers(parsed.text)),
989+
);
987990
actionParams.message = message;
988991
if (!actionParams.replyTo && parsed.replyToId) {
989992
actionParams.replyTo = parsed.replyToId;

0 commit comments

Comments
 (0)