Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(signals): add scout-only members tool for reviewer routing (#67015)

Andrew Maguire2b523eb054cf
diff --git a/products/signals/backend/report_generation/resolve_reviewers.py b/products/signals/backend/report_generation/resolve_reviewers.py
index 5fb4db0ec596..ba8725bf47ca 100644
--- a/products/signals/backend/report_generation/resolve_reviewers.py
+++ b/products/signals/backend/report_generation/resolve_reviewers.py
@@ -8,9 +8,9 @@ from concurrent.futures import ThreadPoolExecutor, as_completed
from dataclasses import dataclass
from typing import Any, Literal
-from django.db.models import Expression, Prefetch, QuerySet, Subquery
+from django.db.models import Expression, Prefetch, Q, QuerySet, Subquery, Value
from django.db.models.fields.json import KeyTextTransform, KeyTransform
-from django.db.models.functions import Lower
+from django.db.models.functions import Concat, Lower
from social_django.models import UserSocialAuth
@@ -238,6 +238,59 @@ def get_org_member_github_logins_by_user_uuid(team_id: int, user_uuids: list[str
return user_uuid_to_login
+MAX_PROJECT_MEMBERS = 200
+
+
+@dataclass
+class ProjectMemberIdentity:
+ """One project member's routing identity — enough for a scout to pick a `suggested_reviewers` entry."""
+
+ user_uuid: str
+ email: str
+ first_name: str
+ last_name: str
+ github_login: str | None
+
+
+def list_project_members(
+ team: Team, *, search: str | None = None, limit: int = MAX_PROJECT_MEMBERS
+) -> list[ProjectMemberIdentity]:
+ """Members with access to ``team`` — their UUID/email/name and resolved GitHub login.
+
+ Backs the `signals-scout-members-list` tool: the cold-start reviewer-routing path for a scout
+ that can't read an owner off a fetched entity's ``created_by`` and has no cached
+ ``reviewer:<area>`` memory or inbox precedent. Scoped via ``Team.all_users_with_access()`` so
+ private-project access control is honored — a scout on a private project sees only the people who
+ can actually act on it, not the whole org roster — and inactive users are excluded.
+ ``get_github_login`` reads the same prefetched relations the reviewer resolver uses, so a member
+ with no linked GitHub identity gets a null login rather than dropping out. ``search``
+ (case-insensitive, over email + name) narrows the roster; the result is capped at ``limit`` so a
+ large org can't push its whole directory into the scout's context in one call.
+ """
+ users = team.all_users_with_access()
+ if search:
+ # Match the search against email, each name part, AND the concatenated full name, so a
+ # display-name query like "Jane Doe" still finds a member stored as first_name="Jane",
+ # last_name="Doe" — not just one whose email happens to contain the whole phrase.
+ users = users.annotate(_full_name=Concat("first_name", Value(" "), "last_name")).filter(
+ Q(email__icontains=search)
+ | Q(first_name__icontains=search)
+ | Q(last_name__icontains=search)
+ | Q(_full_name__icontains=search)
+ )
+ users = users.prefetch_related(*_github_identity_prefetches()).order_by("id")[:limit]
+ return [
+ ProjectMemberIdentity(
+ user_uuid=str(user.uuid),
+ email=user.email,
+ first_name=user.first_name,
+ last_name=user.last_name,
+ github_login=(login.lower() if (login := user.get_github_login()) else None),
+ )
+ for user in users
+ ]
+
+
def resolve_org_github_login_to_users(team_id: int, github_logins: Iterable[str]) -> dict[str, User]:
"""Map normalized GitHub login -> org member ``User`` (same identity rules as ``User.get_github_login()``).
diff --git a/products/signals/backend/routes.py b/products/signals/backend/routes.py
index 471cb23fc2ba..3bb57d94f52a 100644
--- a/products/signals/backend/routes.py
+++ b/products/signals/backend/routes.py
@@ -4,6 +4,7 @@ import products.signals.backend.views as signals
from products.signals.backend.scout_harness.views import (
SignalProjectProfileViewSet,
SignalScoutConfigViewSet,
+ SignalScoutMembersViewSet,
SignalScoutMetadataViewSet,
SignalScoutRunViewSet,
SignalScratchpadViewSet,
@@ -31,9 +32,9 @@ def register_routes(routers: RouterRegistry) -> None:
routers.projects.register(
r"signals/processing", signals.SignalProcessingViewSet, "environment_signal_processing", ["team_id"]
)
- # Signals agent HTTP surface — exposed via MCP as `signals-scout-*` tools. Reads (runs,
- # memory, project profile) are public-grantable via `signal_scout:read`; writes are
- # sandbox-scope only via `signal_scout_internal:write`.
+ # Signals agent HTTP surface — exposed via MCP as `signals-scout-*` tools. Most reads (runs,
+ # memory, project profile) are public-grantable via `signal_scout:read`; writes — and the member
+ # roster read — are sandbox-scope only via the internal `signal_scout_internal` scope object.
routers.projects.register(
r"signals/scout/runs", SignalScoutRunViewSet, "environment_signals_scout_runs", ["team_id"]
)
@@ -55,3 +56,11 @@ def register_routes(routers: RouterRegistry) -> None:
"environment_signals_scout_metadata",
["team_id"],
)
+ # Reviewer-routing roster. `signal_scout_internal:read` (internal scope) → sandbox-only, never in
+ # the public MCP catalog; the org-nested member tools the scoped-team token can't reach can't serve this.
+ routers.projects.register(
+ r"signals/scout/members",
+ SignalScoutMembersViewSet,
+ "environment_signals_scout_members",
+ ["team_id"],
+ )
diff --git a/products/signals/backend/scout_harness/AGENTS.md b/products/signals/backend/scout_harness/AGENTS.md
index c2eacada488d..24e7526fcc08 100644
--- a/products/signals/backend/scout_harness/AGENTS.md
+++ b/products/signals/backend/scout_harness/AGENTS.md
@@ -106,9 +106,21 @@ ACTIVITY_SLACK_S`, the activity-level ceiling that gates the workflow's
Annotated for drf-spectacular so the generated MCP tools have informative schemas.
- `views.py`
`SignalScoutRunViewSet`, `SignalScoutConfigViewSet`, `SignalScratchpadViewSet`,
- `SignalProjectProfileViewSet`, `SignalScoutMetadataViewSet`.
+ `SignalProjectProfileViewSet`, `SignalScoutMetadataViewSet`, `SignalScoutMembersViewSet`.
Routed under `environment_signals_scout_*` basenames in `posthog/api/__init__.py`
and exposed as `signals-scout-*` MCP tools via `products/signals/mcp/tools.yaml`.
+ `SignalScoutMembersViewSet` (`signals-scout-members-list`) is the reviewer-routing roster:
+ it returns the project's members (those with access to the team) with `user_uuid` / `email` /
+ `github_login` so a report-channel scout can populate `suggested_reviewers` at cold start. The roster
+ is member PII the scout needs to route, gated on the internal `signal_scout_internal` scope object
+ (`scope_object = "signal_scout_internal"`, default `list` → `signal_scout_internal:read`, satisfied by
+ the sandbox token's `…:write`) — so, like `emit-signal`, it is reachable only inside a scout run and
+ never enters a customer's public MCP catalog. (The narrower `signal_scout_report` scope was considered
+ but is transient — kept only while emit-signal and emit-report coexist — so the durable tool stays on
+ `signal_scout_internal`.) Membership is resolved server-side via
+ `report_generation/resolve_reviewers.list_project_members` (through `Team.all_users_with_access()`,
+ so private-project access control is honored), the project-nested path that the org-nested
+ `org-members-list` tool (stripped + 403'd for a scoped-team token) can't provide.
The config viewset is the no-wait creation path: `create` registers (upserts) a
config for an already-authored skill with its schedule/emit posture in one call.
`list` is strictly read-only (its MCP tool is annotated `readOnly`) — it never
diff --git a/products/signals/backend/scout_harness/prompt.py b/products/signals/backend/scout_harness/prompt.py
index b58ea1743550..02729687b02a 100644
--- a/products/signals/backend/scout_harness/prompt.py
+++ b/products/signals/backend/scout_harness/prompt.py
@@ -294,8 +294,11 @@ report your evidence bears on, then keep it current:
genuinely stale; lead the summary with the verdict (see *Writing the summary*).
- **Route an unrouted report.** If a report surfaced assigned to no one, set
`suggested_reviewers` to route it to an owner — each reviewer a bare lowercase
- `github_login`, or a PostHog `user_uuid` the server resolves for you. This
- replaces the report's reviewer list and re-runs autostart, so a report that
+ `github_login`, or a PostHog `user_uuid` the server resolves for you. If the owner
+ isn't already named in the report, call `signals-scout-members-list` to look up this
+ project's members (each carries a resolved `github_login`; the org-scoped
+ `org-member-get-github-login` / `org-members-list` tools aren't available in a scout
+ run). This replaces the report's reviewer list and re-runs autostart, so a report that
already has a repo + priority but lacked a qualifying reviewer can now open a draft
PR. Only set a reviewer you're confident owns the area; an empty list is a no-op.
- **Don't retry blindly.** `edit_report` is NOT idempotent — a retried
@@ -345,6 +348,13 @@ inbox, but it routes to no one, so it tends to sit unactioned.
guessed, mis-cased, or display-name handle reaches no one. When you only know the
owner as a PostHog member, pass their `user_uuid` and let the server resolve it
rather than inventing a handle.
+- **No owner in your evidence? List the members.** When the owner isn't already named in
+ what you gathered, call `signals-scout-members-list` to get this project's members —
+ each row carries the member's `email`, name, and resolved `github_login` (pass `search`
+ to narrow a big project). Match the owner by email/name and use their `github_login`; a
+ member whose `github_login` is null can't be routed to at all, so pick a different owner
+ or leave the field empty. The org-scoped `org-member-get-github-login` / `org-members-list`
+ tools are not available in a scout run — this is the in-run lookup path.
- **Set `priority` + `priority_explanation`** when the issue is concrete and you
can justify the urgency — autostart needs a priority to consider a draft PR.
- **Set `repository`** (`owner/repo`) when you know where a fix would land — pass
diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.py
index f9f77f5bc768..ac19b08ca8ff 100644
--- a/products/signals/backend/scout_harness/serializers.py
+++ b/products/signals/backend/scout_harness/serializers.py
@@ -1457,3 +1457,42 @@ class ScoutMetadataSerializer(serializers.Serializer):
help_text="Free-form announcement banner to show above the scout UI (e.g. alpha run-limit notice), or null when unset.",
)
limits = ScoutLimitsSerializer(help_text="The team's enforced scout run caps and current usage.")
+
+
+# --- Members (reviewer routing) --------------------------------------------
+
+
+class ScoutMembersQuerySerializer(serializers.Serializer):
+ """Query params for `signals-scout-members-list`."""
+
+ search = serializers.CharField(
+ required=False,
+ help_text=(
+ "Case-insensitive substring filter over member email and first/last name. Use it to narrow a "
+ "large project's roster to the owner you're trying to match instead of pulling every member."
+ ),
+ )
+
+
+class ScoutMemberSerializer(serializers.Serializer):
+ """One project member's routing identity, for picking a `suggested_reviewers` entry on a report."""
+
+ user_uuid = serializers.CharField(
+ help_text=(
+ "The member's stable PostHog user UUID — the same id that appears as `created_by.uuid` on "
+ "entities they own. A durable handle for this person across runs."
+ )
+ )
+ email = serializers.EmailField(help_text="The member's email — use to match a finding's owner by name/email.")
+ first_name = serializers.CharField(help_text="The member's first name (may be empty).")
+ last_name = serializers.CharField(help_text="The member's last name (may be empty).")
+ github_login = serializers.CharField(
+ allow_null=True,
+ help_text=(
+ "The member's resolved GitHub login (lowercased), already resolved server-side — put this value "
+ "in a report's `suggested_reviewers` once you've matched the finding's owner to this row. Null "
+ "when the member has no linked GitHub identity: a null-login member can't be routed to at all "
+ "(neither a login nor a uuid resolves), so pick a different owner or leave `suggested_reviewers` "
+ "empty."
+ ),
+ )
diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.py
index fe6acefdf5d4..849f1e1aa509 100644
--- a/products/signals/backend/scout_harness/views.py
+++ b/products/signals/backend/scout_harness/views.py
@@ -3,8 +3,8 @@
These wrap the sync Python tools in `scout_harness/tools/` so the headless scout
(and any other agent on the team's PostHog MCP) can call the `signals-scout-*`
tools — `runs-list`, `runs-retrieve`, `runs-findings-create`, `memory-list`,
-`memory-create`, `memory-delete`, and `project-profile-get` — over the standard
-PostHog MCP plumbing.
+`memory-create`, `memory-delete`, `project-profile-get`, and `members-list` — over
+the standard PostHog MCP plumbing.
Auth uses two dedicated scope objects: `signal_scout:read` is user-grantable
via the personal-API-key picker (so a team can introspect runs/scratchpad from
@@ -20,6 +20,7 @@ token is already pinned to the team.
from __future__ import annotations
import uuid
+import dataclasses
from dataclasses import dataclass
import structlog
@@ -50,6 +51,7 @@ from products.signals.backend.models import (
SignalScoutEmission,
SignalScoutRun,
)
+from products.signals.backend.report_generation.resolve_reviewers import MAX_PROJECT_MEMBERS, list_project_members
from products.signals.backend.scout_harness.config_registry import (
enabled_scout_count,
ensure_scout_category,
@@ -76,6 +78,8 @@ from products.signals.backend.scout_harness.serializers import (
RecentEmissionsQuerySerializer,
RememberRequestSerializer,
ScoutEmissionReportLinkSerializer,
+ ScoutMemberSerializer,
+ ScoutMembersQuerySerializer,
ScoutMetadataSerializer,
ScoutRunIdsBatchRequestSerializer,
ScratchpadEntrySerializer,
@@ -1087,6 +1091,66 @@ class SignalScoutMetadataViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet
return Response(ScoutMetadataSerializer(metadata.as_dict()).data)
+class SignalScoutMembersViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
+ """Project member roster for reviewer routing — sandbox-only.
+
+ `scope_object = "signal_scout_internal"` makes this a strictly scout-run-only surface: the object is
+ in `INTERNAL_API_SCOPE_OBJECTS`, so session auth, personal API keys, and the `*` consent wildcard are
+ all rejected (`posthog/permissions.py`), and only a harness sandbox OAuth token — which carries
+ `signal_scout_internal:write`, satisfying the default `list` action's `signal_scout_internal:read`
+ requirement (write implies read) — can reach it. The roster is member PII (emails, names, GitHub
+ logins), and this gate keeps it off every user-grantable credential and out of a customer's public MCP
+ catalog — the same internal-vs-external boundary as `emit-signal`, the other internal-scope scout tool.
+ The narrower `signal_scout_report` scope (report-channel scouts only) would tighten this to the tool's
+ sole consumer, but that scope is transient — a temporary split kept only while emit-signal and
+ emit-report coexist — so a durable tool stays on `signal_scout_internal` rather than coupling to a scope
+ slated for removal. The residual exposure (a baseline scout reading its own team's roster) is bounded to
+ the single-team sandbox token.
+
+ The roster is resolved server-side (a plain ORM read via `Team.all_users_with_access()`, not a DRF
+ request through the OAuth permission layer), which is why the org-nested `org-members-list` tool —
+ stripped from a scoped-team token's catalog and 403'd by the org-nested permission gate — can't serve
+ this and a project-nested tool can. Scoping through `all_users_with_access()` (not the whole org) keeps
+ a scout on a private project from enumerating members who lack access to it.
+ """
+
+ serializer_class = ScoutMemberSerializer
+ authentication_classes = [SessionAuthentication, PersonalAPIKeyAuthentication, OAuthAccessTokenAuthentication]
+ permission_classes = [IsAuthenticated, APIScopePermission]
+ scope_object = "signal_scout_internal"
+ # No team-scoped model backs this endpoint — members are resolved from project access. A queryset is
+ # still required to satisfy the team/org viewset mixin; `list` never reads it. Mirrors
+ # `SignalScoutMetadataViewSet`.
+ queryset = SignalScoutConfig.objects.unscoped()
+ pagination_class = None
+
+ @validated_request(
+ query_serializer=ScoutMembersQuerySerializer,
+ responses={
+ 200: OpenApiResponse(
+ response=ScoutMemberSerializer(many=True),
+ description="The project's members, each with their routing identity.",
+ ),
+ },
+ summary="List project members for reviewer routing",
+ description=(
+ "Return the people who can review work on this project — one row per member with access to it, "
+ "each with their `user_uuid`, `email`, `first_name`/`last_name`, and resolved GitHub `login` (null "
+ "when they have no linked GitHub identity). The cold-start reviewer-routing path: when a finding's "
+ "owner can't be read off a fetched entity's `created_by` and there's no cached `reviewer:<area>` "
+ "memory or inbox precedent, list members, match the owner by email/name, then put their resolved "
+ "`github_login` in `suggested_reviewers` on `emit-report` / `edit-report`. Pass `search` to narrow "
+ f"a large roster; the result is capped at {MAX_PROJECT_MEMBERS}. Strictly team-scoped."
+ ),
+ operation_id="signals_scout_members_list",
+ )
+ def list(self, request: Request, *args, **kwargs) -> Response:
+ validated = getattr(request, "validated_query_data", {}) or {}
+ canonical_team = self.team.parent_team or self.team
+ members = list_project_members(canonical_team, search=validated.get("search") or None)
+ return Response(ScoutMemberSerializer([dataclasses.asdict(member) for member in members], many=True).data)
+
+
def _reject_if_enabled_cap_reached(team_id: int, skill_name: str) -> None:
"""Raise when enabling this scout would push the team past the per-team enabled cap.
diff --git a/products/signals/backend/test/test_scout_harness.py b/products/signals/backend/test/test_scout_harness.py
index 93373ba44caa..0cbd63e58f97 100644
--- a/products/signals/backend/test/test_scout_harness.py
+++ b/products/signals/backend/test/test_scout_harness.py
@@ -217,9 +217,12 @@ class TestPromptBuilder(BaseTest):
assert "inbox-reports-list" in prompt
assert "Suggested reviewers route the report" in prompt
assert "suggested_reviewers" in prompt
- # Reviewer routing accepts a `user_uuid` (server-resolved to a GitHub login) so the prompt
- # steers the scout toward that route rather than guessing a handle.
+ # Reviewer routing accepts a `user_uuid` (server-resolved to a GitHub login), and when the
+ # owner isn't already in the evidence the prompt points the scout at the in-run
+ # `signals-scout-members-list` tool — so it must name both rather than letting it guess a
+ # handle or reach for the org-scoped resolver that's stripped from a scout run.
assert "user_uuid" in prompt
+ assert "signals-scout-members-list" in prompt
# The report channel teaches that the `report:` scratchpad entry is a pointer
# into the inbox, not a copy of the report — the inbox stays the source of
# truth, so the scout retrieves the live report before editing. Dropping this
@@ -267,6 +270,9 @@ class TestPromptBuilder(BaseTest):
assert "Suggested reviewers route the report" not in prompt
assert "Writing the report" not in prompt
assert "suggested_reviewers" in prompt
+ # An edit-only scout can still rescue an unrouted report's reviewers, so the editing guidance
+ # carries the in-run member lookup too — even though the standalone author-time deep-dive drops.
+ assert "signals-scout-members-list" in prompt
# Orchestration tests run as plain pytest functions because the async runner uses
diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.py
index 00f3c109216a..6a68b182374f 100644
--- a/products/signals/backend/test/test_scout_harness_api.py
+++ b/products/signals/backend/test/test_scout_harness_api.py
@@ -9,9 +9,12 @@ from django.apps import apps
from parameterized import parameterized
from rest_framework import status
+from social_django.models import UserSocialAuth
from posthog.models import OAuthApplication
+from posthog.models.organization import Organization
from posthog.models.team.team import Team
+from posthog.models.user import User
from posthog.temporal.oauth import (
ARRAY_APP_CLIENT_ID_DEV,
ARRAY_APP_CLIENT_ID_EU,
@@ -1423,3 +1426,66 @@ class TestScoutHarnessMetadataAPI(APIBaseTest):
_make_run(self.team)
body = self._get({"guaranteed_team_ids": [self.team.id], "default_team_config": {"max_runs_per_day": 5}}).json()
assert body["limits"]["runs_today"] == 1
+
+
+class TestScoutHarnessMembersAPI(APIBaseTest):
+ def setUp(self) -> None:
+ super().setUp()
+ _authenticate_as_scout(self)
+
+ def _url(self) -> str:
+ return f"/api/projects/{self.team.id}/signals/scout/members/"
+
+ def test_lists_project_members_with_resolved_github_login(self) -> None:
+ # self.user has a GitHub identity (login lowercased on resolution); a second member has
+ # none, so their `github_login` is null rather than dropping out of the roster.
+ UserSocialAuth.objects.create(user=self.user, provider="github", uid="gh-self", extra_data={"login": "OctoCat"})
+ User.objects.create_and_join(self.organization, "[email protected]", None, first_name="Sec")
+ response = self.client.get(self._url())
+ assert response.status_code == status.HTTP_200_OK
+ by_email = {row["email"]: row for row in response.json()}
+ assert by_email[self.user.email]["github_login"] == "octocat"
+ assert by_email[self.user.email]["user_uuid"] == str(self.user.uuid)
+ assert by_email["[email protected]"]["github_login"] is None
+
+ @parameterized.expand(
+ [
+ # a single token matches an email / one name part …
+ ("single_token", "alice", {"[email protected]"}),
+ # … and a full display name matches the concatenated first+last, not just one field —
+ # the case a naive per-field filter misses (regression guard for the search predicate).
+ ("full_display_name", "jane doe", {"[email protected]"}),
+ ]
+ )
+ def test_search_narrows_the_roster(self, _name: str, query: str, expected_emails: set[str]) -> None:
+ # `search` is the bound on a large roster — it must filter to matching email/name so a scout
+ # can pull just the owner instead of the whole directory. Case-insensitive substring.
+ User.objects.create_and_join(self.organization, "[email protected]", None, first_name="Alice")
+ User.objects.create_and_join(self.organization, "[email protected]", None, first_name="Jane", last_name="Doe")
+ response = self.client.get(self._url(), data={"search": query})
+ assert response.status_code == status.HTTP_200_OK
+ emails = {row["email"] for row in response.json()}
+ assert emails == expected_emails
+
+ def test_does_not_leak_members_from_another_org(self) -> None:
+ other_org = Organization.objects.create(name="Other Org")
+ User.objects.create_and_join(other_org, "[email protected]", None)
+ response = self.client.get(self._url())
+ assert response.status_code == status.HTTP_200_OK
+ emails = {row["email"] for row in response.json()}
+ assert self.user.email in emails
+ assert "[email protected]" not in emails
+
+ @parameterized.expand([("session", None), ("public_read_token", "read_only")])
+ def test_non_scout_auth_cannot_list_members(self, _name: str, scopes: PosthogMcpScopes | None) -> None:
+ # The roster (member PII) is gated on the internal `signal_scout_internal` scope object, so neither
+ # a logged-in session (the CSRF / PAK class) nor a public `read_only` MCP token — which carries no
+ # internal scope — can reach it; only a sandbox scout token can. Guards the internal-vs-external
+ # boundary: keeps member emails / logins off every user-grantable credential and the public catalog.
+ if scopes is None:
+ self.client.credentials()
+ self.client.force_login(self.user)
+ else:
+ _authenticate_as_scout(self, scopes=scopes)
+ response = self.client.get(self._url())
+ assert response.status_code == status.HTTP_403_FORBIDDEN
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index 3b1d069f28b2..a64cd627551e 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -488,6 +488,25 @@ export interface PatchedSignalScoutConfigApi {
readonly created_at?: string
}
+/**
+ * One project member's routing identity, for picking a `suggested_reviewers` entry on a report.
+ */
+export interface ScoutMemberApi {
+ /** The member's stable PostHog user UUID — the same id that appears as `created_by.uuid` on entities they own. A durable handle for this person across runs. */
+ user_uuid: string
+ /** The member's email — use to match a finding's owner by name/email. */
+ email: string
+ /** The member's first name (may be empty). */
+ first_name: string
+ /** The member's last name (may be empty). */
+ last_name: string
+ /**
+ * The member's resolved GitHub login (lowercased), already resolved server-side — put this value in a report's `suggested_reviewers` once you've matched the finding's owner to this row. Null when the member has no linked GitHub identity: a null-login member can't be routed to at all (neither a login nor a uuid resolves), so pick a different owner or leave `suggested_reviewers` empty.
+ * @nullable
+ */
+ github_login: string | null
+}
+
/**
* A team's enforced scout run caps and current usage.
*
@@ -1824,6 +1843,14 @@ export type SignalsReportArtefactsListParams = {
offset?: number
}
+export type SignalsScoutMembersListParams = {
+ /**
+ * Case-insensitive substring filter over member email and first/last name. Use it to narrow a large project's roster to the owner you're trying to match instead of pulling every member.
+ * @minLength 1
+ */
+ search?: string
+}
+
export type SignalsScoutProjectProfileGetParams = {
/**
* When true, skip the cache and rebuild the profile from authoritative sources before responding. Use after seeding events, importing data, or any other change the caller knows just landed but hasn't surfaced through natural cache expiry yet. Honored only for the internal scout token — public read callers get the cached profile regardless. Concurrent forced rebuilds are serialized by the team-keyed advisory lock — at most one extra `build_inventory` per simultaneous request.
diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.ts
index 615c737ea61f..1ec8d62215e2 100644
--- a/products/signals/frontend/generated/api.ts
+++ b/products/signals/frontend/generated/api.ts
@@ -31,6 +31,7 @@ import type {
ProjectProfileApi,
RememberRequestApi,
ScoutEmissionReportLinkApi,
+ ScoutMemberApi,
ScoutMetadataApi,
ScoutRunIdsBatchRequestApi,
ScratchpadEntryApi,
@@ -51,6 +52,7 @@ import type {
SignalsProcessingListParams,
SignalsReportArtefactsListParams,
SignalsReportsListParams,
+ SignalsScoutMembersListParams,
SignalsScoutProjectProfileGetParams,
SignalsScoutRunsListParams,
SignalsScoutRunsRecentEmissionsParams,
@@ -493,6 +495,37 @@ export const signalsScoutConfigSync = async (
})
}
+export const getSignalsScoutMembersListUrl = (projectId: string, params?: SignalsScoutMembersListParams) => {
+ const normalizedParams = new URLSearchParams()
+
+ Object.entries(params || {}).forEach(([key, value]) => {
+ if (value !== undefined) {
+ normalizedParams.append(key, value === null ? 'null' : String(value))
+ }
+ })
+
+ const stringifiedParams = normalizedParams.toString()
+
+ return stringifiedParams.length > 0
+ ? `/api/projects/${projectId}/signals/scout/members/?${stringifiedParams}`
+ : `/api/projects/${projectId}/signals/scout/members/`
+}
+
+/**
+ * Return the people who can review work on this project — one row per member with access to it, each with their `user_uuid`, `email`, `first_name`/`last_name`, and resolved GitHub `login` (null when they have no linked GitHub identity). The cold-start reviewer-routing path: when a finding's owner can't be read off a fetched entity's `created_by` and there's no cached `reviewer:<area>` memory or inbox precedent, list members, match the owner by email/name, then put their resolved `github_login` in `suggested_reviewers` on `emit-report` / `edit-report`. Pass `search` to narrow a large roster; the result is capped at 200. Strictly team-scoped.
+ * @summary List project members for reviewer routing
+ */
+export const signalsScoutMembersList = async (
+ projectId: string,
+ params?: SignalsScoutMembersListParams,
+ options?: RequestInit
+): Promise<ScoutMemberApi[]> => {
+ return apiMutator<ScoutMemberApi[]>(getSignalsScoutMembersListUrl(projectId, params), {
+ ...options,
+ method: 'GET',
+ })
+}
+
export const getSignalsScoutMetadataGetUrl = (projectId: string) => {
return `/api/projects/${projectId}/signals/scout/metadata/current/`
}
diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yaml
index f427f5b3f16b..13b142037dbf 100644
--- a/products/signals/mcp/tools.yaml
+++ b/products/signals/mcp/tools.yaml
@@ -465,6 +465,25 @@ tools:
`Signal.source_id = run:<id>:finding:<id>` for traceability, but this is NOT idempotent — a second call with
the same `finding_id` emits a second signal, so emit each finding exactly once and never retry an emit.
Findings should carry `tags` — see the `tags` param for the slug and taxonomy convention.
+ signals-scout-members-list:
+ operation: signals_scout_members_list
+ enabled: true
+ scopes:
+ - signal_scout_internal:read
+ annotations:
+ readOnly: true
+ destructive: false
+ idempotent: true
+ list: true
+ title: List project members for reviewer routing
+ description: >
+ Return the people who can review work on this project — one row per member with access to it, each with
+ their `user_uuid`, `email`, `first_name`/`last_name`, and resolved GitHub `login` (null when they have no
+ linked GitHub identity). The cold-start reviewer-routing path: when a finding's owner can't be read off a
+ fetched entity's `created_by` and there's no cached `reviewer:<area>` memory or inbox precedent, list
+ members, match the owner by email/name, then put their resolved `github_login` in `suggested_reviewers` on
+ `signals-scout-emit-report` / `signals-scout-edit-report` (a member with a null `github_login` can't be
+ routed to — pick another owner). Pass `search` to narrow a large roster. Strictly team-scoped.
signals-scout-metadata-get:
operation: signals_scout_metadata_get
enabled: false
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index ebe2c26b2a9c..8fdd2d8ccfdf 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -6654,6 +6654,20 @@
"readOnlyHint": false
}
},
+ "signals-scout-members-list": {
+ "description": "Return the people who can review work on this project — one row per member with access to it, each with their `user_uuid`, `email`, `first_name`/`last_name`, and resolved GitHub `login` (null when they have no linked GitHub identity). The cold-start reviewer-routing path: when a finding's owner can't be read off a fetched entity's `created_by` and there's no cached `reviewer:<area>` memory or inbox precedent, list members, match the owner by email/name, then put their resolved `github_login` in `suggested_reviewers` on `signals-scout-emit-report` / `signals-scout-edit-report` (a member with a null `github_login` can't be routed to — pick another owner). Pass `search` to narrow a large roster. Strictly team-scoped.",
+ "category": "Signals",
+ "feature": "signals",
+ "summary": "List project members for reviewer routing",
+ "title": "List project members for reviewer routing",
+ "required_scopes": ["signal_scout_internal:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ }
+ },
"signals-scout-project-profile-get": {
"description": "Return a deterministic snapshot of \"what's true about this project\" — products in use, product intents (stuck onboardings), connected integrations, warehouse sources, signal source configs (split enabled/disabled), and existing inbox report counts. Singleton per team; the response reflects either the newest non-expired cached profile or a freshly-built one. Read this once at the start of a run (right after `skill-get`) to orient on the team in one tool call instead of paginating through `inbox-source-configs-list` / `inbox-reports-list` / `read-data-schema` / `activity-log-list`. Distinct from `signals-scout-scratchpad-list`: profile is ground truth from authoritative tables; scratchpad is the scout's inferred learnings.",
"category": "Signals",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 3bad6b47ba9e..a83ed2b4b3a6 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -7165,6 +7165,20 @@
"readOnlyHint": false
}
},
+ "signals-scout-members-list": {
+ "description": "Return the people who can review work on this project — one row per member with access to it, each with their `user_uuid`, `email`, `first_name`/`last_name`, and resolved GitHub `login` (null when they have no linked GitHub identity). The cold-start reviewer-routing path: when a finding's owner can't be read off a fetched entity's `created_by` and there's no cached `reviewer:<area>` memory or inbox precedent, list members, match the owner by email/name, then put their resolved `github_login` in `suggested_reviewers` on `signals-scout-emit-report` / `signals-scout-edit-report` (a member with a null `github_login` can't be routed to — pick another owner). Pass `search` to narrow a large roster. Strictly team-scoped.",
+ "category": "Signals",
+ "feature": "signals",
+ "summary": "List project members for reviewer routing",
+ "title": "List project members for reviewer routing",
+ "required_scopes": ["signal_scout_internal:read"],
+ "annotations": {
+ "destructiveHint": false,
+ "idempotentHint": true,
+ "openWorldHint": true,
+ "readOnlyHint": true
+ }
+ },
"signals-scout-project-profile-get": {
"description": "Return a deterministic snapshot of \"what's true about this project\" — products in use, product intents (stuck onboardings), connected integrations, warehouse sources, signal source configs (split enabled/disabled), and existing inbox report counts. Singleton per team; the response reflects either the newest non-expired cached profile or a freshly-built one. Read this once at the start of a run (right after `skill-get`) to orient on the team in one tool call instead of paginating through `inbox-source-configs-list` / `inbox-reports-list` / `read-data-schema` / `activity-log-list`. Distinct from `signals-scout-scratchpad-list`: profile is ground truth from authoritative tables; scratchpad is the scout's inferred learnings.",
"category": "Signals",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 83db24ebb888..24bb3e9c3315 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -47190,6 +47190,25 @@ export namespace Schemas {
runs_remaining_today: number | null;
}
+ /**
+ * One project member's routing identity, for picking a `suggested_reviewers` entry on a report.
+ */
+ export interface ScoutMember {
+ /** The member's stable PostHog user UUID — the same id that appears as `created_by.uuid` on entities they own. A durable handle for this person across runs. */
+ user_uuid: string;
+ /** The member's email — use to match a finding's owner by name/email. */
+ email: string;
+ /** The member's first name (may be empty). */
+ first_name: string;
+ /** The member's last name (may be empty). */
+ last_name: string;
+ /**
+ * The member's resolved GitHub login (lowercased), already resolved server-side — put this value in a report's `suggested_reviewers` once you've matched the finding's owner to this row. Null when the member has no linked GitHub identity: a null-login member can't be routed to at all (neither a login nor a uuid resolves), so pick a different owner or leave `suggested_reviewers` empty.
+ * @nullable
+ */
+ github_login: string | null;
+ }
+
/**
* Team-scoped scout metadata for the inbox / Code-app UIs: enrollment, the alpha banner, and
* the enforced limits. Sourced from the `signals-scout` flag payload so the banner and caps can
@@ -65185,6 +65204,14 @@ export namespace Schemas {
offset?: number;
};
+ export type SignalsScoutMembersListParams = {
+ /**
+ * Case-insensitive substring filter over member email and first/last name. Use it to narrow a large project's roster to the owner you're trying to match instead of pulling every member.
+ * @minLength 1
+ */
+ search?: string;
+ };
+
export type SignalsScoutProjectProfileGetParams = {
/**
* When true, skip the cache and rebuild the profile from authoritative sources before responding. Use after seeding events, importing data, or any other change the caller knows just landed but hasn't surfaced through natural cache expiry yet. Honored only for the internal scout token — public read callers get the cached profile regardless. Concurrent forced rebuilds are serialized by the team-keyed advisory lock — at most one extra `build_inventory` per simultaneous request.
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index 5f9044dbfab5..3424aaec2f2d 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -3,7 +3,7 @@
* MCP service uses these Zod schemas for generated tool handlers.
* To regenerate: hogli build:openapi
*
- * PostHog API - MCP 31 enabled ops
+ * PostHog API - MCP 32 enabled ops
* OpenAPI spec version: 1.0.0
*/
import * as zod from 'zod'
@@ -462,6 +462,28 @@ export const SignalsScoutConfigSyncParams = /* @__PURE__ */ zod.object({
),
})
+/**
+ * Return the people who can review work on this project — one row per member with access to it, each with their `user_uuid`, `email`, `first_name`/`last_name`, and resolved GitHub `login` (null when they have no linked GitHub identity). The cold-start reviewer-routing path: when a finding's owner can't be read off a fetched entity's `created_by` and there's no cached `reviewer:<area>` memory or inbox precedent, list members, match the owner by email/name, then put their resolved `github_login` in `suggested_reviewers` on `emit-report` / `edit-report`. Pass `search` to narrow a large roster; the result is capped at 200. Strictly team-scoped.
+ * @summary List project members for reviewer routing
+ */
+export const SignalsScoutMembersListParams = /* @__PURE__ */ zod.object({
+ project_id: zod
+ .string()
+ .describe(
+ "Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/."
+ ),
+})
+
+export const SignalsScoutMembersListQueryParams = /* @__PURE__ */ zod.object({
+ search: zod
+ .string()
+ .min(1)
+ .optional()
+ .describe(
+ "Case-insensitive substring filter over member email and first/last name. Use it to narrow a large project's roster to the owner you're trying to match instead of pulling every member."
+ ),
+})
+
/**
* Return the team's deterministic project profile. For the internal scout token the response reflects the newest non-expired cached row or a freshly-built one (lazy compute on cache miss); `force_refresh=true` skips the cache and rebuilds from authoritative sources. Public read callers (session auth or a `signal_scout:read` PAK) get the newest cached profile, or 404 if none has been built yet — they never trigger a rebuild. Read this at the start of a run to orient on the team's product mix, integrations, warehouse sources, signal coverage, and existing inbox surface.
* @summary Get the current project profile
diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.ts
index ef988f12745d..f1ce92e52eff 100644
--- a/services/mcp/src/tools/generated/signals.ts
+++ b/services/mcp/src/tools/generated/signals.ts
@@ -27,6 +27,7 @@ import {
SignalsScoutEmitReportParams,
SignalsScoutEmitSignalBody,
SignalsScoutEmitSignalParams,
+ SignalsScoutMembersListQueryParams,
SignalsScoutProjectProfileGetQueryParams,
SignalsScoutRunsEmissionReportsParams,
SignalsScoutRunsEmissionsParams,
@@ -718,6 +719,27 @@ const signalsScoutEmitSignal = (): ToolBase<typeof SignalsScoutEmitSignalSchema,
},
})
+const SignalsScoutMembersListSchema = SignalsScoutMembersListQueryParams
+
+const signalsScoutMembersList = (): ToolBase<
+ typeof SignalsScoutMembersListSchema,
+ WithPostHogUrl<Schemas.ScoutMember[]>
+> => ({
+ name: 'signals-scout-members-list',
+ schema: SignalsScoutMembersListSchema,
+ handler: async (context: Context, params: z.infer<typeof SignalsScoutMembersListSchema>) => {
+ const projectId = await context.stateManager.getProjectId()
+ const result = await context.api.request<Schemas.ScoutMember[]>({
+ method: 'GET',
+ path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/scout/members/`,
+ query: {
+ search: params.search,
+ },
+ })
+ return await withPostHogUrl(context, result, '/inbox')
+ },
+})
+
const SignalsScoutProjectProfileGetSchema = SignalsScoutProjectProfileGetQueryParams
const signalsScoutProjectProfileGet = (): ToolBase<
@@ -942,6 +964,7 @@ export const GENERATED_TOOLS: Record<string, () => ToolBase<ZodObjectAny>> = {
'signals-scout-edit-report': signalsScoutEditReport,
'signals-scout-emit-report': signalsScoutEmitReport,
'signals-scout-emit-signal': signalsScoutEmitSignal,
+ 'signals-scout-members-list': signalsScoutMembersList,
'signals-scout-project-profile-get': signalsScoutProjectProfileGet,
'signals-scout-runs-emission-reports': signalsScoutRunsEmissionReports,
'signals-scout-runs-emissions-list': signalsScoutRunsEmissionsList,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-members-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-members-list.json
new file mode 100644
index 000000000000..7e9b8c54f37b
--- /dev/null
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-members-list.json
@@ -0,0 +1,11 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "properties": {
+ "search": {
+ "description": "Case-insensitive substring filter over member email and first/last name. Use it to narrow a large project's roster to the owner you're trying to match instead of pulling every member.",
+ "minLength": 1,
+ "type": "string"
+ }
+ },
+ "type": "object"
+}