Skip to content

fix(browser): keep screenshots private by default - #101434

Merged
steipete merged 4 commits into
mainfrom
codex/browser-screenshot-private
Jul 7, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/browser-screenshot-private

Conversation

@steipete

@steipete steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Closes #44759

What Problem This Solves

Fixes an issue where users asking an agent to inspect a browser screenshot could have that screenshot automatically attached to the channel reply, exposing page content they had not asked the agent to send.

Why This Change Was Made

Browser screenshots now use the existing private tool-media contract on both raw-image paths. The image block and local path remain available to agent vision, while outbound delivery requires the agent to use the message tool explicitly. No browser permission, agent trust, or explicit media-send capability changes.

User Impact

Agents can still inspect browser screenshots normally. Channel replies no longer gain an implicit screenshot attachment; users can still ask the agent to share one explicitly.

Evidence

  • Blacksmith Testbox tbx_01kwxmt1fv7hpt6qt7dxr1xn3s: 119 focused tests passed across the browser tool and tool-media extraction suites; touched TypeScript files passed oxfmt --check.
  • Structured autoreview: clean, no accepted/actionable findings.

Live Gateway/agent proof will be added before landing.

AI-assisted: yes. I reviewed the affected browser, agent-media extraction, delivery, tests, and docs paths and understand the change.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 6:54 AM ET / 10:54 UTC.

Summary
The branch marks browser screenshot image results private by default, stages a bounded outbound copy for explicit message-tool sharing, updates browser/tool-media tests, and documents the behavior.

PR surface: Source +60, Tests +120, Docs +4. Total +184 across 7 files.

Reproducibility: yes. by source inspection. Current main's browser screenshot raw-image paths call imageResultFromFile, imageResult records details.media.mediaUrl, and the media extractor queues that media unless details.media.outbound is false.

Review metrics: 1 noteworthy metric.

  • Screenshot image return paths: 2 changed to private by default. Both raw-image browser screenshot paths now rely on details.media.outbound=false, which is the compatibility-sensitive delivery default change.

Stored data model
Persistent data-model change detected: serialized state: extensions/browser/src/browser-tool.ts, serialized state: extensions/browser/src/browser/screenshot-sharing.test.ts, serialized state: extensions/browser/src/browser/screenshot-sharing.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #44759
Summary: This PR is the current candidate fix for the linked browser screenshot auto-delivery security issue; the earlier MEDIA-hint PR is adjacent and closed because it conflicts with the privacy default.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Add or link a redacted live Gateway/channel transcript or logs if maintainers want runtime proof that the screenshot remains agent-visible but is not auto-attached.

Risk before merge

  • [P1] Merging intentionally changes browser screenshot channel behavior: users who relied on implicit screenshot attachments must now ask the agent to send the staged screenshot path explicitly with the message tool.
  • [P1] The PR is mergeable but behind the current base, so maintainers should land or recheck the exact merge head to confirm the private-media behavior still applies.

Maintainer options:

  1. Accept the private default before landing (recommended)
    Maintainers can land after explicitly accepting that browser screenshots no longer auto-attach and explicit sharing uses the staged outbound copy.
  2. Require an opt-in compatibility path
    Ask for a documented opt-in legacy-delivery path if implicit screenshot attachments are still required for existing deployments.
  3. Pause for a broader visibility contract
    Pause this PR if the desired product direction is a unified tool-output visibility policy rather than a browser-owned default change.

Next step before merge

  • [P1] The protected maintainer-labeled PR needs explicit acceptance of the screenshot delivery default change and ordinary maintainer landing, not a ClawSweeper repair job.

Maintainer decision needed

  • Question: Should browser screenshots stop implicit channel auto-delivery by default while preserving explicit message-tool sharing through a staged outbound copy?
  • Rationale: The patch is technically sound, but the delivery default is a user-visible compatibility and security policy choice for existing browser screenshot workflows.
  • Likely owner: steipete — steipete owns the current PR and has recent browser screenshot and media-path history on the affected files.
  • Options:
    • Accept private screenshot default (recommended): Land this PR after confirming the intended contract: screenshots remain agent-visible and can be shared explicitly, but are not auto-attached to channel replies.
    • Add opt-in legacy delivery: Require a documented opt-in compatibility path if maintainers decide existing automation must keep implicit browser screenshot attachments.
    • Pause for broader visibility policy: Hold this PR if maintainers want screenshot, exec, and other sensitive tool outputs solved through one larger tool-output visibility design.

Security
Cleared: The diff reduces implicit sensitive screenshot delivery and adds no dependencies, scripts, credentials, or broader permissions; the explicit share copy uses the existing bounded media store.

Review details

Best possible solution:

Land the focused private-by-default browser screenshot fix after maintainer acceptance and exact-head validation, keeping explicit sharing through staged outbound media rather than implicit tool-result attachment.

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

Yes, by source inspection. Current main's browser screenshot raw-image paths call imageResultFromFile, imageResult records details.media.mediaUrl, and the media extractor queues that media unless details.media.outbound is false.

Is this the best way to solve the issue?

Yes, with maintainer acceptance of the default change. The PR uses the existing shared private-media contract at the browser owner boundary and avoids adding a new config or duplicate channel policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 69b9932fae45.

Label changes

Label justifications:

  • P1: The PR addresses a security-sensitive browser screenshot delivery bug that can expose page contents in real shared-channel workflows.
  • merge-risk: 🚨 compatibility: Existing users who relied on implicit browser screenshot attachments must switch to explicit message-tool sharing after this default changes.
  • merge-risk: 🚨 message-delivery: The diff intentionally suppresses automatic outbound delivery for browser screenshot image results, changing what media appears in channel replies.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable for this maintainer-labeled PR gate; the PR body still notes that live Gateway/agent proof should be added before landing, and GitHub reports the Real behavior proof check passing.
Evidence reviewed

PR surface:

Source +60, Tests +120, Docs +4. Total +184 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 66 6 +60
Tests 3 120 0 +120
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 190 6 +184

What I checked:

Likely related people:

  • christianklotz: Commit 68c78c4 added tool-result media delivery and tests on the extraction and queueing path this PR now suppresses for browser screenshots. (role: introduced media delivery behavior; confidence: high; commits: 68c78c4b43a2; files: src/agents/pi-embedded-subscribe.handlers.tools.ts, src/agents/pi-embedded-subscribe.tools.ts, src/agents/pi-embedded-subscribe.tools.media.test.ts)
  • drobison00: Commit 52ef423 tightened trusted tool media passthrough on the same raw-tool-name filtering and extraction boundary. (role: adjacent media trust hardening contributor; confidence: high; commits: 52ef42302ead; files: src/agents/pi-embedded-subscribe.tools.ts, src/agents/pi-embedded-subscribe.handlers.tools.ts, src/gateway/openresponses-http.ts)
  • scotthuang: Commit 7920af0 routed browser screenshot vision through shared media understanding and removed deliverable raw media from the vision-success path. (role: browser screenshot vision contributor; confidence: high; commits: 7920af0c9ec4; files: extensions/browser/src/browser-tool.ts, extensions/browser/src/browser-tool.test.ts, docs/tools/browser.md)
  • steipete: Prior current-main history includes browser screenshot timeout and media path fixes, and this PR head is the current focused fix for the linked security issue. (role: recent browser/media contributor and current fix owner; confidence: high; commits: 3a7ee209c967, 3312ce5acba9, a29e3f8eee40; files: extensions/browser/src/browser-tool.ts, extensions/browser/src/browser-tool.test.ts, src/media/parse.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-07-07T07:07:42.083Z sha cea8778 :: needs real behavior proof before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-07-07T10:22:09.922Z sha af5cf56884b6769c22e03951e4dc0c01986989cf :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 7, 2026
@steipete
steipete force-pushed the codex/browser-screenshot-private branch from cea8778 to 39f1f14 Compare July 7, 2026 09:53
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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 Jul 7, 2026
@steipete
steipete force-pushed the codex/browser-screenshot-private branch from af5cf56 to 3dbc870 Compare July 7, 2026 10:30
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head a29e3f8eee400bef90bc50bd43a22575739b40f7:

  • pnpm test extensions/browser/src/browser-tool.test.ts extensions/browser/src/browser/screenshot-sharing.test.ts src/agents/embedded-agent-subscribe.tools.media.test.ts on Blacksmith Testbox-through-Crabbox tbx_01kwxzazgt4rcvzgvn6pd3q2d4: 121/121 tests passed.
  • pnpm check:changed on the same Testbox: passed in 8m33s, including selected type, lint, guard, extension, core-test, and docs lanes.
  • AWS Crabbox cbx_a8cee9a73f93, run run_c2f627d18cf6: started a fresh Dev Gateway, managed Chromium, and a real openai/gpt-5.4 agent turn. The agent invoked the browser screenshot tool, read the page-only marker from the image, and returned the exact model-visible share handle.
  • Live transcript assertions: screenshot image block retained for agent reasoning; original result marked media.outbound=false; agent reply contained zero mediaUrl/mediaUrls; share handle pointed to a separate existing media/outbound copy.
  • Failure-path coverage: if outbound staging fails, the screenshot image remains usable and private while the tool reports that explicit sharing is unavailable.
  • Fresh Codex autoreview after the final fixups: no accepted/actionable findings.

Security boundary: no browser access was reduced and no sandbox path allowlist was widened. The original screenshot stays a private tool artifact; only the bounded outbound copy is eligible for an explicit message-tool send.

@steipete
steipete merged commit 454fccd into main Jul 7, 2026
110 of 112 checks passed
@steipete
steipete deleted the codex/browser-screenshot-private branch July 7, 2026 10:56
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] Browser screenshot tool auto-delivers sensitive on-screen data to chat channels

1 participant