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): per-scout model pin behind scouts-model-config flag (#78764)

Andrew Maguire3a3e02537f5e
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 5893ba3f9b34..1272f6a3437b 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -220,6 +220,7 @@ export const FEATURE_FLAGS = {
REPLAY_PLAYER_PERSON_SESSIONS_TAB: 'replay-player-person-sessions-tab', // owner: @ksvat #team-replay
REPLAY_SETTINGS_HELP: 'replay-settings-help', // owner: @veryayskiy #team-replay
REPLAY_TRIGGER_TYPE_CHOICE: 'replay-trigger-type-choice', // owner: @pauldambra #team-replay
+ SCOUTS_MODEL_CONFIG: 'scouts-model-config', // owner: #team-self-driving, gates the per-scout model pin in the inbox scout settings (also checked server-side)
SELF_DRIVING_QUOTA_ENFORCEMENT: 'self-driving-quota-enforcement', // owner: #team-self-driving, gates self-driving PR-limit enforcement (also checked server-side)
SESSION_REPLAY_BACKEND_LOGS: 'session-replay-backend-logs', // owner: #team-replay
SESSION_REPLAY_DOCTOR: 'session-replay-doctor', // owner: #team-replay
diff --git a/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.test.tsx b/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.test.tsx
index 0581ee2067a6..0f043c5ed98e 100644
--- a/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.test.tsx
+++ b/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.test.tsx
@@ -25,6 +25,7 @@ const config: SignalScoutConfigApi = {
status_changed_at: null,
auto_pause_exempt: false,
network_access: 'trusted',
+ model: null,
tags: [],
created_at: '2026-07-21T12:00:00Z',
}
diff --git a/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.tsx b/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.tsx
index 276e67a7a2ad..d576b05b7653 100644
--- a/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.tsx
+++ b/frontend/src/scenes/inbox/components/config/scouts/ScoutConfigControls.tsx
@@ -3,6 +3,8 @@ import { useValues } from 'kea'
import { IconTrash } from '@posthog/icons'
import { LemonButton, LemonDialog, LemonInput, LemonSelect, LemonSwitch, Tooltip } from '@posthog/lemon-ui'
+import { FEATURE_FLAGS } from 'lib/constants'
+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { teamLogic } from 'scenes/teamLogic'
import type {
@@ -68,6 +70,7 @@ export function ScoutConfigForm({
updating = false,
}: ScoutConfigFormProps): JSX.Element {
const { timezone: projectTimezone } = useValues(teamLogic)
+ const { featureFlags } = useValues(featureFlagLogic)
const dailyTime = dailyCronToTime(config.run_cron_schedule)
const scheduleMode = getScoutScheduleMode(config)
const controlsDisabledReason = updating
@@ -164,6 +167,34 @@ export function ScoutConfigForm({
}}
/>
</div>
+ {featureFlags[FEATURE_FLAGS.SCOUTS_MODEL_CONFIG] ? (
+ <div className="flex items-center justify-between gap-4">
+ <div className="flex flex-col min-w-0">
+ <span className="text-xs text-default">Model</span>
+ <span className="text-[11.5px] text-muted">
+ The model this scout runs on. Pick a more capable model for harder tasks. Leave empty to use
+ the default.
+ </span>
+ </div>
+ <LemonInput
+ key={config.model ?? 'unset'}
+ size="small"
+ placeholder="Default"
+ defaultValue={config.model ?? ''}
+ // Editable while the scout is disabled for the same reason as network access:
+ // a newly enabled scout is immediately due, so the model must be settable first.
+ disabledReason={updating ? 'Saving scout settings' : undefined}
+ className="w-44"
+ onBlur={(event) => {
+ const value = event.currentTarget.value.trim()
+ if (value !== (config.model ?? '')) {
+ onUpdate(config.id, { model: value || null })
+ }
+ }}
+ aria-label={`${config.skill_name} model`}
+ />
+ </div>
+ ) : null}
<div className="flex items-center justify-between gap-4">
<div className="flex flex-col min-w-0">
<span className="text-xs text-default">Opt out of auto-pause</span>
diff --git a/frontend/src/scenes/inbox/components/config/scouts/ScoutTags.stories.tsx b/frontend/src/scenes/inbox/components/config/scouts/ScoutTags.stories.tsx
index e2ae52450c3f..45b84b09014f 100644
--- a/frontend/src/scenes/inbox/components/config/scouts/ScoutTags.stories.tsx
+++ b/frontend/src/scenes/inbox/components/config/scouts/ScoutTags.stories.tsx
@@ -24,6 +24,7 @@ const config: SignalScoutConfigApi = {
output_destinations: {},
structured_output_schema: null,
network_access: 'trusted',
+ model: null,
last_run_at: null,
consecutive_failure_count: 0,
status_changed_at: null,
diff --git a/frontend/src/scenes/inbox/logics/scoutCreateModalLogic.test.ts b/frontend/src/scenes/inbox/logics/scoutCreateModalLogic.test.ts
index d44a180eae30..36661645a365 100644
--- a/frontend/src/scenes/inbox/logics/scoutCreateModalLogic.test.ts
+++ b/frontend/src/scenes/inbox/logics/scoutCreateModalLogic.test.ts
@@ -45,6 +45,7 @@ const CREATED_SCOUT: SignalScoutCreateResponseApi = {
status_changed_at: null,
auto_pause_exempt: false,
network_access: 'trusted',
+ model: null,
created_at: '2026-07-24T00:00:00Z',
},
}
diff --git a/frontend/src/scenes/inbox/logics/scoutFleetLogic.test.ts b/frontend/src/scenes/inbox/logics/scoutFleetLogic.test.ts
index 0e1cc82c2960..c8aa531c48a6 100644
--- a/frontend/src/scenes/inbox/logics/scoutFleetLogic.test.ts
+++ b/frontend/src/scenes/inbox/logics/scoutFleetLogic.test.ts
@@ -50,6 +50,7 @@ const BASE_CONFIG: SignalScoutConfigApi = {
status_changed_at: null,
auto_pause_exempt: false,
network_access: 'trusted',
+ model: null,
created_at: '2026-07-22T00:00:00Z',
}
diff --git a/products/signals/backend/migrations/0088_signalscoutconfig_model.py b/products/signals/backend/migrations/0088_signalscoutconfig_model.py
new file mode 100644
index 000000000000..13ee51be6de3
--- /dev/null
+++ b/products/signals/backend/migrations/0088_signalscoutconfig_model.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.2.14 on 2026-08-06 09:36
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("signals", "0087_signalscoutconfig_tags"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="signalscoutconfig",
+ name="model",
+ field=models.CharField(blank=True, max_length=200, null=True),
+ ),
+ ]
diff --git a/products/signals/backend/migrations/max_migration.txt b/products/signals/backend/migrations/max_migration.txt
index 0e3b6cb0ab7d..2a37309c9693 100644
--- a/products/signals/backend/migrations/max_migration.txt
+++ b/products/signals/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0087_signalscoutconfig_tags
+0088_signalscoutconfig_model
diff --git a/products/signals/backend/models.py b/products/signals/backend/models.py
index 1167d86d2817..0016471c7a7e 100644
--- a/products/signals/backend/models.py
+++ b/products/signals/backend/models.py
@@ -1269,6 +1269,14 @@ class SignalScoutConfig(ModelActivityMixin, TeamScopedRootMixin, UUIDModel):
default=NetworkAccess.TRUSTED,
db_default=NetworkAccess.TRUSTED,
)
+ # Optional agent-model pin for this scout's runs, e.g. `claude-opus-4-5`. Null keeps the
+ # normal resolution chain (the `scouts-model-selection` experiment gate, then the pipeline
+ # runtime pin, then the agent-server default). Honored at dispatch only while the
+ # `scouts-model-config` flag is on for the team, so a stored value is inert outside the
+ # dogfood — the flag is the kill switch, which is why the value itself is not cleared when
+ # the flag goes off. Free-form rather than a choices list: the model catalog changes
+ # without deploys, and `model_selection` already treats an unroutable id defensively.
+ model = models.CharField(max_length=200, null=True, blank=True)
# Optional destinations for each finding or report this scout emits. Kept as a typed JSON object at
# the API boundary so adding another destination does not require another pair of nullable
# config columns. A Slack destination is active only when both its integration and channel
diff --git a/products/signals/backend/scout_harness/AGENTS.md b/products/signals/backend/scout_harness/AGENTS.md
index 7a734f6e534d..f678f4aa595e 100644
--- a/products/signals/backend/scout_harness/AGENTS.md
+++ b/products/signals/backend/scout_harness/AGENTS.md
@@ -79,6 +79,7 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e
The streak is read-only on the config serializers (`scout-configs-list`); any config edit resets it, a resume (human `enabled=true` or a successful probe) always starts it clean, and the trip emits `signals_scout_config_auto_paused` once.
- The sandbox is opened with the team's MCP token plus the harness-internal tools.
The skill body is loaded into the system prompt; each scout has its own `SignalScoutConfig` row (keyed on `(team, skill_name)`) whose `enabled` flag, `run_interval_minutes`, and optional project-local cron `run_cron_schedule` the coordinator's per-scout due-check honors.
+- The agent model is per-scout too, from `SignalScoutConfig.model` — an optional model-id pin resolved as the top layer of `model_selection.resolve_scout_model`, honored only while the `scouts-model-config` dogfood flag is on for the team (`scout_model_config_enabled`; the flag is the kill switch, so stored pins go inert the moment it's off). A pin beats the `scouts-model-selection` experiment distribution — an explicit per-scout choice must not be rerouted by a fleet trial — and its runtime adapter is inferred from the id like any payload-routed model. Setting the field through the config API is rejected for teams outside the flag; clearing it is always allowed.
- Sandbox network egress is per-scout, from `SignalScoutConfig.network_access`: `trusted` (default) provisions the shared `SIGNALS_REPORT_RESEARCH` env at the Tasks `TRUSTED` level (the platform trusted-domain allowlist), and `full` provisions a separate `SIGNALS_SCOUT_FULL_NETWORK` env at `FULL` (unrestricted). The env split is load-bearing: `upsert_internal_sandbox_env` reasserts policy per call on the per-team env row named, so a full-network run on the shared env would flip the policy for report research and every trusted scout on the team. That helper only reuses rows already marked `internal` and scrubs the user-controllable execution fields (custom image, env vars, repositories) on every call, so a same-named env a user pre-created via the sandbox environment API can never inject configuration into an internal run. Runs that departed from the default stamp `metadata["network_access"]` on the bridge row and carry it on both lifecycle events via `_attach_run_shape_props` (absent = trusted in both places), since the config can be edited after the fact. A future `custom` mode (user-supplied allowlist) should mirror the Tasks `NetworkAccessLevel` vocabulary.
- Scout sandbox GitHub credentials are **always read-only**: the runner requests `github_read_access` on every scout run, so provisioning mints an ephemeral downscoped installation token (`contents`/`metadata`/`pull_requests` read, team-level installs only, never persisted — `get_readonly_github_token` in the tasks product) instead of the write-capable token that task creation would otherwise attach, or injects nothing when the mint isn't possible. The token backs the preinstalled `gh` CLI via `GH_TOKEN`/`GITHUB_TOKEN`.
Separately, the **`gh` prompt guidance** for code-derived reviewer evidence — commit history by path, cross-checked against `scout-members-list`, cited in each reviewer's `reason` — renders only for report-channel scouts whose team passes both the `github_read_access` posture in the `signals-scout` flag payload (`team_configs`/`default_team_config`, resolved by `team_limits.github_read_access_for_team`; default ON, an explicit `false` at either layer is the kill switch) AND the mint-feasibility preflight (`tasks_facade.can_mint_readonly_github_token`), so a tokenless run is never steered at `gh`.
@@ -88,7 +89,7 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e
`harness_prompt_version` / `report_channel` (`none`/`emit`/`edit`/`both`) / `skill_origin` / `github_guidance` always are:
together they pin down which instructions the run was given, which is the thing an eval or A/B has to hold constant. The last three are composition forks the build alone doesn't capture, since the same prompt build renders different sections depending on channel, skill origin, and whether a read-only GitHub token could be minted.
Each is unrecoverable after the fact (the prompt has no version history, a skill's `allowed_tools` can be edited, and a seeded canonical row flips to `custom` the moment a team edits it, taking every past run's origin with it), which is why they are stamped rather than resolved at read time.
- `model` / `runtime_adapter` / `reasoning_effort` appear only when the `scouts-model-selection` gate (or a runtime pin) overrode the agent-server default, so their absence is meaningful.
+ `model` / `runtime_adapter` / `reasoning_effort` appear only when something overrode the agent-server default — a `SignalScoutConfig.model` pin (honored while the `scouts-model-config` dogfood flag is on for the team, and the top layer of `model_selection.resolve_scout_model`), the `scouts-model-selection` gate, or a runtime pin — so their absence is meaningful.
All four are attached to both lifecycle events via `_attach_run_shape_props`, since that is where the A/B readout happens, and `github_guidance` is resolved in `arun_signals_scout` rather than inside `_spawn_and_run` so the failure and cancellation paths can report it too.
New runner-known run dimensions belong here, not grown as ad-hoc columns.
The nested `derived` object is written once at finalize by `derived_metadata.py` and holds booleans the harness computes from the run's own settled output (`has_emit_report`, `has_edit_report`, `has_self_improvement`, `has_chart`, `has_self_validation`), so "what kind of run was this?" is a field lookup rather than a parse of the prose `summary`.
@@ -97,7 +98,7 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e
A missing `derived` region is unknown rather than all-false: the run predates the field, died before finalize, or its stamp failed (best-effort and logged, since observability must not fail a run that already committed its output). The flags read the authored reports' current state at finalize rather than an emit-time snapshot, so a title or chart changed after the emit is what lands; the emit-time record stays on the report lifecycle events.
- Each run emits scout-owned lifecycle analytics events (best-effort, keyed on the team):
`signals_scout_run_started` (the run cleared the guards and a TaskRun exists), `signals_scout_run_finished` (terminal: `completed`/`failed`/`cancelled` + runtime + emit count), and `signals_scout_run_reaped` (a stranded orphan was reaped by `_self_heal_stale_runs`). They join on `run_id`/`task_run_id` and are the event-derived (no-warehouse-lag) basis for throughput, stall, and worker-death alerting — a `started` with no `finished` is a run that died before finalize; a reaped run emits no `finished`.
- When the `scouts-model-selection` gate (or a runtime pin) routes the run, `started` and `finished` also carry `model` / `runtime_adapter`, so run outcomes are sliceable by model without joining through `$ai_generation`; absence means the agent-server default served it.
+ When the model resolution (a config pin, the `scouts-model-selection` gate, or a runtime pin) routes the run, `started` and `finished` also carry `model` / `runtime_adapter`, so run outcomes are sliceable by model without joining through `$ai_generation`; absence means the agent-server default served it.
A `finished` run that died at the per-turn poll wall also carries the turn-log diagnostics from `TurnPollTimeout.diagnostics()` (`poll_timeout_stage` + elapsed/stale/line counts), because every wall failure raises one error string and the fleet's timeout rate is otherwise a single undifferentiated bucket: `no_turn_output` (the agent never emitted a turn-relevant line — it never got going), `stalled_after_output` (worked, then went quiet past the salvage window), `active_at_budget` (still streaming when the budget expired — the budget is the constraint, not the agent).
`signals_scout_config_auto_paused` fires once when a `(team, skill)` lane's failure-streak breaker trips (see the run-lifecycle bullet above) — the alertable signal for a wedged lane, which is otherwise invisible in a stream of individually-unremarkable `failed` runs.
The report channel adds `signals_scout_report_emitted` / `signals_scout_report_edited` (plus customer-facing `$scout_report_*` copies), stamped with derived classification properties (`report_kind` = `finding`/`self_improvement`, `is_self_improvement_report`) via `_report_classification_props` in `tools/report.py` — classified server-side off the prompt's mandated title prefix (`prompt.SELF_IMPROVEMENT_REPORT_TITLE_PREFIX`), so self-improvement reports are separable without downstream title heuristics. That helper is the single extension point for future derived telemetry dimensions on these events — add new flags there (both events pick them up), not as model columns.
diff --git a/products/signals/backend/scout_harness/model_selection.py b/products/signals/backend/scout_harness/model_selection.py
index b7a4214a1707..7dadf5398c16 100644
--- a/products/signals/backend/scout_harness/model_selection.py
+++ b/products/signals/backend/scout_harness/model_selection.py
@@ -47,6 +47,11 @@ all resolve to `None` — the agent-server default. Gating the model must never
This is separate from the `signals-scout` enrollment/limits flag — that decides *whether* a team
runs scouts; this decides *on which model*.
+
+One layer sits above the payload: a per-scout `SignalScoutConfig.model` pin, honored only while the
+`scouts-model-config` dogfood flag is on for the team (`scout_model_config_enabled`). An explicit
+pin routes every run of that scout onto its model deterministically — no bucketing — and beats the
+payload's distribution; everything else falls through to the payload as described above.
"""
from __future__ import annotations
@@ -60,8 +65,18 @@ import posthoganalytics
from posthog.exceptions_capture import capture_exception
from posthog.models.team.team import Team
+from products.tasks.backend.facade.run_config import get_models_for_runtime_adapter
+
SCOUTS_MODEL_FLAG = "scouts-model-selection"
+# Dogfood gate for the per-scout config layer: only while this flag is on for the team does a
+# `SignalScoutConfig.model` pin actually route runs. Distinct from `scouts-model-selection` (an
+# operator-keyed payload for fleet A/B trials, always-on with the payload as the config): this one
+# is a plain boolean flag over teams, because what it gates is whether the team's own stored
+# config is honored, not what the config says. Keeping the gate at resolve time (not at write
+# time only) makes turning the flag off an immediate kill switch for already-stored pins.
+SCOUTS_MODEL_CONFIG_FLAG = "scouts-model-config"
+
# Fixed distinct_id for the payload read — config is team-keyed in the payload, not per-user. Matches
# the `signals-scout` discovery pattern: the flag stays 100%-on so the payload is always served, and
# `match_value=True` forces the true-variant payload under local evaluation.
@@ -136,6 +151,63 @@ def _infer_runtime_adapter(model_id: str) -> str:
return RUNTIME_ADAPTER_CLAUDE if "claude" in model_id.lower() else RUNTIME_ADAPTER_CODEX
+def scout_model_pin_catalog() -> tuple[str, ...]:
+ """The model ids a `SignalScoutConfig.model` pin may carry: the canonical Tasks catalog, both
+ runtimes. The config API validates pins against this, unlike the free-form payload path — a pin
+ has no runtime-pinning escape hatch, so an off-catalog id would be stored with nothing
+ authoritative to route it by."""
+ return (
+ *get_models_for_runtime_adapter(RUNTIME_ADAPTER_CLAUDE),
+ *get_models_for_runtime_adapter(RUNTIME_ADAPTER_CODEX),
+ )
+
+
+def _runtime_adapter_for_pin(model_id: str) -> str:
+ """The runtime for a config-pinned model: the canonical Tasks catalog first, name inference as
+ the fallback.
+
+ The catalog is what knows the ids whose runtime can't be read off the name — the
+ Cloudflare-served `@cf/...` and `moonshotai/...` models run on the `claude` runtime (the
+ gateway serves them over its Anthropic-Messages surface), where name inference would say
+ `codex`. The fallback only covers stored pins that have since left the catalog; the payload
+ path keeps pure name inference, because changing it would reroute live trial distributions and
+ the payload's object form can already pin a runtime explicitly.
+ """
+ if model_id in get_models_for_runtime_adapter(RUNTIME_ADAPTER_CLAUDE):
+ return RUNTIME_ADAPTER_CLAUDE
+ if model_id in get_models_for_runtime_adapter(RUNTIME_ADAPTER_CODEX):
+ return RUNTIME_ADAPTER_CODEX
+ return _infer_runtime_adapter(model_id)
+
+
+def scout_model_config_enabled(team: Team) -> bool:
+ """Whether this team's per-scout `SignalScoutConfig.model` pins are honored (dogfood gate).
+
+ Keyed on the `project` group the same way the web app registers it (group key = the team's
+ uuid, `id` = the numeric project id), so one flag definition — a project-group condition on
+ `id` — serves both this server-side check and the frontend's gated settings UI. `id` carries
+ the canonical parent id so a child environment follows its project's enrollment server-side;
+ the frontend registers a child environment's own id, so a condition that should also show the
+ UI inside child environments must list their ids too. Fails closed on a flag-read error: an
+ unhonored pin just means the default resolution chain, never a broken run.
+ """
+ try:
+ canonical_team_id = team.parent_team_id or team.id
+ return (
+ posthoganalytics.feature_enabled(
+ SCOUTS_MODEL_CONFIG_FLAG,
+ str(team.uuid),
+ groups={"project": str(team.uuid)},
+ group_properties={"project": {"id": canonical_team_id, "uuid": str(team.uuid)}},
+ send_feature_flag_events=False,
+ )
+ is True
+ )
+ except Exception as error:
+ capture_exception(error)
+ return False
+
+
def _read_payload() -> dict | None:
"""Read + parse the `scouts-model-selection` flag's JSON payload once.
@@ -278,16 +350,21 @@ def _select_model(run_id: str, distribution: dict[str, float], default_model: st
return default_model
-def resolve_scout_model(team: Team, skill_name: str, run_id: str) -> ScoutModel:
+def resolve_scout_model(team: Team, skill_name: str, run_id: str, configured_model: str | None = None) -> ScoutModel:
"""The agent-model override for one scout run, with the runtime that can serve it.
- Resolves this team's scout map from the `scouts-model-selection` payload, then this scout's
- per-run model from its distribution, then the runtime adapter for the chosen model (pinned in the
- payload, else inferred from the id). Returns `ScoutModel(None, None)` (agent-server default) when
- the team has no entry, the scout has no distribution, or the run falls in the unallocated
- remainder with no named `default`. A payload read failure is swallowed and falls back to the
- default model — gating the model must never be able to fail a scout run.
+ `configured_model` is the scout's own `SignalScoutConfig.model` pin. It is the top layer: while
+ the `scouts-model-config` dogfood flag is on for the team, an explicit per-scout pin beats the
+ `scouts-model-selection` experiment distribution — a user deliberately configured that scout,
+ and an operator trial must not silently reroute it. With the flag off (or no pin) resolution
+ falls through unchanged: this team's scout map from the `scouts-model-selection` payload, then
+ this scout's per-run model from its distribution, then the runtime adapter for the chosen model
+ (pinned in the payload, else inferred from the id). Returns `ScoutModel(None, None)`
+ (agent-server default) when nothing applies. A flag or payload read failure is swallowed and
+ falls back to the next layer — gating the model must never be able to fail a scout run.
"""
+ if configured_model and scout_model_config_enabled(team):
+ return ScoutModel(model=configured_model, runtime_adapter=_runtime_adapter_for_pin(configured_model))
payload = _read_payload()
scouts = _team_scouts(payload, team.id, team.parent_team_id or team.id)
distribution, adapters, efforts, default_model = _scout_config(scouts, skill_name)
diff --git a/products/signals/backend/scout_harness/runner.py b/products/signals/backend/scout_harness/runner.py
index b001c65e916e..085188f0ec6f 100644
--- a/products/signals/backend/scout_harness/runner.py
+++ b/products/signals/backend/scout_harness/runner.py
@@ -236,20 +236,22 @@ async def arun_signals_scout(
run_id = uuid7()
started_at = timezone.now()
- # Resolve the scout's agent model from the `scouts-model-selection` gate. A `None` model keeps the
- # agent-server default; an override routes this run on that model, paired with the runtime adapter
- # that can serve it (the agent server can't route a model without one). The flag payload is a
- # per-team, per-scout model distribution, bucketed per run on `run_id` — so a scout can A/B/n
+ # Resolve the scout's agent model. A `None` model keeps the agent-server default; an override
+ # routes this run on that model, paired with the runtime adapter that can serve it (the agent
+ # server can't route a model without one). Two flag-gated layers, resolved in one call: the
+ # scout's own `config.model` pin (honored while the `scouts-model-config` dogfood flag is on
+ # for the team, deterministic per scout), then the `scouts-model-selection` payload — a
+ # per-team, per-scout model distribution, bucketed per run on `run_id`, so a scout can A/B/n
# across models against itself across runs. Resolved once here so the whole run is consistent.
- # Off the event loop — the flag read does blocking network I/O.
+ # Off the event loop — the flag reads do blocking network I/O.
scout_model = await database_sync_to_async(resolve_scout_model, thread_sensitive=False)(
- team, skill.name, str(run_id)
+ team, skill.name, str(run_id), configured_model=config.model
)
- # The scout-model gate is the per-scout, per-run experiment layer; the `signals-pipeline-models`
- # runtime pin is the default layer beneath it. When the gate resolves a model for this run it
- # wins (its unallocated remainder resolves None and falls through to the pin), so a fleet-wide
- # pin can't silently swallow a configured model trial. Either way the whole
+ # The scout-model resolution (config pin, then experiment gate) sits above the
+ # `signals-pipeline-models` runtime pin, the default layer beneath it. When it resolves a model
+ # for this run it wins (the gate's unallocated remainder resolves None and falls through to the
+ # pin), so a fleet-wide pin can't silently swallow a configured model. Either way the whole
# runtime/model/effort triple is taken from one source — a Codex runtime never pairs with a
# model it can't serve. Model-only pin entries are still ignored for scout: a pin supplies
# model+runtime as a pair, and overriding one without the other would mis-route.
diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.py
index a83f4b3ad0ca..d266fbd7001b 100644
--- a/products/signals/backend/scout_harness/serializers.py
+++ b/products/signals/backend/scout_harness/serializers.py
@@ -24,12 +24,14 @@ from rest_framework.exceptions import PermissionDenied
from posthog.event_usage import groups
from posthog.models.integration import Integration
+from posthog.models.team.team import Team
from posthog.permissions import get_authenticator_scopes
from products.signals.backend.artefact_schemas import ActionabilityChoice, Priority
from products.signals.backend.models import SignalScoutConfig, SignalScoutEmission
from products.signals.backend.report_charts import MAX_REPORT_CHARTS
from products.signals.backend.scout_harness.derived_metadata import DERIVED_FLAG_KEYS, DERIVED_METADATA_KEY
+from products.signals.backend.scout_harness.model_selection import scout_model_config_enabled, scout_model_pin_catalog
from products.signals.backend.scout_harness.skill_loader import SIGNALS_SCOUT_SKILL_PREFIX
from products.signals.backend.scout_harness.tags import slugify_tag
from products.signals.backend.scout_harness.tools.emit import (
@@ -2064,6 +2066,37 @@ def _validate_structured_output_schema(value: dict | None) -> dict | None:
raise serializers.ValidationError(str(exc))
+_SCOUT_MODEL_HELP = (
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the "
+ "platform's agent models; an invalid id is rejected with the available ones listed. Null keeps "
+ "the default model, chosen by the platform. Early access: the pin can only be set on projects "
+ "enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+)
+
+
+def _validate_scout_model(value: str | None, context: dict, current: str | None = None) -> str | None:
+ """Normalize a scout model pin, gate setting one on the `scouts-model-config` dogfood flag, and
+ hold it to the platform's model catalog.
+
+ Two writes stay ungated: clearing (null, or a blank string normalized to null), and re-sending
+ the stored value unchanged — clients (MCP callers especially) resend whole config objects, and
+ a stale pin must not block unrelated edits after a team leaves the preview.
+ """
+ if value is not None:
+ value = value.strip() or None
+ if value is None or value == current:
+ return value
+ get_team = context.get("get_team")
+ # Some create paths pass a `team` object instead of the routed `get_team` lambda.
+ team = get_team() if callable(get_team) else context.get("team")
+ if not isinstance(team, Team) or not scout_model_config_enabled(team):
+ raise serializers.ValidationError("Choosing a scout model is not available on this project yet.")
+ catalog = scout_model_pin_catalog()
+ if value not in catalog:
+ raise serializers.ValidationError(f"Not an available model. Available models: {', '.join(sorted(catalog))}.")
+ return value
+
+
class SignalScoutConfigSerializer(serializers.ModelSerializer):
"""Read shape for a per-(team, skill) scout config.
@@ -2156,6 +2189,11 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):
"external sources such as documentation or papers."
),
)
+ model = serializers.CharField(
+ read_only=True,
+ allow_null=True,
+ help_text=_SCOUT_MODEL_HELP,
+ )
last_run_at = serializers.DateTimeField(
read_only=True,
allow_null=True,
@@ -2233,6 +2271,7 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):
"output_destinations",
"structured_output_schema",
"network_access",
+ "model",
"last_run_at",
"consecutive_failure_count",
"status_changed_at",
@@ -2362,6 +2401,13 @@ class SignalScoutConfigUpdateSerializer(serializers.ModelSerializer):
"`no_output` quiet warning. Set it on watchdog scouts whose value is staying quiet."
),
)
+ model = serializers.CharField(
+ required=False,
+ allow_null=True,
+ allow_blank=True,
+ max_length=200,
+ help_text=_SCOUT_MODEL_HELP,
+ )
tags = _scout_tags_field()
structured_output_schema = StructuredOutputSchemaField(
required=False,
@@ -2378,6 +2424,9 @@ class SignalScoutConfigUpdateSerializer(serializers.ModelSerializer):
def validate_tags(self, value: list[str]) -> list[str]:
return _validate_scout_tags(value)
+ def validate_model(self, value: str | None) -> str | None:
+ return _validate_scout_model(value, self.context, current=self.instance.model if self.instance else None)
+
def validate_structured_output_schema(self, value: dict | None) -> dict | None:
return _validate_structured_output_schema(value)
@@ -2456,6 +2505,7 @@ class SignalScoutConfigUpdateSerializer(serializers.ModelSerializer):
"output_destinations",
"structured_output_schema",
"network_access",
+ "model",
"auto_pause_exempt",
"tags",
]
@@ -2513,6 +2563,13 @@ class SignalScoutConfigOptionsSerializer(serializers.Serializer):
"Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
)
+ model = serializers.CharField(
+ required=False,
+ allow_null=True,
+ allow_blank=True,
+ max_length=200,
+ help_text=_SCOUT_MODEL_HELP,
+ )
tags = _scout_tags_field()
structured_output_schema = StructuredOutputSchemaField(
required=False,
@@ -2526,6 +2583,9 @@ class SignalScoutConfigOptionsSerializer(serializers.Serializer):
def validate_tags(self, value: list[str]) -> list[str]:
return _validate_scout_tags(value)
+ def validate_model(self, value: str | None) -> str | None:
+ return _validate_scout_model(value, self.context)
+
def validate_output_destinations(self, value: dict) -> dict:
context = self.context
if not isinstance(context.get("project_id"), int):
diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.py
index 1e70dd47d4f5..f5c9ff6dbb91 100644
--- a/products/signals/backend/test/test_scout_harness_api.py
+++ b/products/signals/backend/test/test_scout_harness_api.py
@@ -1115,6 +1115,79 @@ class TestScoutHarnessConfigStructuredOutputSchemaAPI(APIBaseTest):
assert config.structured_output_schema is None
+class TestScoutHarnessConfigModelAPI(APIBaseTest):
+ _FLAG_PATH = "products.signals.backend.scout_harness.serializers.scout_model_config_enabled"
+
+ def _detail_url(self, config_id: str) -> str:
+ return f"/api/projects/{self.team.id}/signals/scout/configs/{config_id}/"
+
+ def test_patch_persists_model_when_flag_on(self) -> None:
+ # Wiring guard: the viewset routes `model` through the update serializer and the read
+ # shape returns it for a team inside the `scouts-model-config` dogfood.
+ config = SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-judge")
+ with patch(self._FLAG_PATH, return_value=True):
+ response = self.client.patch(
+ self._detail_url(str(config.id)), data={"model": "claude-opus-4-5"}, format="json"
+ )
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ assert response.json()["model"] == "claude-opus-4-5"
+ config.refresh_from_db()
+ assert config.model == "claude-opus-4-5"
+
+ def test_patch_rejects_model_outside_the_flag(self) -> None:
+ # The dogfood gate on the write path: without the flag a pin can't be stored at all.
+ config = SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-judge")
+ with patch(self._FLAG_PATH, return_value=False):
+ response = self.client.patch(
+ self._detail_url(str(config.id)), data={"model": "claude-opus-4-5"}, format="json"
+ )
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ config.refresh_from_db()
+ assert config.model is None
+
+ @parameterized.expand([("null_clears", None), ("blank_normalizes_to_null", " ")])
+ def test_clearing_model_stays_ungated(self, _name: str, cleared_value: str | None) -> None:
+ # A team that leaves the preview must still be able to remove a stored pin.
+ config = SignalScoutConfig.objects.create(
+ team=self.team, skill_name="signals-scout-judge", model="claude-opus-4-5"
+ )
+ with patch(self._FLAG_PATH, return_value=False):
+ response = self.client.patch(self._detail_url(str(config.id)), data={"model": cleared_value}, format="json")
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ config.refresh_from_db()
+ assert config.model is None
+
+ def test_resending_stored_model_unchanged_stays_ungated(self) -> None:
+ # Clients resend whole config objects, so after a team leaves the preview an unchanged
+ # stored pin must not 400 an unrelated edit.
+ config = SignalScoutConfig.objects.create(
+ team=self.team, skill_name="signals-scout-judge", model="claude-opus-4-5"
+ )
+ with patch(self._FLAG_PATH, return_value=False):
+ response = self.client.patch(
+ self._detail_url(str(config.id)),
+ data={"model": "claude-opus-4-5", "emit": False},
+ format="json",
+ )
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ config.refresh_from_db()
+ assert config.model == "claude-opus-4-5"
+ assert config.emit is False
+
+ def test_patch_rejects_model_outside_catalog(self) -> None:
+ # A typo'd pin would fail every scheduled run until cleared, so the write names the
+ # available models instead of storing it.
+ config = SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-judge")
+ with patch(self._FLAG_PATH, return_value=True):
+ response = self.client.patch(
+ self._detail_url(str(config.id)), data={"model": "claude-opus-4-55"}, format="json"
+ )
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert "Available models" in str(response.json())
+ config.refresh_from_db()
+ assert config.model is None
+
+
class TestScoutHarnessScratchpadAPI(APIBaseTest):
def setUp(self) -> None:
super().setUp()
diff --git a/products/signals/backend/test/test_scout_model_selection.py b/products/signals/backend/test/test_scout_model_selection.py
index 2ec06afadc42..8e796ca7c334 100644
--- a/products/signals/backend/test/test_scout_model_selection.py
+++ b/products/signals/backend/test/test_scout_model_selection.py
@@ -21,8 +21,9 @@ _RUN_ID = "0190a000-0000-7000-8000-000000000001"
def _fake_team(team_id: int = _TEAM_ID, parent_team_id: int | None = None) -> Team:
- # resolve_scout_model only reads id + parent_team_id, so a lightweight stand-in avoids the DB.
- return cast(Team, SimpleNamespace(id=team_id, parent_team_id=parent_team_id))
+ # resolve_scout_model only reads id, parent_team_id, and uuid (the config-pin flag key), so a
+ # lightweight stand-in avoids the DB.
+ return cast(Team, SimpleNamespace(id=team_id, parent_team_id=parent_team_id, uuid=f"team-uuid-{team_id}"))
def _resolve_full(
@@ -208,3 +209,39 @@ class TestResolveScoutModel:
# A scout must never fail to run because the gate was unreachable — fall back to the default.
with patch(_PAYLOAD_PATH, side_effect=RuntimeError("flag service down")):
assert resolve_scout_model(_fake_team(), _SKILL, _RUN_ID) == ScoutModel(model=None, runtime_adapter=None)
+
+
+class TestConfigModelPin:
+ _FLAG_PATH = "products.signals.backend.scout_harness.model_selection.scout_model_config_enabled"
+ _FULL_WEIGHT_PAYLOAD = _scouts({_SKILL: {_GPT: 1}})
+
+ def _resolve_pinned(self, pin: str, *, flag_on: bool) -> ScoutModel:
+ with patch(self._FLAG_PATH, return_value=flag_on), patch(_PAYLOAD_PATH, return_value=self._FULL_WEIGHT_PAYLOAD):
+ return resolve_scout_model(_fake_team(), _SKILL, _RUN_ID, configured_model=pin)
+
+ @parameterized.expand(
+ [
+ ("claude_pin", "claude-opus-4-5", "claude"),
+ ("codex_pin", "gpt-5", "codex"),
+ # The Cloudflare-served GLM id runs on the `claude` runtime per the canonical Tasks
+ # catalog — name inference alone would misroute it to `codex`.
+ ("cloudflare_pin_follows_catalog", GLM_MODEL, "claude"),
+ ]
+ )
+ def test_pin_beats_payload_and_resolves_runtime(self, _name: str, pin: str, expected_adapter: str) -> None:
+ # The payload routes every run to another model; an explicit pin must win over the experiment.
+ assert self._resolve_pinned(pin, flag_on=True) == ScoutModel(model=pin, runtime_adapter=expected_adapter)
+
+ def test_pin_is_ignored_outside_the_flag(self) -> None:
+ # The dogfood gate: with the flag off a stored pin is inert and the payload layer applies.
+ assert self._resolve_pinned("claude-opus-4-5", flag_on=False).model == _GPT
+
+ def test_flag_read_failure_falls_through_to_payload(self) -> None:
+ # Same never-fail posture as the payload read: a flag outage demotes the pin, never the run.
+ flag_read = "products.signals.backend.scout_harness.model_selection.posthoganalytics.feature_enabled"
+ with (
+ patch(flag_read, side_effect=RuntimeError("flag service down")),
+ patch(_PAYLOAD_PATH, return_value=self._FULL_WEIGHT_PAYLOAD),
+ ):
+ resolved = resolve_scout_model(_fake_team(), _SKILL, _RUN_ID, configured_model="claude-opus-4-5")
+ assert resolved.model == _GPT
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index 46e41332b5ea..b6fe1a35d54a 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -1888,6 +1888,12 @@ export interface SignalScoutConfigOptionsApi {
* @nullable
*/
run_cron_schedule?: string | null
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @maxLength 200
+ * @nullable
+ */
+ model?: string | null
/**
* Free-form labels for grouping the fleet, e.g. `["revenue", "on-call"]`. Normalized to lowercase kebab-case (`On Call` and `on_call` both become `on-call`), deduped, and stored sorted; at most 10 tags, each at most 50 characters once normalized. Pass the full desired set — a write replaces the existing tags rather than merging into them. Filter the config list with the `tags` query parameter.
* @maxItems 10
@@ -2027,6 +2033,11 @@ export interface SignalScoutConfigApi {
* * `trusted` - Trusted domains only
* * `full` - Full */
readonly network_access: ScoutConfigNetworkAccessEnumApi
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @nullable
+ */
+ readonly model: string | null
/**
* When the coordinator last dispatched this scout. Null if it has never run.
* @nullable
@@ -2091,6 +2102,12 @@ export interface SignalScoutConfigCreateApi {
* @nullable
*/
run_cron_schedule?: string | null
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @maxLength 200
+ * @nullable
+ */
+ model?: string | null
/**
* Free-form labels for grouping the fleet, e.g. `["revenue", "on-call"]`. Normalized to lowercase kebab-case (`On Call` and `on_call` both become `on-call`), deduped, and stored sorted; at most 10 tags, each at most 50 characters once normalized. Pass the full desired set — a write replaces the existing tags rather than merging into them. Filter the config list with the `tags` query parameter.
* @maxItems 10
@@ -2146,6 +2163,12 @@ export interface PatchedSignalScoutConfigUpdateApi {
* * `trusted` - Trusted domains only
* * `full` - Full */
network_access?: ScoutConfigNetworkAccessEnumApi
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @maxLength 200
+ * @nullable
+ */
+ model?: string | null
/** Exempt this scout from the inactivity sweep, meaning both the `ignored` pause and the `no_output` quiet warning. Set it on watchdog scouts whose value is staying quiet. */
auto_pause_exempt?: boolean
/**
diff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.ts
index be45565255c2..8343216fc6b8 100644
--- a/products/signals/frontend/generated/api.zod.ts
+++ b/products/signals/frontend/generated/api.zod.ts
@@ -336,6 +336,8 @@ export const signalsScoutCreateBodyConfigOneOutputDestinationsOneSlackOneChannel
export const signalsScoutCreateBodyConfigOneRunCronScheduleMax = 100
+export const signalsScoutCreateBodyConfigOneModelMax = 200
+
export const signalsScoutCreateBodyConfigOneTagsMax = 10
export const SignalsScoutCreateBody = /* @__PURE__ */ zod
@@ -440,6 +442,13 @@ export const SignalsScoutCreateBody = /* @__PURE__ */ zod
.describe(
"Optional five-field cron expression, e.g. '30 9 \* \* \*' (daily at 09:30), '0 9,17 \* \* \*' (twice daily), or '0 9 \* \* 1-5' (weekday mornings). Evaluated in the project timezone. Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
+ model: zod
+ .string()
+ .max(signalsScoutCreateBodyConfigOneModelMax)
+ .nullish()
+ .describe(
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ ),
tags: zod
.array(zod.string())
.max(signalsScoutCreateBodyConfigOneTagsMax)
@@ -473,6 +482,8 @@ export const signalsScoutConfigCreateBodyOutputDestinationsOneSlackOneChannelMax
export const signalsScoutConfigCreateBodyRunCronScheduleMax = 100
+export const signalsScoutConfigCreateBodyModelMax = 200
+
export const signalsScoutConfigCreateBodyTagsMax = 10
export const signalsScoutConfigCreateBodySkillNameMax = 200
@@ -540,6 +551,13 @@ export const SignalsScoutConfigCreateBody = /* @__PURE__ */ zod
.describe(
"Optional five-field cron expression, e.g. '30 9 \* \* \*' (daily at 09:30), '0 9,17 \* \* \*' (twice daily), or '0 9 \* \* 1-5' (weekday mornings). Evaluated in the project timezone. Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
+ model: zod
+ .string()
+ .max(signalsScoutConfigCreateBodyModelMax)
+ .nullish()
+ .describe(
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ ),
tags: zod
.array(zod.string())
.max(signalsScoutConfigCreateBodyTagsMax)
@@ -575,6 +593,8 @@ export const signalsScoutConfigUpdateBodyRunCronScheduleMax = 100
export const signalsScoutConfigUpdateBodyOutputDestinationsOneSlackOneChannelMax = 255
+export const signalsScoutConfigUpdateBodyModelMax = 200
+
export const signalsScoutConfigUpdateBodyTagsMax = 10
export const SignalsScoutConfigUpdateBody = /* @__PURE__ */ zod
@@ -647,6 +667,13 @@ export const SignalsScoutConfigUpdateBody = /* @__PURE__ */ zod
.describe(
"What the scout's sandbox can reach over the network while it runs. `trusted` (the default) restricts runs to the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers. Applies from the scout's next run.\n\n\* `trusted` - Trusted domains only\n\* `full` - Full"
),
+ model: zod
+ .string()
+ .max(signalsScoutConfigUpdateBodyModelMax)
+ .nullish()
+ .describe(
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ ),
auto_pause_exempt: zod
.boolean()
.optional()
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 3d3b98a7dbc1..9d6086cfe16e 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -56756,6 +56756,12 @@ export namespace Schemas {
* * `trusted` - Trusted domains only
* * `full` - Full */
network_access?: ScoutConfigNetworkAccessEnum;
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @maxLength 200
+ * @nullable
+ */
+ model?: string | null;
/** Exempt this scout from the inactivity sweep, meaning both the `ignored` pause and the `no_output` quiet warning. Set it on watchdog scouts whose value is staying quiet. */
auto_pause_exempt?: boolean;
/**
@@ -66821,6 +66827,11 @@ export namespace Schemas {
* * `trusted` - Trusted domains only
* * `full` - Full */
readonly network_access: ScoutConfigNetworkAccessEnum;
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @nullable
+ */
+ readonly model: string | null;
/**
* When the coordinator last dispatched this scout. Null if it has never run.
* @nullable
@@ -66878,6 +66889,12 @@ export namespace Schemas {
* @nullable
*/
run_cron_schedule?: string | null;
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @maxLength 200
+ * @nullable
+ */
+ model?: string | null;
/**
* Free-form labels for grouping the fleet, e.g. `["revenue", "on-call"]`. Normalized to lowercase kebab-case (`On Call` and `on_call` both become `on-call`), deduped, and stored sorted; at most 10 tags, each at most 50 characters once normalized. Pass the full desired set — a write replaces the existing tags rather than merging into them. Filter the config list with the `tags` query parameter.
* @maxItems 10
@@ -66930,6 +66947,12 @@ export namespace Schemas {
* @nullable
*/
run_cron_schedule?: string | null;
+ /**
+ * Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
+ * @maxLength 200
+ * @nullable
+ */
+ model?: string | null;
/**
* Free-form labels for grouping the fleet, e.g. `["revenue", "on-call"]`. Normalized to lowercase kebab-case (`On Call` and `on_call` both become `on-call`), deduped, and stored sorted; at most 10 tags, each at most 50 characters once normalized. Pass the full desired set — a write replaces the existing tags rather than merging into them. Filter the config list with the `tags` query parameter.
* @maxItems 10
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index c243a8d495ae..84c8ee3841f1 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -426,6 +426,8 @@ export const signalsScoutCreateBodyConfigOneOutputDestinationsOneSlackOneChannel
export const signalsScoutCreateBodyConfigOneRunCronScheduleMax = 100
+export const signalsScoutCreateBodyConfigOneModelMax = 200
+
export const signalsScoutCreateBodyConfigOneTagsMax = 10
export const SignalsScoutCreateBody = /* @__PURE__ */ zod
@@ -530,6 +532,13 @@ export const SignalsScoutCreateBody = /* @__PURE__ */ zod
.describe(
"Optional five-field cron expression, e.g. '30 9 \* \* \*' (daily at 09:30), '0 9,17 \* \* \*' (twice daily), or '0 9 \* \* 1-5' (weekday mornings). Evaluated in the project timezone. Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
+ model: zod
+ .string()
+ .max(signalsScoutCreateBodyConfigOneModelMax)
+ .nullish()
+ .describe(
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ ),
tags: zod
.array(zod.string())
.max(signalsScoutCreateBodyConfigOneTagsMax)
@@ -593,6 +602,8 @@ export const signalsScoutConfigCreateBodyOutputDestinationsOneSlackOneChannelMax
export const signalsScoutConfigCreateBodyRunCronScheduleMax = 100
+export const signalsScoutConfigCreateBodyModelMax = 200
+
export const signalsScoutConfigCreateBodyTagsMax = 10
export const signalsScoutConfigCreateBodySkillNameMax = 200
@@ -660,6 +671,13 @@ export const SignalsScoutConfigCreateBody = /* @__PURE__ */ zod
.describe(
"Optional five-field cron expression, e.g. '30 9 \* \* \*' (daily at 09:30), '0 9,17 \* \* \*' (twice daily), or '0 9 \* \* 1-5' (weekday mornings). Evaluated in the project timezone. Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
+ model: zod
+ .string()
+ .max(signalsScoutConfigCreateBodyModelMax)
+ .nullish()
+ .describe(
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ ),
tags: zod
.array(zod.string())
.max(signalsScoutConfigCreateBodyTagsMax)
@@ -704,6 +722,8 @@ export const signalsScoutConfigUpdateBodyRunCronScheduleMax = 100
export const signalsScoutConfigUpdateBodyOutputDestinationsOneSlackOneChannelMax = 255
+export const signalsScoutConfigUpdateBodyModelMax = 200
+
export const signalsScoutConfigUpdateBodyTagsMax = 10
export const SignalsScoutConfigUpdateBody = /* @__PURE__ */ zod
@@ -776,6 +796,13 @@ export const SignalsScoutConfigUpdateBody = /* @__PURE__ */ zod
.describe(
"What the scout's sandbox can reach over the network while it runs. `trusted` (the default) restricts runs to the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers. Applies from the scout's next run.\n\n\* `trusted` - Trusted domains only\n\* `full` - Full"
),
+ model: zod
+ .string()
+ .max(signalsScoutConfigUpdateBodyModelMax)
+ .nullish()
+ .describe(
+ "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ ),
auto_pause_exempt: zod
.boolean()
.optional()
diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.ts
index bb7054f5f0bb..19026e50f336 100644
--- a/services/mcp/src/tools/generated/signals.ts
+++ b/services/mcp/src/tools/generated/signals.ts
@@ -539,6 +539,9 @@ const scoutConfigCreate = (): ToolBase<typeof ScoutConfigCreateSchema, Schemas.S
if (params.run_cron_schedule !== undefined) {
body['run_cron_schedule'] = params.run_cron_schedule
}
+ if (params.model !== undefined) {
+ body['model'] = params.model
+ }
if (params.tags !== undefined) {
body['tags'] = params.tags
}
@@ -637,6 +640,9 @@ const scoutConfigUpdate = (): ToolBase<typeof ScoutConfigUpdateSchema, WithPostH
if (params.network_access !== undefined) {
body['network_access'] = params.network_access
}
+ if (params.model !== undefined) {
+ body['model'] = params.model
+ }
if (params.auto_pause_exempt !== undefined) {
body['auto_pause_exempt'] = params.auto_pause_exempt
}
@@ -1224,6 +1230,9 @@ const signalsScoutConfigCreate = (): ToolBase<typeof SignalsScoutConfigCreateSch
if (params.run_cron_schedule !== undefined) {
body['run_cron_schedule'] = params.run_cron_schedule
}
+ if (params.model !== undefined) {
+ body['model'] = params.model
+ }
if (params.tags !== undefined) {
body['tags'] = params.tags
}
@@ -1331,6 +1340,9 @@ const signalsScoutConfigUpdate = (): ToolBase<
if (params.network_access !== undefined) {
body['network_access'] = params.network_access
}
+ if (params.model !== undefined) {
+ body['model'] = params.model
+ }
if (params.auto_pause_exempt !== undefined) {
body['auto_pause_exempt'] = params.auto_pause_exempt
}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json
index 660662320f78..532320c2d115 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json
@@ -14,6 +14,18 @@
"description": "Whether this scout runs on its schedule. Defaults to true.",
"type": "boolean"
},
+ "model": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ },
"network_access": {
"description": "What the scout's sandbox can reach over the network while it runs. Defaults to `trusted`, the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers.\n\n* `trusted` - Trusted domains only\n* `full` - Full",
"enum": ["trusted", "full"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json
index ad3365c1ae40..01139b66368a 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json
@@ -17,6 +17,18 @@
"description": "A UUID string identifying this Signal scout config.",
"type": "string"
},
+ "model": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ },
"network_access": {
"description": "What the scout's sandbox can reach over the network while it runs. `trusted` (the default) restricts runs to the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers. Applies from the scout's next run.\n\n* `trusted` - Trusted domains only\n* `full` - Full",
"enum": ["trusted", "full"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create-prepare.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create-prepare.json
index b85b5cdb576d..d05c609bcf6b 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create-prepare.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create-prepare.json
@@ -21,6 +21,18 @@
"description": "Whether this scout runs on its schedule. Defaults to true.",
"type": "boolean"
},
+ "model": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ },
"network_access": {
"description": "What the scout's sandbox can reach over the network while it runs. Defaults to `trusted`, the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers.\n\n* `trusted` - Trusted domains only\n* `full` - Full",
"enum": ["trusted", "full"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json
index 660662320f78..532320c2d115 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json
@@ -14,6 +14,18 @@
"description": "Whether this scout runs on its schedule. Defaults to true.",
"type": "boolean"
},
+ "model": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ },
"network_access": {
"description": "What the scout's sandbox can reach over the network while it runs. Defaults to `trusted`, the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers.\n\n* `trusted` - Trusted domains only\n* `full` - Full",
"enum": ["trusted", "full"],
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json
index ad3365c1ae40..01139b66368a 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json
@@ -17,6 +17,18 @@
"description": "A UUID string identifying this Signal scout config.",
"type": "string"
},
+ "model": {
+ "anyOf": [
+ {
+ "maxLength": 200,
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it."
+ },
"network_access": {
"description": "What the scout's sandbox can reach over the network while it runs. `trusted` (the default) restricts runs to the platform's trusted-domain allowlist (PostHog, GitHub, common package registries). Set `full` to let this scout reach any site, for skills that read external sources such as documentation or papers. Applies from the scout's next run.\n\n* `trusted` - Trusted domains only\n* `full` - Full",
"enum": ["trusted", "full"],