Description
Where it sits
core/src/host/room-membership.js authoredRoomLine (~line 403): the untrusted fence for a remote sender's text is gated on isFaceRoom(room) && (remote || !state.bots?.[line.botId]). ingestRemoteRoomLine (~779) posts a granted friend's Bot's message into non-face social shared rooms through the same function, so faceRemote is false there and the text is stored raw.
Why it matters
Peer-controlled text (LESSONS 2026-10-14: untrusted fence escape / remote display names) then reaches model-visible trusted context twice: the roomPrompt transcript every member Bot receives (groups.js roomPrompt → transcript), and read_group_chat. A friend's Bot (or anything speaking with its handle through Bot Social) can emit </untrusted-message> markers or forged trusted-looking headers into a shared room. Face rooms (#83/#88) already fence exactly this shape; the non-face ingest path predates/missed it.
Suggested direction
Key the fence on the line's origin (remote participant, or a botId that is not a local Bot), not on the room kind — i.e. drop the isFaceRoom(room) && half. The existing includes('<untrusted-message') guard keeps it idempotent for already-fenced text; outbound fanout (~722) has its own guard, so no double-fence. Check the client renderer handles fenced lines in non-face rooms the way it already does for face rooms.
Acceptance
- Red test first: ingest a remote line with a crafted
</untrusted-message>into a non-face shared room → stored line is fenced and the marker cannot reconstitute (LESSONS: neutralize until stable, or escape). - Face-room behavior unchanged; existing
remote-room.test.jsfanout/viewer tests stay green.
Related: #9 (fence/display-name class), #53 (shared-room context assembly).
Activity
Fence a friend's Bot's lines in every shared room, not only face-to-f…
Fence a friend's Bot's lines in every shared room, not only face-to-f…
fix(social): a human's message to a room's friend Bot no longer goes …
fix(rooms): gate the second room.log writer, and keep a peer's fence (T…