Skip to content

fix(nodes): keep paired-node photos and screenshots private by default - #174814

Merged
eleqtrizit merged 5 commits into
openclaw:mainfrom
eleqtrizit:1115
Oct 19, 2026
Merged

eleqtrizit merged 5 commits into
openclaw:mainfrom
eleqtrizit:1115

Conversation

@eleqtrizit

@eleqtrizit eleqtrizit commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Paired-node media inspection results (photos_latest, camera_snap, screen_snapshot) published their saved image paths in details.media without the outbound: false privacy flag, so the reply pipeline auto-attached the image to the first visible reply — even a text-only answer, and even in group chats. This marks those results outbound: false, the contract already shipped for image, computer, and browser inspection results, and surfaces the saved paths in model-visible result text for vision turns with accurate wording based on whether retained image blocks entered model context so explicit sharing still works without misleading non-vision or sanitized-omission runs.

What Problem This Solves

What this Problem Solves

When the agent inspects a private device image via the nodes tool — the owner's latest gallery photo, a camera capture, or the current phone screen — the saved file was queued as reply media and attached to the first visible reply regardless of whether anyone asked for the image. In a group chat, that posts the private image to every member; a screen snapshot can carry banking apps, messages, or one-time-code screens. No prompt injection or attacker is needed: any tool-enabled agent with a paired node and a vision model on a direct-tool surface (tools.toolSearch: false, or releases before structured Tool Search defaulted on) can leak by answering a routine question about a photo.

  1. Producers omitted the privacy flag: createNodePhotoResult (photos/camera results) and the screen_snapshot case of executeNodeMediaAction, both in src/agents/tools/nodes-tool-media.ts, built details.media without outbound.
  2. The pipeline honors that flag at extractToolResultMediaArtifact in src/agents/embedded-agent-tool-media.ts (returning undefined when details.media.outbound === false), but these producers never set it. Because nodes is in TRUSTED_TOOL_RESULT_MEDIA, local temp paths passed filterToolResultMediaUrls, were queued in pendingToolMediaUrls, and merged into the first visible reply (src/agents/embedded-agent-runner/run/tool-media-payloads.ts) even when the reply text never referenced the image.
  3. For vision models (modelHasVision: true), createNodePhotoResult emitted only an image content block and omitted the saved file path from content, while non-vision runs (modelHasVision: false or omitted) emitted "Camera/Library photo saved to <path>." and no image block. After sanitizeToolResultImages, createNodePhotoResult now inspects the sanitized content: when vision attempted inline images and retained image blocks survive (retainedImageCount > 0), it appends "Loaded <N> photo(s) into private model context for inspection; not attached or sent to the user. Saved to <paths>. Share explicitly only when the user asks."; when image sanitization omits the image block (retainedImageCount === 0), it appends "Photo(s) saved to <paths>; not attached or sent to the user. Share explicitly only when the user asks." without claiming the model received the image; and when modelHasVision is false or omitted, it preserves the existing saved-file text unchanged.

Net effect: inspecting paired-node photos, camera captures, or screen snapshots never implicitly attaches the private artifact to a group or direct reply, while explicit sharing via the message tool remains intact and model-facing text accurately reflects whether inline images entered context.

Why this design

  • Use the existing shipped contract, not a new mechanism: details.media.outbound: false is consumed at a single already-shipped site and already marks image/computer/browser inspection results private; the nodes producers were the missing seam.
  • Keep model-facing wording accurate across vision, non-vision, and sanitized-omission paths: check sanitized.content after sanitizeToolResultImages so the result claims photos were loaded into private model context only when retained image blocks actually survive (retainedImageCount > 0), reports saved-only paths when sanitization omits an image block, and leaves non-vision saved-file output untouched.
  • Keep explicit sharing working: vision results now include the saved path in model-visible text, and screen_snapshot already provides FILE:<path>, so explicit outbound sends via the message tool (media / mediaUrl) continue to deliver to the intended recipient.
  • No new config surface: the flag is a per-result contract field, not a setting; no defaults change and no migration is required.

Why this does not conflict with the sibling privacy fixes

PR Governed layer Relation to this PR
#101434 (browser screenshots kept private by default) extensions/browser screenshot results Precedent, already in base; this PR applies the same contract to node producers. No shared files with this diff.
Computer screenshots fix (src/agents/tools/computer-tool-result.ts) computer-tool results Precedent, already in base; different producers, same outbound contract consumed at the already-shipped site.
#125024 (standardize image inspection as view_image) src/agents/tools/image-tool.result.ts Precedent, already in base; unchanged here.

All three are merged in the base branch; this PR composes with them through the same details.media.outbound field. This diff changes node producers and tests only — no pipeline or consumer files.

Evidence of Fix

Production-path execution drives a real loopback Gateway server (startGatewayServer), a connected WebSocket Android node (role: "node", commands: ["photos.latest", "camera.snap", "screen.snapshot"]) servicing real node.invoke.request -> node.invoke.result frames, createNodesTool over WebSocket, handleToolExecutionEnd -> buildEmbeddedRunPayloads -> mergeAttemptToolMediaPayloads, and real channel delivery through both prepareOutboundPayloadBatch + deliverOutboundPayloadsCore and the Telegram plugin (deliverReplies + telegramPlugin.actions.handleAction against a loopback Telegram Bot API HTTP server on 127.0.0.1:<redacted-port> for group chat -100999888) at exact head f78a9b7b95b667c4667f2cf64f1a949603abf850 vs. merge-base c7a77fe791520c6f6dc76d090cf457a9bd55b7e5.

Path Mode Before fix (c7a77fe7915) After fix (f78a9b7b95b)
nodes photos_latest (modelHasVision: true, paired Android node over Gateway WS) Group text-only reply ("The receipt total is $42." to -100999888) details.media omits outbound; path queued in pendingToolMediaUrls and auto-attached to group reply (6/55 overlaid suite tests fail on base) details.media.outbound === false; pendingToolMediaUrls === []; Telegram HTTP server receives only POST /bot<redacted>/sendMessage (hasPhotoUpload: false, 0 sendPhoto calls); vision text reports "Loaded 1 photo into private model context for inspection; not attached or sent to the user. Saved to \"/tmp/openclaw/openclaw-camera-snap-<redacted>.jpg\"..."
nodes camera_snap (modelHasVision: true, facing: "front") Group text-only reply after inspection Auto-attached via shared createNodePhotoResult builder (outbound absent) details.media.outbound === false; pendingToolMediaUrls === []; 0 implicit media sends to group recipients
nodes screen_snapshot (modelHasVision: true) Group text-only reply after inspection details.media.mediaUrl queued and auto-attached (/tmp/openclaw/openclaw-screen-snapshot-<redacted>.jpg) details.media.outbound === false; pendingToolMediaUrls === []; FILE:<path> retained for explicit share; 0 implicit media sends to group recipients
nodes photos_latest (modelHasVision: false / omitted, and sanitized-omission vision path) Non-vision & omitted-image model text accuracy (P2 check) Unconditional message claimed photos were loaded into model context even when no image block was returned modelHasVision: false returns only [{ type: "text", text: "Library photo saved to /tmp/openclaw/openclaw-camera-snap-<redacted>.jpg." }]; sanitized-omission returns "Photo saved to \"/tmp/camera.jpg\"; not attached or sent to the user. Share explicitly only when the user asks." without claiming images entered context
Explicit share (message tool action: "send" / telegramPlugin.actions.handleAction with media / mediaUrl set to saved path) User explicitly asks to share the inspected photo to group -100999888 Delivers photo to group deliverOutboundPayloadsCore dispatches sendMedia (deliveredMedia.length === 1, mediaUrl === photoPath) and Telegram HTTP server receives POST /bot<redacted>/sendPhoto (chatId: "-100999888", caption: "Here is the receipt you asked me to share.", hasPhotoUpload: true)
Overlaid test suites (src/agents/openclaw-tools.camera.test.ts + src/agents/tools/nodes-tool.test.ts) Base-fail / head-pass comparison (git worktree add --detach at merge-base c7a77fe7915 vs. head f78a9b7b95b) 6 failed, 49 passed (55 total) on base c7a77fe7915 55 passed (55 total, 0 failed) on head f78a9b7b95b
Redacted live Gateway + paired Android node + Telegram Bot API HTTP trace on head f78a9b7b95b
{
  "invokedNodeCommands": [
    "photos.latest",
    "camera.snap",
    "screen.snapshot",
    "photos.latest"
  ],
  "visionPhotoContentTypes": [
    "image",
    "text"
  ],
  "visionPhotoText": "Loaded 1 photo into private model context for inspection; not attached or sent to the user. Saved to \"/tmp/openclaw/openclaw-camera-snap-<redacted>.jpg\". Share explicitly only when the user asks.",
  "nonVisionPhotoText": [
    "Library photo saved to /tmp/openclaw/openclaw-camera-snap-<redacted>.jpg."
  ],
  "photoOutboundFlag": false,
  "snapOutboundFlag": false,
  "screenOutboundFlag": false,
  "pendingToolMediaUrlsAfterInspection": [],
  "inspectionTelegramCalls": [
    {
      "method": "sendMessage",
      "chatId": "-100999888",
      "text": "The receipt total is $42.",
      "hasPhotoUpload": false
    }
  ],
  "explicitShareTelegramCalls": [
    {
      "method": "sendPhoto",
      "chatId": "-100999888",
      "caption": "Here is the receipt you asked me to share.",
      "hasPhotoUpload": true
    }
  ]
}

Testing

  • pnpm exec vitest run src/agents/openclaw-tools.camera.test.ts src/agents/tools/nodes-tool.test.ts: 55/55 passed on head f78a9b7b95b (vs. 6 failed / 49 passed when overlaid on merge-base c7a77fe7915), covering:
    • Vision retained-image path (Loaded 1 photo into private model context... + outbound: false),
    • Non-vision path (modelHasVision: false emits only "Library photo saved to ..." without claiming images were loaded + outbound: false),
    • Sanitized-omission path (dummy base64 omitted by sanitizeToolResultImages emits "Photo saved to ...; not attached or sent to the user..." without claiming images entered model context + outbound: false),
    • Production-path group recipient isolation (createNodesTool -> handleToolExecutionEnd -> buildEmbeddedRunPayloads -> mergeAttemptToolMediaPayloads -> prepareOutboundPayloadBatch -> deliverOutboundPayloadsCore delivers only text to group:family-chat with zero media sends, while explicit createMessageTool action: "send" with media: photoPath delivers the image to group:family-chat).
  • pnpm exec vitest run src/agents/embedded-agent-runner/run/tool-media-payloads.test.ts src/agents/embedded-agent-subscribe.tools.test.ts src/cli/nodes-camera.test.ts: 82/82 passed.
  • pnpm tsgo:core: clean (exit 0).

Inspected node media (photos_latest, camera_snap, screen_snapshot) listed
saved paths in details.media without the outbound:false privacy flag, so the
reply pipeline auto-attached the image to the next visible reply even when
the reply was text-only. Mark those results outbound:false — the contract
already shipped for image, computer, and browser inspection results — and
surface the saved paths in model-visible result text so explicit sharing
still works when the user asks.
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

Keeps paired-node photos and screenshots out of automatic reply attachments while preserving saved paths for explicit sharing.

Example: An agent inspects a receipt photo and answers “The receipt total is $42.” in Telegram group -100999888.

  • Before: The receipt image is automatically attached to the text reply.
  • After: Only the text is sent; the image remains available for an explicit share.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, useful privacy repair with final-effect transport evidence and meaningful regression coverage; broad CI has not completed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The supplied exact-head trace exercises node media over a real Gateway/WebSocket connection and Telegram HTTP transport: group inspection produces only text, while explicit sharing uploads the saved photo; retained-image, non-vision, and sanitized-omission results are also documented.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Inspecting a private device image can publish it to the conversation without a request to share it.
Reason: This closes a concrete privacy gap and follows the established inspection-versus-sharing direction without adding configuration or a competing owner.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR fixes a current privacy defect using the existing private-media contract; no introduced correctness or security defect was found.

Priority: P1
Reviewed head: f78a9b7b95b667c4667f2cf64f1a949603abf850

Before merge

  • Complete next step - Mark this PR ready for review when ready to proceed.

Findings

None.

Agent review details

How this fits together

The nodes tool saves paired-device captures and returns model content plus media metadata; the agent reply pipeline consumes that metadata to prepare channel attachments.

flowchart LR
  A[Paired node] --> B[Nodes media producer]
  B --> C[Private model result]
  B --> D[Media extraction]
  D --> E[Text reply delivery]
  C --> F[Explicit message tool]
  F --> G[Requested media delivery]
Loading

Technical review

Best possible solution:

Apply the existing private-media contract at node capture producers and retain explicit sharing through the message tool.

Do we have a high-confidence way to reproduce the issue?

Current-main producers omit outbound:false, allowing trusted node paths into automatic reply attachments; the supplied before/after transport trace corroborates this path without reviewer execution.

Is this the best way to solve the issue?

The patch repairs the producing owner with the established privacy flag and restores model-visible paths without changing capture authorization or explicit-send behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 88740b4ad834.

Provenance checked

  • Screen snapshot media metadata changes intended behavior with a stated reason (4c9e7f6: Provide file-backed screenshot results instead of large inline base64 responses; later consolidation preserved that output.)
  • Shared camera and photo-library results changes intended behavior with a stated reason (9b472bc: Provide truthful visible capture outcomes and structured media metadata; the later batch repair consolidated artifact production.)
  • Non-vision and sanitized-image result text keeps the original intent (9b472bc: Ensure saved photos have usable visible outcomes even without inline model images.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced patch and current-main comparison: The pinned introduced diff changes only node media production and its tests; fetched main still lacks both outbound privacy flags. (src/agents/tools/nodes-tool-media.ts:257, f78a9b7b95b6)
  • Existing privacy enforcement: Media extraction returns before collecting paths when outbound is false; tool completion queues attachments only when extraction supplies media. (src/agents/embedded-agent-tool-media.ts:259, f78a9b7b95b6)
  • Supplied final-effect proof: The full PR body records exact-head Gateway/WebSocket execution and Telegram HTTP output: inspection sends only sendMessage to group -100999888, while explicit sharing produces sendPhoto with an upload. (f78a9b7b95b6)
  • Established privacy direction: The merged browser precedent explicitly keeps inspection screenshots private while retaining explicit message-tool sharing: fix(browser): keep screenshots private by default #101434. (454fccd7843b)
  • Original node contracts: The original screenshot change provided file-backed results to avoid base64 context bloat; subsequent photo repairs preserved visible outcomes and validated capture batches. This patch retains those contracts. (src/agents/tools/nodes-tool-media.ts:247, 4c9e7f6c6171)
  • Earlier finding resolved: The follow-up commit replaces unconditional loaded-image wording with a post-sanitization image count and preserves non-vision saved-file text. (src/agents/tools/nodes-tool-media.ts:344, f78a9b7b95b6)

Likely related people:

  • Peter Steinberger: Raw commit e0a4915 adds src/agents/tools/nodes-tool-media.ts:172 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e0a4915bcf16; files: src/agents/tools/nodes-tool-media.ts)
  • zengLingbiao: Raw commit 4c9e7f6 adds src/agents/tools/nodes-tool.test.ts:294 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4c9e7f6c6171; files: src/agents/tools/nodes-tool.test.ts)

PR surface

Source +24, Tests +250. Total +274 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 26 2 +24
Tests 2 250 0 +250
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 276 2 +274

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Routine inspection can automatically disclose private device images to group recipients.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-16T23:22:16.475Z sha 6729e2d :: needs real behavior proof before merge. :: [P2] Describe saved-only photos without claiming the model received images
  • reviewed 2026-10-17T02:06:57.414Z sha f78a9b7 :: needs changes before merge. :: none
  • reviewed 2026-10-17T02:13:37.005Z sha f78a9b7 :: needs changes before merge. :: none

Reviewed October 16, 2026, 11:26 PM ET / October 17, 2026, 03:26 UTC (Revision 4).

…paths

Only claim photos were loaded into private model context when retained image
blocks survive sanitization; when modelHasVision is false or omitted, keep the
saved-file text unchanged, and when sanitization omits an image block, report
the saved path without claiming the model received the image. Add end-to-end
group recipient isolation and explicit-share tests.
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 17, 2026
@eleqtrizit
eleqtrizit marked this pull request as ready for review October 19, 2026 17:01
# Conflicts:
#	src/agents/openclaw-tools.camera.test.ts
#	src/agents/tools/nodes-tool.test.ts
@eleqtrizit

Copy link
Copy Markdown
Contributor Author

Merge record

Summary: Fixes a privacy leak where photos_latest and screen_snapshot results from paired nodes auto-attached saved images to text-only replies. Node media results now mark their saved files outbound: false so they stay in private model context, and result text accurately states whether images entered model context. Includes a live end-to-end proof (loopback Gateway + paired node + Telegram) that inspection never uploads media while explicit sharing still works.

Decision Reason for Merge: Merged because Clawsweeper review completed with zero actionable findings and proof: sufficient (platinum hermit, 4/6), the only remaining blocker was leaving draft state, all PR-relevant CI lanes pass on the merge head, and the sole remaining red lane (check-lint) was reproduced on pristine upstream main and is pre-existing, unrelated to this change.

Compatibility Checks Done: Compatibility double-check on the three-dot diff vs upstream/main: no config, schema, or public interface changes (only details.media.outbound: false using the existing contract); pnpm tsgo:core clean; 55/55 tests pass in the two touched test files; base-fail/head-pass verified at merge-base; openclaw/dependency-review and openclaw/security-sensitive-review pass; PR context and evidence, review, and dispatch pass on the merge head.

@eleqtrizit
eleqtrizit merged commit 627d77d into openclaw:main Oct 19, 2026
108 of 111 checks passed
@eleqtrizit
eleqtrizit deleted the 1115 branch October 19, 2026 17:47
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
openclaw#174814)

* fix(nodes): keep paired-node photos and screenshots private by default

Inspected node media (photos_latest, camera_snap, screen_snapshot) listed
saved paths in details.media without the outbound:false privacy flag, so the
reply pipeline auto-attached the image to the next visible reply even when
the reply was text-only. Mark those results outbound:false — the contract
already shipped for image, computer, and browser inspection results — and
surface the saved paths in model-visible result text so explicit sharing
still works when the user asks.

* fix(nodes): distinguish retained vision images from saved-only photo paths

Only claim photos were loaded into private model context when retained image
blocks survive sanitization; when modelHasVision is false or omitted, keep the
saved-file text unchanged, and when sanitization omits an image block, report
the saved path without claiming the model received the image. Add end-to-end
group recipient isolation and explicit-share tests.

* test(nodes): fix details media type access in privacy tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant