feat(bluebubbles): optional exact allowed_chat_guids ingress gate - #63990
feat(bluebubbles): optional exact allowed_chat_guids ingress gate#63990sene1337 wants to merge 2 commits into
Conversation
Add a positive exact chat-GUID allowlist for BlueBubbles so only explicitly listed DM/group chats enter the agent path. Setting absent preserves stock behavior; explicitly empty fails closed. Gate runs after chat GUID resolution and before attachment download, handle_message, session/model/tools, and read receipts. Participant allowlisting and require_mention remain independent layers.
59ee919 to
e718019
Compare
|
Trying to add my Hermes agent to group chats with people on my team and vendors who only use iMessage, to have the agent monitor chats - and this is what a council of Sol + Fable + Grok 4.5 suggests. |
|
Thanks for adding a narrowly scoped early ingress boundary; current main does not provide an exact BlueBubbles chat-GUID gate before attachment handling ( Problems
Suggested changes
Automated hermes-sweeper review. |
Maintainer context from a real deploymentWe are carrying this patch in our live Hermes checkout because stock BlueBubbles cannot express a security boundary required for disclosed, observe-only iMessage groups. Use caseHermes is intentionally present in a small allowlist of team/vendor iMessage groups. In those approved rooms it should be able to observe ordinary conversation, capture actionable follow-ups internally, and remain silent unless someone explicitly invokes the agent. The same authorized people also participate in other iMessage chats that must not enter the agent at all. That makes the chat itself—not only the sender—a required admission boundary. Why the existing controls are not equivalent
Without this gate, a teammate who is authorized for one monitored group can post in a different group and cause that private chat's message or attachment to enter Hermes processing. A later Required semanticsThe deployment needs these semantics at the BlueBubbles ingress boundary:
Why carrying this locally is painfulHermes Every update therefore requires us to:
That turns routine Hermes upgrades into a security-sensitive fleet migration. We would strongly prefer to run stock Hermes and retire the local carry. Automated review feedbackWe agree with the sweeper finding: when the setting is absent, the implementation should preserve the legacy top-level RequestCould a maintainer confirm whether this narrow adapter-level shape and Longer term, BlueBubbles would also benefit from an observer mode similar to Telegram's We would appreciate prioritizing this because the missing boundary is currently preventing clean, low-risk Hermes updates for a real deployment. |
Related to #33489 and #33541, but not a duplicate: this patch has an explicit absent-versus-empty fail-closed contract and applies exact GUID admission before attachment handling. Maintainer decision needed on this BlueBubbles-specific contract versus a shared ingress abstraction. |
|
Follow-up: the compatibility issue is fixed in The resolver now has two explicit modes:
I added webhook regressions for both paths:
The focused BlueBubbles suite passes on the corrected carry stack: 74 passed using the declared We also carried the exact reviewed patches through a current-upstream deployment rehearsal: stable patch IDs match |
|
Related follow-up opened: #88550 ( Complementary layers for multi-mode BlueBubbles / messaging:
Neither replaces the other. |
Summary
BlueBubbles currently can authorize senders, but it cannot optionally scope exact conversations. That means an allowed participant in an off-scope group or DM can still reach the adapter path.
This PR adds an optional positive exact chat-GUID allowlist that runs after chat GUID resolution and before side effects:
handle_message/ session / model / tools / outboundRelated prior art (not equivalent): #33489 / #33541 (
BLUEBUBBLES_ALLOWED_CHATS/IGNORE_GROUP_CHATS). That design is fail-open when the allowlist is empty/unset and does not provide the three-state exact-GUID ingress contract below.Config
platforms.bluebubbles.extra.allowed_chat_guidsBLUEBUBBLES_ALLOWED_CHAT_GUIDS(comma-separated or JSON list)Semantics:
Participant allowlist (
BLUEBUBBLES_ALLOWED_USERS/ pairing) andrequire_mentionremain independent layers and continue to apply after chat-GUID admission.Why not just #33541?
#33541 is useful for group filtering, but differs in material ways:
BLUEBUBBLES_ALLOWED_CHATSfails open (if not allowed_chats: return True)This PR is intentionally narrower: exact GUID admission only, stock-absent + fail-closed-empty, early denial.
Tests
PYTHONPATH=. python -m pytest tests/gateway/test_bluebubbles.py -q # 73 passed (includes TestBlueBubblesChatGuidAllowlist)Rebased cleanly onto current
mainbefore opening.Docs
website/docs/user-guide/messaging/bluebubbles.mdwebsite/docs/reference/environment-variables.mdhermes_cli/config.pyenv catalog entry