#6567: fix: include paired users in WhatsApp group sender allowlist
channel: whatsapp-web
When `groupPolicy` is `"allowlist"`, the `groupAllowFrom` fallback only used explicitly configured `allowFrom` entries, not paired users from the pairing store. This meant users who paired via DM (the default flow) couldn't trigger the bot in groups unless they were also manually added to `groupAllowFrom`.
## Root Cause
In `access-control.ts`, the `groupAllowFrom` fallback used `configuredAllowFrom` (config-only) instead of `combinedAllowFrom` (config + pairing store):
```ts
// Before:
const groupAllowFrom = account.groupAllowFrom ??
(configuredAllowFrom && configuredAllowFrom.length > 0 ? configuredAllowFrom : undefined);
// After:
const groupAllowFrom = account.groupAllowFrom ??
(combinedAllowFrom.length > 0 ? combinedAllowFrom : undefined);
```
## Impact
Users with default `dmPolicy: "pairing"` who set `groupPolicy: "allowlist"` had to either:
- Set `groupPolicy: "open"` as a workaround
- Manually duplicate every paired number into `groupAllowFrom`
Now paired users automatically get group access when `groupAllowFrom` is not explicitly set.
## Files changed
- `src/web/inbound/access-control.ts` — one-line fix to use `combinedAllowFrom`
- `src/web/inbound/access-control.group-allowlist.test.ts` — 7 new tests covering group policy scenarios
Fixes #6558
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR fixes WhatsApp group `allowlist` behavior by changing the `groupAllowFrom` fallback in `src/web/inbound/access-control.ts` to use the combined allowlist (`allowFrom` config + pairing store) instead of config-only `allowFrom`. As a result, users paired via DM (the default flow) can now trigger the bot in groups when `groupPolicy: "allowlist"` and `groupAllowFrom` isn’t explicitly configured. The PR also adds a focused Vitest suite (`src/web/inbound/access-control.group-allowlist.test.ts`) covering `open`, `disabled`, and `allowlist` scenarios, including the pairing-store fallback case.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk; it’s a targeted behavior fix with regression tests.
- The functional change is a one-line fallback correction that aligns group allowlist behavior with existing combined allowlist logic, and it’s exercised by new unit tests. Remaining risk is mainly around config typing/coverage of edge cases (e.g., self-only defaults) rather than core logic regressions.
- src/web/inbound/access-control.group-allowlist.test.ts (test robustness/typing)
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#11611: feat: separate group-level allowlist from sender-level command auth...
by thisnick · 2026-02-08
88.4%
#5665: fix: match group JIDs in groupAllowFrom allowlist
by koala73 · 2026-01-31
87.9%
#4390: fix(whatsapp): allow media from allowlisted groups without groupAllow…
by Sarang19114 · 2026-01-30
86.9%
#14789: fix: per-account dmPolicy ignored in checkInboundAccessControl
by croll83 · 2026-02-12
83.7%
#4402: fix: store group messages from non-allowlisted senders as pending c...
by adam91holt · 2026-01-30
82.7%
#6265: feat(whatsapp): add pairing owner notification
by zote · 2026-02-01
81.6%
#2703: docs(groups): clarify groupAllowFrom vs groups config
by RichardFellows · 2026-01-27
81.3%
#17882: fix: drop WhatsApp pairing reply for unconfigured accounts
by adit-negi · 2026-02-16
80.9%
#22636: fix(whatsapp): skip pairing store merge when dmPolicy is allowlist (#…
by anillBhoi · 2026-02-21
80.8%
#11249: fix(whatsapp): prevent pairing-mode auto-replies to unknown DMs
by liuxiaopai-ai · 2026-02-07
80.8%