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): filter analytics alert signals by allow and block patterns (#129712)

posthog[bot]c276300ff0f1
diff --git a/posthog/temporal/ai/anomaly_investigation/workflow.py b/posthog/temporal/ai/anomaly_investigation/workflow.py
index 58fb777ee2cc..a25d63de7bab 100644
--- a/posthog/temporal/ai/anomaly_investigation/workflow.py
+++ b/posthog/temporal/ai/anomaly_investigation/workflow.py
@@ -55,6 +55,11 @@ from products.notebooks.backend.facade.content import build_markdown_notebook_co
from products.notebooks.backend.facade.contracts import NotebookData
from products.product_analytics.backend.facade.api import insights_including_soft_deleted_for_team
from products.signals.backend.facade import api as signals
+from products.signals.backend.facade.source_configs import (
+ AlertFilterOutcome,
+ evaluate_alert_filter,
+ get_analytics_alert_name_patterns,
+)
if TYPE_CHECKING:
from products.product_analytics.backend.facade.models import Insight
@@ -286,6 +291,17 @@ async def investigate_anomaly_activity(inputs: AnomalyInvestigationWorkflowInput
return deliveries
try:
+ # Inside the try, so a failed read of the filter drops the signal instead of failing the activity.
+ filter_outcome = await sync_to_async(_alert_filter_outcome, thread_sensitive=False)(alert, insight)
+ if filter_outcome != AlertFilterOutcome.PASSED:
+ logger.info(
+ "anomaly_investigation.signal_skipped",
+ alert_id=str(alert.id),
+ **_subject_ids(subject),
+ verdict=result.report.verdict,
+ reason="filter_invalid" if filter_outcome == AlertFilterOutcome.INVALID else "filtered",
+ )
+ return deliveries
await _emit_investigation_signal(
team=team,
alert=alert,
@@ -416,6 +432,14 @@ def _subject_ids(subject: AlertCheck | InsightAlertInvestigation) -> dict[str, s
return {"alert_check_id": str(subject.id)}
+def _alert_filter_outcome(alert: AlertConfiguration, insight: Insight) -> AlertFilterOutcome:
+ return evaluate_alert_filter(
+ get_analytics_alert_name_patterns(team_id=alert.team_id),
+ alert_name=alert.name,
+ insight_name=insight.name or insight.derived_name,
+ )
+
+
def should_emit_investigation_signal(verdict: str | None, inconclusive_action: str | None) -> bool:
"""Whether a completed investigation should surface in the Signals inbox.
diff --git a/posthog/temporal/alerts/alert_firing_signal.py b/posthog/temporal/alerts/alert_firing_signal.py
index 6673927de402..2fe035915cec 100644
--- a/posthog/temporal/alerts/alert_firing_signal.py
+++ b/posthog/temporal/alerts/alert_firing_signal.py
@@ -23,13 +23,19 @@ from posthog.utils import absolute_uri
from products.alerts.backend.models.alert import AlertCheck, AlertConfiguration
from products.signals.backend.facade.api import emit_signal
from products.signals.backend.facade.signal_extras import AnalyticsAlertFiringSignalExtra
-from products.signals.backend.facade.source_configs import get_analytics_alert_scope, get_source_config
+from products.signals.backend.facade.source_configs import (
+ AlertFilterOutcome,
+ evaluate_alert_filter,
+ get_analytics_alert_name_patterns,
+ get_analytics_alert_scope,
+ get_source_config,
+)
logger = structlog.get_logger(__name__)
SIGNAL_SOURCE_PRODUCT = "analytics"
SIGNAL_SOURCE_TYPE = "alert_firing"
-# The product analytics source row. Its `enabled` flag and `alert_scope` key govern this signal too.
+# The product analytics source row. Its `enabled` flag and its alert config keys govern this signal too.
_SOURCE_CONFIG_TYPE = "anomaly_investigation"
_ALL_FIRING_ALERTS = "all_firing_alerts"
@@ -50,6 +56,9 @@ class AlertFiringSkipReason(enum.StrEnum):
INVESTIGATED = "investigated"
SOURCE_DISABLED = "source_disabled"
SCOPE = "scope"
+ FILTERED = "filtered"
+ # Logged apart from FILTERED, so a broken filter that drops every alert is not read as a quiet one.
+ FILTER_INVALID = "filter_invalid"
CAP = "cap"
CAP_UNAVAILABLE = "cap_unavailable"
NOT_DISPATCHED = "not_dispatched"
@@ -182,6 +191,15 @@ def _prepare(
return AlertFiringSkipReason.SCOPE, None
if previous_state == AlertState.ERRORED and _resumes_interrupted_episode(alert, alert_check):
return AlertFiringSkipReason.NOT_NEW_EPISODE, None
+ filter_outcome = evaluate_alert_filter(
+ get_analytics_alert_name_patterns(team_id=alert.team_id),
+ alert_name=alert.name,
+ insight_name=alert.insight.name or alert.insight.derived_name,
+ )
+ if filter_outcome == AlertFilterOutcome.INVALID:
+ return AlertFiringSkipReason.FILTER_INVALID, None
+ if filter_outcome != AlertFilterOutcome.PASSED:
+ return AlertFiringSkipReason.FILTERED, None
team = alert.team
# `emit_signal` reads the organization for its consent gate. Loading it here keeps that read off the event loop.
diff --git a/posthog/temporal/tests/ai/test_anomaly_investigation_verdict.py b/posthog/temporal/tests/ai/test_anomaly_investigation_verdict.py
index dbd8778477c5..9568768ab3c9 100644
--- a/posthog/temporal/tests/ai/test_anomaly_investigation_verdict.py
+++ b/posthog/temporal/tests/ai/test_anomaly_investigation_verdict.py
@@ -35,6 +35,7 @@ from products.exports.backend.models.exported_asset import ExportedAsset
from products.notebooks.backend.facade.content import is_markdown_notebook_content
from products.notebooks.backend.models import Notebook
from products.product_analytics.backend.facade.models import Insight
+from products.signals.backend.facade.source_configs import AlertNamePatterns
class TestInvestigationVerdictPersistence(NonAtomicBaseTest):
@@ -147,6 +148,14 @@ class TestInvestigationVerdictPersistence(NonAtomicBaseTest):
# A suppressed notification must not pay for a chart render.
mock_render.assert_not_called()
+ @parameterized.expand(
+ [
+ ("no_patterns", AlertNamePatterns(), True),
+ ("allowed_by_the_insight_name", AlertNamePatterns(allow=("^test insight$",)), True),
+ ("blocked_by_the_alert_name", AlertNamePatterns(allow=("insight",), block=("^anomaly",)), False),
+ ("invalid_stored_patterns", AlertNamePatterns(invalid=True), False),
+ ]
+ )
@pytest.mark.asyncio
@patch("posthog.temporal.ai.anomaly_investigation.workflow.prepare_alert_insight_chart_url", return_value=None)
@patch("posthog.temporal.ai.anomaly_investigation.workflow.signals.emit_signal")
@@ -154,7 +163,15 @@ class TestInvestigationVerdictPersistence(NonAtomicBaseTest):
@patch("temporalio.activity.heartbeat")
@patch("temporalio.activity.info")
async def test_completed_investigation_emits_signal(
- self, mock_info, _heartbeat, mock_run, mock_emit, _prepare
+ self,
+ _name: str,
+ patterns: AlertNamePatterns,
+ expected: bool,
+ mock_info,
+ _heartbeat,
+ mock_run,
+ mock_emit,
+ _prepare,
) -> None:
mock_info.return_value.heartbeat_timeout = None
mock_run.return_value = InvestigationRunResult(
@@ -168,15 +185,22 @@ class TestInvestigationVerdictPersistence(NonAtomicBaseTest):
model="test-model",
)
- await investigate_anomaly_activity(
- AnomalyInvestigationWorkflowInputs(
- team_id=self.team.id,
- alert_id=self.alert.id,
- alert_check_id=self.alert_check.id,
- user_id=self.user.id,
+ with patch(
+ "posthog.temporal.ai.anomaly_investigation.workflow.get_analytics_alert_name_patterns",
+ return_value=patterns,
+ ):
+ await investigate_anomaly_activity(
+ AnomalyInvestigationWorkflowInputs(
+ team_id=self.team.id,
+ alert_id=self.alert.id,
+ alert_check_id=self.alert_check.id,
+ user_id=self.user.id,
+ )
)
- )
+ if not expected:
+ mock_emit.assert_not_awaited()
+ return
mock_emit.assert_awaited_once()
kwargs = mock_emit.await_args.kwargs
assert kwargs["source_product"] == "analytics"
diff --git a/posthog/temporal/tests/test_alerts_alert_firing_signal.py b/posthog/temporal/tests/test_alerts_alert_firing_signal.py
index 2ac6e36f9c5a..526b162a16ee 100644
--- a/posthog/temporal/tests/test_alerts_alert_firing_signal.py
+++ b/posthog/temporal/tests/test_alerts_alert_firing_signal.py
@@ -16,7 +16,7 @@ from posthog.token_bucket import Budget, TEST_reset_scripts
from products.alerts.backend.models.alert import AlertCheck, AlertConfiguration
from products.product_analytics.backend.facade.models import Insight
from products.signals.backend.facade.api import validate_signal_input
-from products.signals.backend.facade.source_configs import SignalSourceConfigSnapshot
+from products.signals.backend.facade.source_configs import AlertNamePatterns, SignalSourceConfigSnapshot
_MODULE = "posthog.temporal.alerts.alert_firing_signal"
@@ -81,6 +81,7 @@ class TestEmitAlertFiringSignal(BaseTest):
previous_state: str = AlertState.NOT_FIRING,
scope: str = "all_firing_alerts",
source_enabled: bool | None = True,
+ patterns: AlertNamePatterns | None = None,
emit: AsyncMock | None = None,
) -> tuple[bool, AsyncMock]:
emit = emit or AsyncMock(side_effect=_validated_emit)
@@ -91,6 +92,7 @@ class TestEmitAlertFiringSignal(BaseTest):
return_value=None if source_enabled is None else _source(source_enabled),
),
patch(f"{_MODULE}.get_analytics_alert_scope", return_value=scope),
+ patch(f"{_MODULE}.get_analytics_alert_name_patterns", return_value=patterns or AlertNamePatterns()),
):
signal = prepare_alert_firing_signal(
alert, check, previous_state=previous_state, breaches=["The value is above the threshold"]
@@ -124,6 +126,12 @@ class TestEmitAlertFiringSignal(BaseTest):
("default_scope", {}, {"scope": "investigated_only"}, False),
("source_disabled", {}, {"source_enabled": False}, False),
("no_source_row", {}, {"source_enabled": None}, False),
+ (
+ "allow_pattern_matching_the_insight_name",
+ {},
+ {"patterns": AlertNamePatterns(allow=("^Daily",))},
+ True,
+ ),
]
)
def test_emits_once_per_episode_only_when_every_gate_passes(
@@ -165,3 +173,22 @@ class TestEmitAlertFiringSignal(BaseTest):
emitted, _ = self._emit(*second)
assert emitted is second_expected
+
+ @parameterized.expand(
+ [
+ ("blocked_by_the_alert_name", AlertNamePatterns(block=("dropped$",))),
+ ("not_allowed", AlertNamePatterns(allow=("(?i)checkout",))),
+ ("invalid_stored_patterns", AlertNamePatterns(invalid=True)),
+ ]
+ )
+ def test_filtered_alert_emits_nothing_and_spends_no_cap(self, _name: str, patterns: AlertNamePatterns) -> None:
+ filtered = self._alert_and_check()
+ passing = self._alert_and_check()
+
+ with patch(f"{_MODULE}.CAP_BUDGET", Budget(burst=1, per_hour=1)):
+ filtered_emitted, filtered_emit = self._emit(*filtered, patterns=patterns)
+ passing_emitted, _ = self._emit(*passing)
+
+ assert filtered_emitted is False
+ filtered_emit.assert_not_awaited()
+ assert passing_emitted is True
diff --git a/products/signals/ARCHITECTURE.md b/products/signals/ARCHITECTURE.md
index affb60de9e47..38cf7ceb3fa9 100644
--- a/products/signals/ARCHITECTURE.md
+++ b/products/signals/ARCHITECTURE.md
@@ -681,6 +681,9 @@ Per-team configuration for which signal sources are enabled.
With `all_firing_alerts`, insight alert evaluation (`posthog/temporal/alerts/alert_firing_signal.py`) emits `analytics` / `alert_firing` when an alert that the investigation agent does not investigate starts a firing episode. It emits once per episode (source id and idempotency key `<alert id>:<first check id>`), and a failure never changes the check. The evaluation thread runs the gates after the check is committed. The activity awaits the emission on its event loop once that thread returns, because `emit_signal` needs the default executor that the thread runs on. A per-team token bucket caps it, and an unavailable bucket skips the signal. Each skip after a read logs `alert_firing.signal_skipped` with a reason. Alerts the agent investigates keep the verdict gate in both scopes.
`alert_firing` has no config row of its own: `is_source_enabled` checks the `anomaly_investigation` row for it, so the one product analytics toggle turns both off.
Guidance written on that row filters both `anomaly_investigation` and `alert_firing`, through the direct steering gate.
+ The same row accepts `config.alert_allow_patterns` and `config.alert_block_patterns`: lists of RE2 patterns (at most `ALERT_PATTERNS_MAX_COUNT`, each at most `ALERT_PATTERN_MAX_LENGTH` characters) matched with search semantics against the alert name and the insight name. When allow patterns are set an alert must match one, and a block match drops the alert even when it also matches an allow pattern. The serializer rejects a pattern that does not compile, and rejects both keys on every other source.
+ Both signal paths read them through `facade.source_configs.get_analytics_alert_name_patterns(team_id=...)` and decide with the pure `evaluate_alert_filter`. The read ignores the patterns while the `signals-analytics-all-alerts` flag is off. It fails closed: a stored list that no longer validates, or a flag check that raises, drops every alert.
+ `alert_firing` applies the filter after the scope and episode gates and before it charges the cap, so a filtered alert spends no token and makes no guidance call, and logs `filtered` or `filter_invalid`. The investigation workflow applies it after the verdict gate and before `emit_signal`, with the same two reasons on `anomaly_investigation.signal_skipped`. The filter decides only what reaches the inbox, not alert evaluation, notifications, or whether the agent runs.
- The serializer exposes a computed `status` field:
- data-import-backed sources (`github`, `linear`, `zendesk`) derive status from `ExternalDataSchema`
- The `signals_scout` source variant pairs with `source_type=cross_source_issue` and is the emission channel used by the headless Signals agent's `emit_signal_*` tools. It is the only `(source_product, source_type)` pair the agent emits today.
diff --git a/products/signals/backend/contracts.py b/products/signals/backend/contracts.py
index 5e7f97411c3f..012aa3e0ebfd 100644
--- a/products/signals/backend/contracts.py
+++ b/products/signals/backend/contracts.py
@@ -7,6 +7,7 @@ import enum
from collections.abc import Mapping
from typing import Annotated, Literal, get_args
+import re2
from pydantic import BaseModel, ConfigDict, Field
from pydantic.fields import FieldInfo
@@ -61,6 +62,36 @@ class AlertScope(enum.StrEnum):
ALL_FIRING_ALERTS = "all_firing_alerts"
+# ── Alert name patterns ─────────────────────────────────────────────────────────
+# Patterns matched against a firing alert's name and its insight's name. Only `ALERT_SCOPE_SOURCE` accepts them.
+# They compile with RE2, which runs in linear time, so a user pattern cannot stall a worker as `re` can.
+ALERT_ALLOW_PATTERNS_KEY = "alert_allow_patterns"
+ALERT_BLOCK_PATTERNS_KEY = "alert_block_patterns"
+ALERT_PATTERNS_MAX_COUNT = 20
+ALERT_PATTERN_MAX_LENGTH = 200
+
+
+def alert_patterns_problem(value: object) -> str | None:
+ """Why `value` is not a valid pattern list, or None when it is. The API rejects the value with
+ this message, and the signal paths drop every alert when a stored list fails it."""
+ if not isinstance(value, list) or not all(isinstance(pattern, str) and pattern for pattern in value):
+ return "must be a list of non-empty strings"
+ if len(value) > ALERT_PATTERNS_MAX_COUNT:
+ return f"must have at most {ALERT_PATTERNS_MAX_COUNT} patterns"
+ for pattern in value:
+ if len(pattern) > ALERT_PATTERN_MAX_LENGTH:
+ return f"patterns must be at most {ALERT_PATTERN_MAX_LENGTH} characters"
+ try:
+ re2.compile(pattern)
+ except re2.error as error:
+ # RE2 raises with the parser message as bytes, which would print as a `b'...'` literal.
+ detail = error.args[0] if error.args else ""
+ if isinstance(detail, bytes):
+ detail = detail.decode(errors="replace")
+ return f"pattern {pattern!r} is not a valid RE2 regex: {detail}"
+ return None
+
+
# The sources that emit straight through `emit_signal` and still honor steering, via the gate in
# `emission/direct_gate.py`. Every other direct source skips the gate, so writing steering onto its
# row would store text nothing reads. The roster's `steerable` flags in `agentRosterMeta.ts` mirror
diff --git a/products/signals/backend/facade/source_configs.py b/products/signals/backend/facade/source_configs.py
index bdfb53e886a8..d933bbd3d3f5 100644
--- a/products/signals/backend/facade/source_configs.py
+++ b/products/signals/backend/facade/source_configs.py
@@ -1,14 +1,23 @@
"""Reads of a team's per-source signal config rows, for products that own a signal source."""
+import enum
from collections.abc import Sequence
+import re2
import structlog
from posthog.dataclasses import frozen
from posthog.models.team.team import Team
from posthog.ph_client import feature_enabled_or_false
-from products.signals.backend.contracts import ALERT_SCOPE_KEY, ALERT_SCOPE_SOURCE, AlertScope
+from products.signals.backend.contracts import (
+ ALERT_ALLOW_PATTERNS_KEY,
+ ALERT_BLOCK_PATTERNS_KEY,
+ ALERT_SCOPE_KEY,
+ ALERT_SCOPE_SOURCE,
+ AlertScope,
+ alert_patterns_problem,
+)
from products.signals.backend.models import SignalSourceConfig
logger = structlog.get_logger(__name__)
@@ -85,8 +94,87 @@ def get_analytics_alert_scope(*, team_id: int) -> AlertScope:
return scope
+@frozen
+class AlertNamePatterns:
+ """The analytics source's allow and block patterns for firing insight alerts."""
+
+ allow: tuple[str, ...] = ()
+ block: tuple[str, ...] = ()
+ # The stored patterns could not be read or validated, so callers drop every alert.
+ invalid: bool = False
+
+
+class AlertFilterOutcome(enum.StrEnum):
+ PASSED = "passed"
+ BLOCKED = "blocked"
+ NOT_ALLOWED = "not_allowed"
+ INVALID = "invalid"
+
+
+def get_analytics_alert_name_patterns(*, team_id: int) -> AlertNamePatterns:
+ """The allow and block patterns of the team's analytics source.
+
+ The result is empty, so every alert passes, when the row or both keys are missing and when the
+ rollout flag is off for the team's organization. It fails closed: when a stored list is not a list
+ of valid patterns, or the flag check raises, the result is `invalid`, and `evaluate_alert_filter`
+ then drops every alert.
+ """
+ source_product, source_type = ALERT_SCOPE_SOURCE
+ snapshot = get_source_config(team_id=team_id, source_product=source_product, source_type=source_type)
+ if snapshot is None:
+ return AlertNamePatterns()
+ config = snapshot.config
+ if ALERT_ALLOW_PATTERNS_KEY not in config and ALERT_BLOCK_PATTERNS_KEY not in config:
+ return AlertNamePatterns()
+ flag_enabled = _analytics_all_alerts_flag(team_id)
+ if flag_enabled is None:
+ return AlertNamePatterns(invalid=True)
+ if not flag_enabled:
+ return AlertNamePatterns()
+ raw_allow = config.get(ALERT_ALLOW_PATTERNS_KEY, [])
+ raw_block = config.get(ALERT_BLOCK_PATTERNS_KEY, [])
+ if not (
+ isinstance(raw_allow, list)
+ and isinstance(raw_block, list)
+ and alert_patterns_problem(raw_allow) is None
+ and alert_patterns_problem(raw_block) is None
+ ):
+ return AlertNamePatterns(invalid=True)
+ return AlertNamePatterns(allow=tuple(raw_allow), block=tuple(raw_block))
+
+
+def evaluate_alert_filter(
+ patterns: AlertNamePatterns, *, alert_name: str | None, insight_name: str | None
+) -> AlertFilterOutcome:
+ """Whether a firing alert passes the source's patterns. Block wins over allow.
+
+ A pattern matches when it finds a match anywhere in the alert name or the insight name. An empty
+ allow list admits every alert. A pattern that does not compile drops the alert.
+ """
+ if patterns.invalid:
+ return AlertFilterOutcome.INVALID
+ names = [name for name in (alert_name, insight_name) if name]
+ try:
+ if _any_pattern_matches(patterns.block, names):
+ return AlertFilterOutcome.BLOCKED
+ if patterns.allow and not _any_pattern_matches(patterns.allow, names):
+ return AlertFilterOutcome.NOT_ALLOWED
+ except re2.error:
+ return AlertFilterOutcome.INVALID
+ return AlertFilterOutcome.PASSED
+
+
+def _any_pattern_matches(patterns: Sequence[str], names: Sequence[str]) -> bool:
+ return any(re2.search(pattern, name) for pattern in patterns for name in names)
+
+
def _analytics_all_alerts_enabled(team_id: int) -> bool:
# Fails closed: a flag-service error keeps the team on the default scope.
+ return _analytics_all_alerts_flag(team_id) is True
+
+
+def _analytics_all_alerts_flag(team_id: int) -> bool | None:
+ """The rollout flag for the team's organization, or None when the flag check raised."""
try:
organization_id = str(Team.objects.values_list("organization_id", flat=True).get(id=team_id))
return feature_enabled_or_false(
@@ -99,4 +187,4 @@ def _analytics_all_alerts_enabled(team_id: int) -> bool:
)
except Exception:
logger.exception("signals.alert_scope.flag_check_failed", team_id=team_id)
- return False
+ return None
diff --git a/products/signals/backend/serializers.py b/products/signals/backend/serializers.py
index f0a288b45583..9299c04b218d 100644
--- a/products/signals/backend/serializers.py
+++ b/products/signals/backend/serializers.py
@@ -30,6 +30,10 @@ from products.signals.backend.agent_instructions import AGENT_STEERING_MAX_LENGT
from products.signals.backend.anomaly_scores.config import covers_team, parse_config, read_payload
from products.signals.backend.billing import REFUND_INELIGIBILITY_REASONS, refund_ineligibility_reason
from products.signals.backend.contracts import (
+ ALERT_ALLOW_PATTERNS_KEY,
+ ALERT_BLOCK_PATTERNS_KEY,
+ ALERT_PATTERN_MAX_LENGTH,
+ ALERT_PATTERNS_MAX_COUNT,
ALERT_SCOPE_KEY,
ALERT_SCOPE_SOURCE,
DEFAULT_NOT_ACTIONABLE_KEY,
@@ -37,6 +41,7 @@ from products.signals.backend.contracts import (
STEERING_KEY,
STEERING_MAX_LENGTH,
AlertScope,
+ alert_patterns_problem,
scope_ids_problem,
)
from products.signals.backend.credential_redaction import redact_credentials
@@ -213,7 +218,14 @@ _SOURCE_CONFIG_HELP_TEXT = (
"The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) "
"accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the "
"investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts "
- "without the investigation agent. Other sources reject this key."
+ "without the investigation agent. "
+ "It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to "
+ f"{ALERT_PATTERNS_MAX_COUNT} regex patterns, max {ALERT_PATTERN_MAX_LENGTH} characters each). "
+ "A pattern matches when it finds a match anywhere in the alert name or the insight name, and "
+ "matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, "
+ "an alert must match one of them. An alert that matches a block pattern is dropped, also when it "
+ "matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no "
+ "backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
)
@@ -362,6 +374,16 @@ class SignalSourceConfigSerializer(serializers.ModelSerializer):
raise serializers.ValidationError(
{"config": f"alert_scope must be one of: {', '.join(AlertScope)}"}
)
+ for patterns_key in (ALERT_ALLOW_PATTERNS_KEY, ALERT_BLOCK_PATTERNS_KEY):
+ if patterns_key not in config:
+ continue
+ if (source_product, source_type) != ALERT_SCOPE_SOURCE:
+ raise serializers.ValidationError(
+ {"config": f"{patterns_key} is only supported on the analytics anomaly_investigation source"}
+ )
+ problem = alert_patterns_problem(config[patterns_key])
+ if problem is not None:
+ raise serializers.ValidationError({"config": f"{patterns_key} {problem}"})
scope_key = SCOPE_CONFIG_KEYS.get((source_product, source_type)) if source_product and source_type else None
if scope_key is not None and scope_key in config:
problem = scope_ids_problem(config[scope_key])
diff --git a/products/signals/backend/test/test_signal_source_config_api.py b/products/signals/backend/test/test_signal_source_config_api.py
index 99e1582aee77..8a5bc99cdb3b 100644
--- a/products/signals/backend/test/test_signal_source_config_api.py
+++ b/products/signals/backend/test/test_signal_source_config_api.py
@@ -20,7 +20,13 @@ from posthog.models.team.team import Team
from posthog.models.utils import generate_random_token_personal, hash_key_value
from products.signals.backend.emission.steering import afetch_source_config
-from products.signals.backend.facade.source_configs import get_analytics_alert_scope
+from products.signals.backend.facade.source_configs import (
+ AlertFilterOutcome,
+ AlertNamePatterns,
+ evaluate_alert_filter,
+ get_analytics_alert_name_patterns,
+ get_analytics_alert_scope,
+)
from products.signals.backend.models import SignalSourceConfig
from products.signals.backend.serializers import SignalSourceConfigSerializer
from products.warehouse_sources.backend.facade.models import ExternalDataSchema
@@ -597,6 +603,30 @@ class TestSignalSourceConfigSerializerValidation(SimpleTestCase):
)
assert not serializer.is_valid()
+ @parameterized.expand(
+ [
+ ("allow", "analytics", "anomaly_investigation", "alert_allow_patterns", ["(?i)checkout", "^Daily"], None),
+ ("block", "analytics", "anomaly_investigation", "alert_block_patterns", ["test"], None),
+ ("empty_list", "analytics", "anomaly_investigation", "alert_block_patterns", [], None),
+ ("not_a_list", "analytics", "anomaly_investigation", "alert_allow_patterns", "checkout", "list"),
+ ("empty_pattern", "analytics", "anomaly_investigation", "alert_allow_patterns", [""], "list"),
+ ("too_many", "analytics", "anomaly_investigation", "alert_allow_patterns", ["a"] * 21, "at most 20"),
+ ("too_long", "analytics", "anomaly_investigation", "alert_block_patterns", ["a" * 201], "at most 200"),
+ ("lookahead", "analytics", "anomaly_investigation", "alert_block_patterns", ["ok", "(?=x)"], "'(?=x)'"),
+ ("unbalanced", "analytics", "anomaly_investigation", "alert_allow_patterns", ["a("], "'a('"),
+ ("other_source", "github", "issue", "alert_allow_patterns", ["checkout"], "only supported"),
+ ]
+ )
+ def test_alert_patterns(self, _name, source_product, source_type, key, value, expected_error):
+ serializer = SignalSourceConfigSerializer(
+ data={"source_product": source_product, "source_type": source_type, "config": {key: value}}
+ )
+ assert serializer.is_valid() is (expected_error is None), serializer.errors
+ if expected_error is not None:
+ error = str(serializer.errors["config"])
+ assert key in error
+ assert expected_error in error
+
class TestScoutSourceCanonicalization(APIBaseTest):
"""The scout source config is a project-level singleton: the scout fleet canonicalizes child
@@ -856,6 +886,81 @@ class TestGetAnalyticsAlertScope(BaseTest):
assert get_analytics_alert_scope(team_id=self.team.id) == "investigated_only"
+class TestGetAnalyticsAlertNamePatterns(BaseTest):
+ @parameterized.expand(
+ [
+ ("no_row", None, True, AlertNamePatterns()),
+ ("no_keys", {"alert_scope": "all_firing_alerts"}, True, AlertNamePatterns()),
+ (
+ "valid",
+ {"alert_allow_patterns": ["^Daily"], "alert_block_patterns": ["test"]},
+ True,
+ AlertNamePatterns(allow=("^Daily",), block=("test",)),
+ ),
+ ("flag_off", {"alert_block_patterns": ["test"]}, False, AlertNamePatterns()),
+ ("not_a_list", {"alert_block_patterns": "test"}, True, AlertNamePatterns(invalid=True)),
+ ("null", {"alert_allow_patterns": None}, True, AlertNamePatterns(invalid=True)),
+ ("no_longer_compiles", {"alert_block_patterns": ["(?=x)"]}, True, AlertNamePatterns(invalid=True)),
+ ]
+ )
+ def test_patterns(self, _name, config, flag_enabled, expected):
+ if config is not None:
+ SignalSourceConfig.objects.create(
+ team=self.team, source_product="analytics", source_type="anomaly_investigation", config=config
+ )
+
+ with patch(
+ "products.signals.backend.facade.source_configs.feature_enabled_or_false", return_value=flag_enabled
+ ):
+ assert get_analytics_alert_name_patterns(team_id=self.team.id) == expected
+
+ def test_flag_service_error_fails_closed(self) -> None:
+ SignalSourceConfig.objects.create(
+ team=self.team,
+ source_product="analytics",
+ source_type="anomaly_investigation",
+ config={"alert_allow_patterns": ["^Daily"]},
+ )
+
+ with patch(
+ "products.signals.backend.facade.source_configs.feature_enabled_or_false",
+ side_effect=RuntimeError("flag service down"),
+ ):
+ assert get_analytics_alert_name_patterns(team_id=self.team.id) == AlertNamePatterns(invalid=True)
+
+
+class TestEvaluateAlertFilter(SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("no_patterns", AlertNamePatterns(), AlertFilterOutcome.PASSED),
+ ("allow_matches", AlertNamePatterns(allow=("Checkout",)), AlertFilterOutcome.PASSED),
+ ("allow_misses", AlertNamePatterns(allow=("signups",)), AlertFilterOutcome.NOT_ALLOWED),
+ ("block_misses", AlertNamePatterns(block=("signups",)), AlertFilterOutcome.PASSED),
+ ("block_matches", AlertNamePatterns(block=("conversion",)), AlertFilterOutcome.BLOCKED),
+ (
+ "block_wins_over_allow",
+ AlertNamePatterns(allow=("Checkout",), block=("conversion",)),
+ AlertFilterOutcome.BLOCKED,
+ ),
+ (
+ "allow_matches_and_block_misses",
+ AlertNamePatterns(allow=("Checkout",), block=("signups",)),
+ AlertFilterOutcome.PASSED,
+ ),
+ ("matches_the_insight_name", AlertNamePatterns(allow=("^Weekly revenue$",)), AlertFilterOutcome.PASSED),
+ ("search_not_full_match", AlertNamePatterns(allow=("out conv",)), AlertFilterOutcome.PASSED),
+ ("case_sensitive_by_default", AlertNamePatterns(allow=("^checkout",)), AlertFilterOutcome.NOT_ALLOWED),
+ ("case_insensitive_flag", AlertNamePatterns(allow=("(?i)^checkout",)), AlertFilterOutcome.PASSED),
+ ("pattern_that_does_not_compile", AlertNamePatterns(block=("(?=x)",)), AlertFilterOutcome.INVALID),
+ ("invalid_stored_patterns", AlertNamePatterns(invalid=True), AlertFilterOutcome.INVALID),
+ ]
+ )
+ def test_outcome(self, _name, patterns, expected):
+ outcome = evaluate_alert_filter(patterns, alert_name="Checkout conversion", insight_name="Weekly revenue")
+
+ assert outcome == expected
+
+
@pytest.mark.django_db(transaction=True)
@pytest.mark.parametrize("status_lookup_fails", [False, True])
def test_concurrent_config_key_updates_preserve_both_edits(status_lookup_fails: bool) -> None:
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index fbf2dac85df2..d85b1dfb43d9 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -10787,7 +10787,7 @@ export const SignalSourceSyncStatusEnumApi = {
} as const
/**
- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.
+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.
*/
export type SignalSourceConfigApiConfig = { [key: string]: unknown }
@@ -10801,7 +10801,7 @@ export interface SignalSourceConfigApi {
source_product: SignalSourceProductEnumApi
source_type: SignalSourceConfigSourceTypeEnumApi
enabled?: boolean
- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key. */
+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys. */
config?: SignalSourceConfigApiConfig
/** Top-level config keys to set atomically on update. Unspecified keys are preserved. Cannot be combined with config. */
config_set?: SignalSourceConfigApiConfigSet
@@ -10823,7 +10823,7 @@ export interface PaginatedSignalSourceConfigListApi {
}
/**
- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.
+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.
*/
export type PatchedSignalSourceConfigApiConfig = { [key: string]: unknown }
@@ -10837,7 +10837,7 @@ export interface PatchedSignalSourceConfigApi {
source_product?: SignalSourceProductEnumApi
source_type?: SignalSourceConfigSourceTypeEnumApi
enabled?: boolean
- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key. */
+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys. */
config?: PatchedSignalSourceConfigApiConfig
/** Top-level config keys to set atomically on update. Unspecified keys are preserved. Cannot be combined with config. */
config_set?: PatchedSignalSourceConfigApiConfigSet
diff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.ts
index ec3e9b8d8566..e6aa69df79ee 100644
--- a/products/signals/frontend/generated/api.zod.ts
+++ b/products/signals/frontend/generated/api.zod.ts
@@ -4508,7 +4508,7 @@ export const SignalsSourceConfigsCreateBody = /* @__PURE__ */ zod.object({
.record(zod.string(), zod.unknown())
.optional()
.describe(
- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key."
+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
),
config_set: zod
.record(zod.string(), zod.unknown())
@@ -4676,7 +4676,7 @@ export const SignalsSourceConfigsUpdateBody = /* @__PURE__ */ zod.object({
.record(zod.string(), zod.unknown())
.optional()
.describe(
- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key."
+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
),
config_set: zod
.record(zod.string(), zod.unknown())
@@ -4846,7 +4846,7 @@ export const SignalsSourceConfigsPartialUpdateBody = /* @__PURE__ */ zod.object(
.record(zod.string(), zod.unknown())
.optional()
.describe(
- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key."
+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
),
config_set: zod
.record(zod.string(), zod.unknown())
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 44ed353d394d..23eeac8450b8 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -74553,7 +74553,7 @@ export namespace Schemas {
} as const;
/**
- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.
+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.
*/
export type SignalSourceConfigConfig = { [key: string]: unknown };
@@ -74567,7 +74567,7 @@ export namespace Schemas {
source_product: SignalSourceProductEnum;
source_type: SignalSourceConfigSourceTypeEnum;
enabled?: boolean;
- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key. */
+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys. */
config?: SignalSourceConfigConfig;
/** Top-level config keys to set atomically on update. Unspecified keys are preserved. Cannot be combined with config. */
config_set?: SignalSourceConfigConfigSet;
@@ -86697,7 +86697,7 @@ export namespace Schemas {
}
/**
- * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.
+ * Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.
*/
export type PatchedSignalSourceConfigConfig = { [key: string]: unknown };
@@ -86711,7 +86711,7 @@ export namespace Schemas {
source_product?: SignalSourceProductEnum;
source_type?: SignalSourceConfigSourceTypeEnum;
enabled?: boolean;
- /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key. */
+ /** Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys. */
config?: PatchedSignalSourceConfigConfig;
/** Top-level config keys to set atomically on update. Unspecified keys are preserved. Cannot be combined with config. */
config_set?: PatchedSignalSourceConfigConfigSet;
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index eded1bf98376..bf6ccb095bad 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -5173,7 +5173,7 @@ export const SignalsSourceConfigsCreateBody = () => zod.object({
.record(zod.string(), zod.unknown())
.optional()
.describe(
- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key."
+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
),
config_set: zod
.record(zod.string(), zod.unknown())
@@ -5359,7 +5359,7 @@ export const SignalsSourceConfigsUpdateBody = () => zod.object({
.record(zod.string(), zod.unknown())
.optional()
.describe(
- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key."
+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
),
config_set: zod
.record(zod.string(), zod.unknown())
@@ -5538,7 +5538,7 @@ export const SignalsSourceConfigsPartialUpdateBody = () => zod.object({
.record(zod.string(), zod.unknown())
.optional()
.describe(
- "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key."
+ "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys."
),
config_set: zod
.record(zod.string(), zod.unknown())
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json
index 49fb3c0885dd..c06fa25be3d4 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-create.json
@@ -3,7 +3,7 @@
"properties": {
"config": {
"additionalProperties": {},
- "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.",
+ "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.",
"propertyNames": {
"type": "string"
},
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json
index 56b9754b68e2..7d67bf8df554 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-partial-update.json
@@ -3,7 +3,7 @@
"properties": {
"config": {
"additionalProperties": {},
- "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.",
+ "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.",
"propertyNames": {
"type": "string"
},
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json
index e353b08452ee..be13e98a7fe8 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/inbox-source-configs-update.json
@@ -3,7 +3,7 @@
"properties": {
"config": {
"additionalProperties": {},
- "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. Other sources reject this key.",
+ "description": "Per-source settings as a JSON object. Keys read by the emission actionability gate on sources that define one (most data warehouse imports, and Conversations): `steering` (string, max 2000 characters) holds the team's preferences about this source's records in plain language: what matters, what to skip, what's out of scope. The emission actionability gate applies it when deciding which records become signals; rules apply from the next sync and nothing already emitted is retracted. `default_not_actionable` (boolean, default false) flips the gate's default: instead of keeping every record the steering rules don't exclude, only records that clearly match the team's preferences are kept. Other sources store these keys without reading them yet; future pipeline stages will consume the same steering text. Some sources read additional keys, for example `recording_filters` and `sample_rate` for session analysis. The Linear issue source (`source_product=linear`, `source_type=issue`) reads `linear_team_ids` (list of Linear team id strings, max 100): the warehouse still syncs the whole Linear workspace, but only issues from those teams become signals. Omit the key or pass an empty list to use every team. Get the ids from the Linear integration's teams endpoint. The product analytics source (`source_product=analytics`, `source_type=anomaly_investigation`) accepts `alert_scope`: `investigated_only` (default) turns only insight alerts that the investigation agent confirmed into signals, and `all_firing_alerts` also includes alerts without the investigation agent. It also accepts `alert_allow_patterns` and `alert_block_patterns` (lists of up to 20 regex patterns, max 200 characters each). A pattern matches when it finds a match anywhere in the alert name or the insight name, and matching is case sensitive unless the pattern uses the `(?i)` flag. When allow patterns are set, an alert must match one of them. An alert that matches a block pattern is dropped, also when it matches an allow pattern. Patterns use RE2 syntax, which has no lookaround and no backreferences. Both keys apply to either `alert_scope`. Other sources reject these keys.",
"propertyNames": {
"type": "string"
},