[GH-ISSUE #3194] [Issue]: Cross-chat awareness leaks "Hide from AI" messages into other chats' prompts #1716

Closed
opened 2026-10-21 05:41:59 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Magiwarriorx on GitHub (Jul 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3194

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The Conversation-mode cross-chat "awareness" block feeds sibling-chat messages to the model without filtering hiddenFromAI, so a message marked "Hide from AI" in one chat is sent to the model when generating in another chat that shares a character.

Expected behavior

A message marked "Hide from AI" is never sent to the model, in any chat. The in-chat transcript already enforces this; awareness should too.

Actual behavior

buildAwarenessBlock selects sibling-chat messages filtered only by time window and injects them verbatim as a system message. The hiddenFromAI flag lives in message.extra, which the awareness query never reads — so hidden messages leak into other chats' model context.

Steps to reproduce

  1. Two Conversation chats, A and B, sharing a character (cross-chat awareness is on by default).
  2. In chat B, mark a message "Hide from AI" (stays visible to you, excluded from B's own prompt).
  3. Generate in chat A within the awareness window — a temporal cue widens it, e.g. "what did we talk about yesterday?" pulls the full prior day.
  4. Inspect A's prompt (peek-prompt / generation-replay): B's hidden message is present, and the character may reference it.

Environment

  • Marinara Engine version: 2.1.0 (staging @ a90e7158)
  • Install type: source
  • OS + version: platform-independent
  • Browser or app shell: n/a

Additional context

  • Identified by source review; not yet reproduced at runtime.
  • Divergence: in-chat history filters !isMessageHiddenFromAI (generate.routes.ts:1835, helper routes/generate/generate-route-utils.ts:575). Awareness (services/conversation/awareness.service.ts:231-243) selects content but not extra and filters only by time window, so it cannot honor the flag. Injected verbatim at generate.routes.ts:4655; mergeConversationCharacterMemories does not sanitize.
  • Persistence: the flag lives in message.extra.hiddenFromAI (chats.routes.ts:1645); content is preserved, so it remains available to leak. Also reachable via the bulk action (chats.routes.ts:1665).
  • Default-on and easily triggered: crossChatAwareness !== false (generate.routes.ts:3529); default window ~1h, but temporal phrases widen it to days (awareness.service.ts:38-55), all unfiltered.
  • Suggested fix: select extra in the awareness query and apply the same isMessageHiddenFromAI filter the main transcript uses. A regression:prompt guard would fit the existing lane.
  • Possible additional leak: the same query also ignores the sibling chat's isConversationStart marker — a user-settable per-chat context-reset boundary — so it can pull messages the user placed before that boundary in chat B. Unsure whether that's intended (awareness is arguably "recent activity elsewhere," separate from B's own context scope), so flagging rather than asserting.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Magiwarriorx on GitHub (Jul 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3194 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The Conversation-mode cross-chat "awareness" block feeds sibling-chat messages to the model without filtering `hiddenFromAI`, so a message marked "Hide from AI" in one chat is sent to the model when generating in another chat that shares a character. ## Expected behavior A message marked "Hide from AI" is never sent to the model, in any chat. The in-chat transcript already enforces this; awareness should too. ## Actual behavior `buildAwarenessBlock` selects sibling-chat messages filtered only by time window and injects them verbatim as a system message. The `hiddenFromAI` flag lives in `message.extra`, which the awareness query never reads — so hidden messages leak into other chats' model context. ## Steps to reproduce 1. Two Conversation chats, A and B, sharing a character (cross-chat awareness is on by default). 2. In chat B, mark a message "Hide from AI" (stays visible to you, excluded from B's own prompt). 3. Generate in chat A within the awareness window — a temporal cue widens it, e.g. "what did we talk about yesterday?" pulls the full prior day. 4. Inspect A's prompt (peek-prompt / generation-replay): B's hidden message is present, and the character may reference it. ## Environment - Marinara Engine version: 2.1.0 (`staging` @ `a90e7158`) - Install type: source - OS + version: platform-independent - Browser or app shell: n/a ## Additional context - Identified by source review; not yet reproduced at runtime. - Divergence: in-chat history filters `!isMessageHiddenFromAI` (`generate.routes.ts:1835`, helper `routes/generate/generate-route-utils.ts:575`). Awareness (`services/conversation/awareness.service.ts:231-243`) selects `content` but not `extra` and filters only by time window, so it cannot honor the flag. Injected verbatim at `generate.routes.ts:4655`; `mergeConversationCharacterMemories` does not sanitize. - Persistence: the flag lives in `message.extra.hiddenFromAI` (`chats.routes.ts:1645`); `content` is preserved, so it remains available to leak. Also reachable via the bulk action (`chats.routes.ts:1665`). - Default-on and easily triggered: `crossChatAwareness !== false` (`generate.routes.ts:3529`); default window ~1h, but temporal phrases widen it to days (`awareness.service.ts:38-55`), all unfiltered. - Suggested fix: select `extra` in the awareness query and apply the same `isMessageHiddenFromAI` filter the main transcript uses. A `regression:prompt` guard would fit the existing lane. - **Possible additional leak:** the same query also ignores the sibling chat's `isConversationStart` marker — a user-settable per-chat context-reset boundary — so it can pull messages the user placed *before* that boundary in chat B. Unsure whether that's intended (awareness is arguably "recent activity elsewhere," separate from B's own context scope), so flagging rather than asserting. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:41:59 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Agreed, if hidden from AI, it should stay that way.

<!-- gh-comment-id:4881566545 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Agreed, if hidden from AI, it should stay that way.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 4, 2026):

Addressed in draft PR #3199.

<!-- gh-comment-id:4881612633 --> @SpicyMarinara commented on GitHub (Jul 4, 2026): Addressed in draft PR #3199.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1716
No description provided.