: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(workflows): add the signals scout that files workflow suggestions (#110051)
Daniel Marchuk84d694478296
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 3d28d17d92b6..1935249580c4 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -10923,29 +10923,29 @@ snapshots:scenes-app-inbox-scoutwriteaccesstag--granted--light:hash: v1.k794b7964.f43a37d7ad168d1f8b879e6361bf0cf88f1c492e176567a24f8919f7281cff27.WDlRZQnnmsRUqVgEm4VItfi-i3Dq86esxOUoRJ35jdsscenes-app-inbox-scoutwritescopespicker--cannot-edit--dark:- hash: v1.k794b7964.c9bb5c4f941cec95563f50856191d17ca6809ef919b24d7b3b361e5240b98096.3UPJuDEp44rGfKFPxfMvfjM4i3lt0a__DFLpYbSOxbE+ hash: v1.k794b7964.022f4393857b3f31dbedbdbf5dddad37846b8330891d459d0eefb1848b617aa0.H0juPWFXqASnkme6l6dcpZKOT3qVEgLVnAFu8Uf1qCkscenes-app-inbox-scoutwritescopespicker--cannot-edit--light:- hash: v1.k794b7964.62e0e3ea07891b6e0e628938bb9067b623a55a001bc0bf24aad003374232fb98.FcFjIBpGtg8xYSMV_o-ArSjOtqJeMLKDtsvJnsFWWaY+ hash: v1.k794b7964.3d40e72adff56b86023be392f0cccf83cb542d6b6210c99bf8a63adfab148fef.mOuXRmddPLKs8R0gXFHI6BkjJrzkEt4N9u01TndUxQIscenes-app-inbox-scoutwritescopespicker--maintainer-scout--dark:- hash: v1.k794b7964.104534d082e2467cc674da41f38b4e2315580816b9772572558ce2df6aa2ac99.ixr9C9R8psbZAi6ZlA1jkPSIpPI3Q4TFfLWZcQ1997A+ hash: v1.k794b7964.3982fa9a12c31811cddadcfdd077a33c8a693916aa8aaaf71e459082d9ee0286.HzdEReyN-Vyu23rDiIn0C3RgpL0gfuFe7XO0r4T9eToscenes-app-inbox-scoutwritescopespicker--maintainer-scout--light:- hash: v1.k794b7964.faa19843666ae593a59000b174fae1f50039974f2e7014282fd756d7f69d8421.Zd6qBSPAEK_gK9DxLqLuiSjWeAi2P5eZjEzvKSwjeX4+ hash: v1.k794b7964.42dc1c80dc93f76ff95ea5100700cc87e289175d65bc223ae05ad07e812338ed.eeVjbrISGN_Lprmi-sIWoXUK2zbrExMcFl3jmCyMUYcscenes-app-inbox-scoutwritescopespicker--read-only-scout--dark:- hash: v1.k794b7964.e58188cc02623cac508bddb005dd6b7267c1658156cb0f96ddd971109ce02592.XqvOpXJ5XVTJYLrJQFkvijDoHT_KjpiyeGA3uJSkjK8+ hash: v1.k794b7964.f3b0511e8df7ed0a60ff4a79fa7db4a35b01f3b7385200a369d73afc2d7eef57.6L-55SchmHtIt3VsZkNmw8wpJbt_I2JA6XR0iGOB2JQscenes-app-inbox-scoutwritescopespicker--read-only-scout--light:- hash: v1.k794b7964.f8de6fb715cd4b2ad3709322aa86358b65c8b09923660368a0850277edce1b01.PxKjEcv9nOE1X3MyLaeWy89vu6FI5jKaSFh3sq_6ME4+ hash: v1.k794b7964.ec143c7228b21c2eea7c6d9d0c76d80c4edc5ad686ae9c0a162201d2ea353153.QhYP3cM6zHZr9cxUP94__JwCsoSQ9xWkJIiBSG0MsxQscenes-app-inbox-scoutwritescopespicker--scanner-maintainer-scout--dark:- hash: v1.k794b7964.1de2f1b62bfc2167e9691c0a22ffc92da89d6549d07de7d35ff20f8dddcf2d67.qCKJkywbjibFX20ebmq6jWmDtK2U2d9gZazv469fITU+ hash: v1.k794b7964.c7fb2c141a28942784fe91f0c8b0b4398d1d5da73b295589d8e10c4582a9e435.caFJR_kITRUW9emLVrhIxv4Wim_CVz3pFVPYoeGZMY0scenes-app-inbox-scoutwritescopespicker--scanner-maintainer-scout--light:- hash: v1.k794b7964.fcc3c0bf9966b3f5faf223ac564a157956a7c5b259c2960f3d34ad8737a16448.Wu6fibVJTa149DPRuLcjzYRXDz0hDW7k_DU5Nu_w1VY+ hash: v1.k794b7964.b8f515bbb7a1c992fed9d22b60e7c5916fbc80827bb4cdbcbb87d164a33de6f0.HREBnyfjpkyoIyquIB3PaVHhOKx5T_8DsIKZwrqWmhoscenes-app-inbox-scoutwritescopespicker--scout-settings-variant--dark:- hash: v1.k794b7964.23cbef8af9dc80c05c740c01e4adb1d610361aa4fa4f42e96e311361d925b8d3.1xZXajcCq_kUnAzi_lCcX-ACsoLL27AVGVINvFCzcuE+ hash: v1.k794b7964.762707d8c0f21f1402cf6a09ceebca3325478de720049140f022c2f7759827a3.9AWfo6pAkCqJJ08W-g_DGXAUuXRPHnev4TMi-iNdO-gscenes-app-inbox-scoutwritescopespicker--scout-settings-variant--light:- hash: v1.k794b7964.ba652e1d9f4b8048db3c0e34c2aab3c82f46c012c3377603640c0fe33ca0b866.zOW4K9FJLsrw-pCWyPKBMSE71yYXXetGgEujpnnnRQc+ hash: v1.k794b7964.5fb3d95e638c584ca6b374a4bc766ebec475521d99d5532b45de0de21dcb8560.ZU6kBK5-1i3JX-Hw8gPH0105w4fNt0zEsQ7Qtg6bJ3Mscenes-app-inbox-scoutwritescopespicker--with-granted-scopes--dark:- hash: v1.k794b7964.cb0bf2a5b5c04bf653a613060ce31b35c700769f1418af85d7c011573adfe7c0.3pUVx5Ewt1RTMFjjp0szwf_MSWuXteWS4ZHIjOw8KgM+ hash: v1.k794b7964.ed9859a10dee6f063f7cdcfc1fafb666ad4bc616817ae87a01c0995c1f8b9ec6.w3nrA1zzD74NzJmtQj1t0iFlmojMwDlS0zpVL_xEL6gscenes-app-inbox-scoutwritescopespicker--with-granted-scopes--light:- hash: v1.k794b7964.ed460bdcc012aaffe02e97cf6384140fe6b5933a39445ac919c7dbd39080c3c5.5TZhxB-vPaqOfvDgbplcbemM2EJbz1LzzjKCOrp0Msk+ hash: v1.k794b7964.515c01dcefc88e4fbc3e15a1559f4c2376c52e3b889a74493f3d77c7bb404f70.g8KjCGOSDfoxn9zBppVSCF0if5E7i2B_XMjo10OGC3Escenes-app-inbox-selfdrivingsection--daily-limit-reached--dark:hash: v1.k794b7964.4a44499b80e3b4929fae54d29924187253c3d56de5d4931e048e2d40f2a8fdbf._pm2YuKeybVX5dJoTbJTx9020tKZ9pl-Ygpdj5qX8jYscenes-app-inbox-selfdrivingsection--daily-limit-reached--light:diff --git a/posthog/temporal/oauth.py b/posthog/temporal/oauth.pyindex 11bcd3001f00..b43cb4a02473 100644--- a/posthog/temporal/oauth.py+++ b/posthog/temporal/oauth.py@@ -254,8 +254,8 @@ SCOUT_USER_WRITE_SCOPES: list[str] = [# person to approve or reject. Deliberately not `hog_flow:write`, which# also publishes, updates and test-sends a workflow: this scope can put# nothing in front of anyone. Creates only; a suggestion is resolved by-# a person. The workflows scout declares it in its SKILL.md-# (`scout-write-scopes`), so no other scout holds it unless granted.+# a person. A person grants it in the scout's write access settings, the+# same way as every other scope here, so no scout holds it by default.## `annotation:write` and `alert:write` exceed the "recoverable, project-scoped" bar the other# scopes meet. They stay in the v1 set that #94263 puts to the team, because narrowing the set isdiff --git a/posthog/test/repo_invariants/signals_scout_tool_citations_baseline.txt b/posthog/test/repo_invariants/signals_scout_tool_citations_baseline.txtindex 60808ba35dfc..4879256af84c 100644--- a/posthog/test/repo_invariants/signals_scout_tool_citations_baseline.txt+++ b/posthog/test/repo_invariants/signals_scout_tool_citations_baseline.txt@@ -61,5 +61,8 @@ vision-scanners-watch-feedweb-analytics-weekly-digestworkflows-global-statsworkflows-list-invocations+workflows-list-proposalsworkflows-logsworkflows-stats+workflows-suggest+workflows-version-statsdiff --git a/products/signals/backend/scout_harness/prompt.py b/products/signals/backend/scout_harness/prompt.pyindex 83b6855ee9f5..715387ba04ca 100644--- a/products/signals/backend/scout_harness/prompt.py+++ b/products/signals/backend/scout_harness/prompt.py@@ -838,6 +838,7 @@ _WRITE_ACCESS_OBJECTS: dict[str, str] = {"warehouse_view:write": "data warehouse views","warehouse_table:write": "data warehouse tables","replay_scanner:write": "replay vision scanners",+ "hog_flow_proposal:write": "suggested changes to workflows, which a person approves or rejects",}diff --git a/products/signals/frontend/inbox/components/config/scouts/scoutWriteScopes.ts b/products/signals/frontend/inbox/components/config/scouts/scoutWriteScopes.tsindex e7931d210fc5..8741bc169ac4 100644--- a/products/signals/frontend/inbox/components/config/scouts/scoutWriteScopes.ts+++ b/products/signals/frontend/inbox/components/config/scouts/scoutWriteScopes.ts@@ -5,7 +5,14 @@ import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'export interface ScoutWriteScopeRow {scope: string/** Heading the row sits under. Purely a label: the API stores a flat list of scopes. */- group: 'Analytics' | 'Monitoring' | 'Customer analytics' | 'Scouts and skills' | 'Data' | 'Replay vision'+ group:+ | 'Analytics'+ | 'Monitoring'+ | 'Customer analytics'+ | 'Scouts and skills'+ | 'Data'+ | 'Replay vision'+ | 'Workflows'label: stringdescription: string/** Flag the product is still released behind. Its MCP tools share it, so a grant without it is inert. */@@ -85,6 +92,13 @@ export const SCOUT_WRITE_SCOPE_ROWS: ScoutWriteScopeRow[] = [description:'Create and update scanners, rate observations, and apply prompt suggestions. A scanner spends credits as it runs, so a scout has to give any it creates a credit limit. Scouts cannot delete scanners',},+ {+ scope: 'hog_flow_proposal:write',+ group: 'Workflows',+ label: 'Workflow suggestions',+ description:+ 'Suggest changes to workflows whose owner turned suggestions on. A person approves or rejects each one; the scout cannot publish',+ },]/** What every scout can write, whatever its grant. Shown so the picker is the whole picture. */diff --git a/products/signals/skills/AGENTS.md b/products/signals/skills/AGENTS.mdindex b27e473064f3..dce3190c7ea5 100644--- a/products/signals/skills/AGENTS.md+++ b/products/signals/skills/AGENTS.md@@ -38,6 +38,7 @@ A scout is a skill that holds a `SignalScoutConfig`. The harness globs `signals-seasonality-aligned baselines (robust z against the median/MAD of four same-weekday aligned windows), attribution breakage (paid traffic reclassifying into Direct/Unknown when UTM tagging breaks), entry-path bounce steps and traffic cliffs, and 404 spikes (via the project's own not-found event, discovered by name). Its discriminator is segment-vs-aggregate divergence — one channel/path/referrer stepping away from its own baseline while totals hold is signal; the whole site moving together is baseline. On the **report channel** (`emit_report` / `edit_report`): files each dated, segment-named divergence as a 1:1 inbox report, editing the live report while the divergence persists. Whole-site metric anomalies on watched dashboards are the anomaly-detection scout's territory; page-performance is the web-vitals scout's.- `signals-scout-web-vitals/` — Core Web Vitals watcher. Reads each page's p75 LCP / INP / CLS / FCP from `$web_vitals` against the absolute Google thresholds (good / needs-improvement / poor) _and_ against its own history: pages standing in the poor band (the absolute view the relative scouts miss), pages crossing a band boundary after a deploy (dated against a daily series, then narrowed to a sub-hour UTC boundary and correlated with the project's own hidden GIT deploy annotations and feature flag activity log — a flag or variant candidate has to be confirmed by splitting the metric on `$feature/<key>` before it is named as the cause), and sharp in-band regressions. Its discriminator is band-placement on a volume-stable percentile, with a page-scoped-vs-site-wide second axis (one page is code/content; all pages together is a population / CDN / third-party shift). Every finding carries a metric-specific cause hypothesis and a concrete remediation (bundled `references/remediation.md`), and a dated one also carries the change that landed inside its onset boundary (bundled `references/onset-correlation.md`). On the **report channel** (`emit_report` / `edit_report`): files each page+metric finding as a 1:1 inbox report, editing the live report while the page stays slow. Vitals-capture _absence_ is the health-checks scout's territory, not this one's.- `signals-scout-experiments/` — validity watcher for A/B experiments. Audits the measurement machinery rather than the results: sample ratio mismatch, `$multiple` contamination, exposure stalls, mid-run flag mutations, plus lifecycle drift (zombies, ended-but-contaminating flags). Its discriminator is config-vs-data contradiction — the configured split / status / flag state against what the exposure stream actually shows.+- `signals-scout-workflows/` — suggestion producer for workflows, and the odd shape in the fleet: it does not only report, it files a concrete change through the workflows suggestions API for a person to approve or reject on the workflow itself. The one scout deliberately **off the report channel**: a report's actionability is model-set and unjudged, and an actionable one can dispatch an implementation run against the customer's repo and open a billable pull request — wrong work at a real cost for a change that is PostHog configuration, not code. The suggestion on the workflow page is the notification instead. Reads only the workflows whose owner turned on "Suggest improvements" (`workflows-list?optimization_enabled=true`) — no opt-in, no read — and proposes at most one change per workflow per run. Its discriminator is a step whose own delivery metrics say it underperforms where the change is the thing those metrics point at: open rate under target on enough tracked sends, with the counter-metrics (bounces, complaints) clean, since elevated bounces are a deliverability finding that rewriting copy makes worse. Its suggestion tools exist only on projects with the `self-optimising-workflows` flag, and nothing in the harness reads that flag, so hold it back from a team with the `signals-scout` flag's `withheld_skills` until the project has it. It is also the one canonical scout on **neither** channel: with no `allowed_tools` the harness renders the legacy signal persona, and the skill body overrides it in so many words (never `emit_signal`). It needs the `hog_flow_proposal:write` grant, ticked in the scout's write access settings; no other scout holds it. Delivery failures of workflows themselves are `signals-scout-data-pipelines` territory, not this one's.- `signals-scout-observability-gaps/` — the odd one out. Watches for _structural gaps_ between events being captured and existing insight / dashboard / alert coverage, and emits P3 _recommendations_ rather than P0–P2 _anomalies_.- `signals-scout-insight-alerts/` — digest + triage layer over the team's own configured insight alerts (threshold / detector alerts on insights). Doesn't re-detect anomalies — the user already set the thresholds — it reads each alert's recent firing history (`alerts-list` to triage all alerts cheaply, `alert-get` to deep-read the firing checks of the few candidates) and surfaces the recent firings a human most likely missed. Its discriminator is missed-ness × materiality × persistence, weighting hardest toward firings the standard notification path stayed silent on (no subscribers, suppressed by the investigation agent, or an alert silently Errored and no longer evaluating); skips snoozed / disabled / flapping / already-notified-and-resolved. Complements `observability-gaps` (which recommends _creating_ alerts) and `anomaly-detection` (which scores insights the team _views_, whether or not they're alerted) — this one owns the firings of alerts that already exist.- `signals-scout-csp-violations/` — anomaly watcher for Content Security Policy violations (`$csp_violation` blocked-URL clusters, per-directive bursts, post-deploy page-scoped regressions, suspicious third-party domains).diff --git a/products/signals/skills/signals-scout-workflows/SKILL.md b/products/signals/skills/signals-scout-workflows/SKILL.mdnew file mode 100644index 000000000000..9159bde97f26--- /dev/null+++ b/products/signals/skills/signals-scout-workflows/SKILL.md@@ -0,0 +1,201 @@+---+name: signals-scout-workflows+scout-display-name: Workflows+description: >+ Signals scout for PostHog workflows.+ Looks at the workflows whose owner asked for+ suggestions, reads each email step's per-version delivery metrics, and proposes one+ concrete change a person can approve, filed through the workflows suggestions API. It+ files no report and emits no signal: the suggestion on the workflow page is the output.+compatibility: >+ PostHog Signals agent (Claude sandbox).+ Read-only analytics + signal_scout_internal:write+ (scratchpad) + hog_flow_proposal:write (declared below, granted to this scout only), plus the+ workflows tools in the MCP tools section.+ The suggestion tools exist only on projects with the+ `self-optimising-workflows` flag; hold the scout back from a team with the `signals-scout`+ flag's `withheld_skills` until the project has it.+ Deliberately on neither output channel -+ see "Why this scout files no reports".+metadata:+ owner_team: workflows+ scope: workflows+---++# Signals scout: workflows++You suggest changes to workflows their owner already asked you to look at, and you never make one.+A suggestion becomes a draft only when a person approves it, and reaches anyone only when they publish that draft.+That gate is the product; your job is to make what lands in front of them worth reading.++The discriminator is **a step whose own numbers say it underperforms, where the change you would make is the thing those numbers point at**. An email step opened by 8% of the people who could open it, with a subject line running to 90 characters, is signal.+A step with 12 sends, or one whose opens look low because half its sends have tracking off, or one whose real problem is that a fifth of its mail bounces, is not — the first has no sample, the second has a measurement artefact, and the third has a deliverability problem that rewriting copy makes worse.++You produce **at most one suggestion per workflow per run**. A queue of five suggestions for one workflow is a queue nobody reads.++## Quick close-out: is anyone asking?++Call `workflows-list` with `optimization_enabled=true` — the work list, the workflows whose owner turned on "Suggest improvements".+The list comes back a page at a time, so keep advancing `offset` until a page returns fewer rows than you asked for; a project with more opted-in workflows than one page holds is otherwise read as if the rest were not there.+Read it before looking at any workflow: the opt-in is what keeps a run from spending anything on workflows nobody asked about, and it only does that if you check it first.+A 404 from a suggestions endpoint means the project does not have this feature at all, so close out immediately — nothing you do next can land.+If the list is empty, nobody has asked for this here.+Write one scratchpad entry:++- key: `not-in-use:workflow-suggestions`+- content: brief note ("checked at {timestamp}, no workflow opted in")++Close out empty.+Re-running with the same key refreshes the timestamp.+Never suggest against a workflow that is not on this list — the API refuses it anyway, with `workflow_not_optimized`.++## How a run works++### Get oriented++- `scout-scratchpad-search` (`text=workflow`) — what you already decided: steps you ruled out as noise, suggestions a human rejected and why, workflows whose owner keeps turning you down.+- `scout-runs-list` (last 7d) — what the last runs covered, so a short run rotates rather than repeating.+- `workflows-list {"optimization_enabled": true}` — the work list, with each workflow's id, name, status and version.+- `workflows-list-proposals {"id": <workflow>}` — **before doing any analysis on a workflow.**+ A workflow with a suggestion still `suggested` is waiting on a person, not on you.+ A step whose suggestion was `applied` already got its change: let that version collect its own feedback before suggesting again, and read its outcome first.+ A step whose suggestion was `rejected` is a human saying no: do not re-file the same idea in different words.+ A rejected suggestion stays rejected however many times the workflow is published since: `is_stale` reads against the version live now, not against the version the person was looking at, so it cannot tell you the idea went unjudged.++### Read the numbers++Per workflow, `workflows-version-stats` with `version=<the workflow's current version>`, `breakdown_by=name`, and `instance_id` set to the email step you are reading.+`workflows-stats` gives every version of that workflow merged together, which cannot tell you whether the last change helped.+The metrics that matter:++| Metric | Reading |+| -------------------------------- | ------------------------------------------------------------------------ |+| `email_sent` | Everything that went out. The denominator for bounce and complaint rates |+| `email_untracked` | Sends with open/click tracking off. They can never record an open |+| `email_opened` | Opens. Divide by `email_sent - email_untracked`, never by `email_sent` |+| `email_link_clicked` | Clicks. Same denominator as opens |+| `email_bounced`, `email_blocked` | The counter-metrics. Read them before proposing anything about copy |++**Feedback arrives after the send, so read a version that has had time to answer.** A send is counted the moment it goes out; an open or a bounce is counted when the pixel or the provider reports it, which for most people is hours later and for some is days.+Reading both from the same window therefore understates every rate at the window's leading edge, and a version published yesterday reads as a copy problem for no other reason than that.++So end the read before now, and check the version's age before you trust it:++- Read the window as whole days that have closed, not up to this minute.+- Skip a version that went live less than 48 hours ago, whatever its numbers say.+ Read `workflows-stats` by day and treat the first day with sends as when the version went live.+ `updated_at` on the workflow is not this: any draft edit bumps it.+ Write `immature:<workflow>:<step>` to the scratchpad with the version and move on; a later run reads the same version with its feedback in.+- If a version's sends sit almost entirely in the last day of the window, treat the rate as immature for the same reason, even when the version itself is older.++Per-version reads are what make this checkable: `workflows-version-stats` with `version=<n>` returns only what that version sent, so a version published two weeks ago is a settled cohort even though the workflow as a whole is still sending.++**Zero opens on healthy sends is a measurement gap, not a bad subject line.** Engagement splits by version only for sends made after the versioned tracking code shipped, and you cannot check that date from here.+So treat it as unreadable rather than bad: write `noise:<workflow>:<step>` to the scratchpad with the counts you saw and move on.+If a later run sees opens on that step, the gap has closed and the numbers are usable.++### Profile shape++| Pattern | What it usually means |+| ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |+| Open rate under 20% on ≥ 20 tracked sends, long subject | Copy problem — the case this scout exists for |+| Open rate looks terrible, `email_untracked` is most of `email_sent` | Measurement artefact. Say so in a report; do not propose copy |+| Bounce rate above ~2%, or any complaint rate above ~0.1% | Deliverability, not copy. A better subject sends more mail to spam folders faster |+| Zero opens, zero clicks, healthy sends, version older than the tracking rollout | Blind spot, not a finding |+| Fewer than 20 tracked sends | No sample. Remember it, do not file it |+| Open rate healthy, click rate near zero | The body or the call to action, not the subject. Only suggest if you can name the change |++### Decide++File a suggestion through `workflows-suggest` when, and only when, all of these hold:++- No suggestion for this workflow is still waiting on a person, and none was applied to the step you are reading.+- The step clears the sample floor: at least 20 tracked sends in the window you read, and the version has been sending for at least 48 hours so its opens have had time to arrive.+- The counter-metrics are not the story.+ If bounces or complaints are elevated, that is the finding, and it belongs in a report rather than in a copy change.+- You can state the change as a concrete edit, not advice.+ "Shorten the subject" is advice.+ The new subject line is a change.++Send the version you read as `base_version`, and in `actions` only the steps you change, each carrying its `id` and only the fields you change: a new subject line is `{"id": "<step>", "config": {"inputs": {"email": {"value": {"subject": "..."}}}}}` and nothing more.+Everything you leave out stays as it is, in the step and in the rest of the workflow, so a step someone edits while your suggestion waits is not reverted by approving it.+Approving is refused only when someone moved one of the very fields you change, and to something other than what you proposed, and then the suggestion is genuinely stale.+Carry evidence that a person can judge without re-deriving it: the metric, its current value, the target, the window, `n` (the tracked sends behind the rate), the click rate over that same denominator, and the counter-metrics with their own denominators.+A subject line that lifts opens without lifting clicks moved attention, not behaviour, and whoever reads the outcome later should be able to see that.+A rate without `n` is refused at create, and rightly.++The panel reads your evidence back by name, and the API refuses anything it cannot read, so send these keys:++```json+{+ "metric": "email_opened",+ "current_value": 0.0865,+ "unit": "rate",+ "target_value": 0.2,+ "n": 208,+ "window": "-7d",+ "click_through": 0.0192,+ "guardrails": [+ { "metric": "email_bounced", "value": 0.0, "n": 208, "unit": "rate" },+ { "metric": "email_blocked", "value": 0.0, "n": 208, "unit": "rate" }+ ]+}+```++`metric`, `current_value`, `unit`, `n` and `guardrails` are required, and every guardrail needs its own `unit`.+Rates are fractions, never strings: `0.0865`, not `"8.65%"`.+`unit` is `rate` or `count`, and it is not decoration: a value of 1.0 is either every message or one of them, and the panel shows a count of 1 as `1` only because you said so.+A number under a key of your own naming (`current_open_rate`) is refused, because a person would otherwise read a well-evidenced suggestion as having no evidence at all.++Your suggestion is the output.+It appears on the workflow itself, which is where the person who owns that workflow decides.+Never edit the workflow, and never approve: there is no tool for either, by design.++Your run carries the scope `workflows-suggest` needs.+A tool description that names a scope is telling you what the tool requires, not what your token lacks, so make the call rather than ruling it out.+If the call comes back with an error, read it: a validation error names the field to fix and the call is worth retrying, while a permission error is the only evidence that filing is closed to you.+Closing out with a finding you never tried to file wastes the run.++### Remember++Write scratchpad entries for what should change your next run:++- `noise:<workflow>:<step>` — a step you looked at and ruled out, with why (sample, untracked share, deliverability).+- `rejected:<workflow>:<step>` — a human rejected a suggestion for this step.+ Include what you suggested, and whether it was behind the live version when they rejected it, so a later run can tell a no from a clear-out.+- `baseline:<workflow>:<step>` — the open rate you saw, so a later run can tell a real move from noise.++## Why this scout files no reports++Every other scout in the fleet files inbox reports.+This one does not, and that is deliberate.++A report carries an actionability the model sets and nothing judges.+Set it to immediately actionable, with a priority and a reviewer that resolve, and Signals can dispatch an implementation run against the customer's own repository and open a pull request — which is also the moment Signals bills a flat charge.+A workflow subject line is PostHog configuration; there is no code to change, so such a pull request would be wrong work at a real cost, and the only thing standing between here and there would be the model remembering to label its own report correctly.++So the suggestion is the notification.+It lands on the workflow page for the person who turned suggestions on, and this scout stays off the report channel until a report can be pinned as non-implementable by the harness rather than by the model's word.++The same goes for signals.+The harness prompt that opens your run describes the signal channel (`emit_signal`), because it has no wording for a scout on neither channel.+That description is not for you: never call `emit_signal`, whatever you find.+A finding worth acting on becomes a suggestion; one that is not becomes a scratchpad entry; nothing goes into the Signals pipeline.++## Disqualifiers++Do not file a suggestion when:++- The same idea was rejected before.+ A rejection is an answer, unless that suggestion was behind the live version when it was rejected.+- The step is transactional — a receipt, a password reset, a verification code.+ Open rates there are not a campaign metric, and the copy is usually load-bearing.+- The workflow was published since you read its metrics.+ Your suggestion carries a version, and one written against an older version is refused at approve time.+- You would be guessing.+ A suggestion a person cannot check is worse than no suggestion.++## Close out++Write a one-paragraph run summary: which workflows you read, what you suggested, and what you ruled out and why.+A run that suggests nothing but records why is a good run.diff --git a/products/workflows/backend/models/hog_flow_optimization.py b/products/workflows/backend/models/hog_flow_optimization.pyindex fe23172ac33b..ced226cbc831 100644--- a/products/workflows/backend/models/hog_flow_optimization.py+++ b/products/workflows/backend/models/hog_flow_optimization.py@@ -9,8 +9,8 @@ from posthog.models.utils import UUIDModelclass HogFlowOptimization(TeamScopedRootMixin, UUIDModel):"""One row per workflow whose owner asked PostHog to suggest improvements to it.- `enabled` is the opt-in: no row, or a disabled one, means nothing reads the workflow, so a- producer costs nothing for workflows nobody asked about. Turning it off keeps the row, so+ `enabled` is the opt-in: no row, or a disabled one, means no suggestion can be filed for the+ workflow, and the producer's work list leaves it out. Turning it off keeps the row, so"tried it and turned it off" stays answerable - that is the question a rollout has to answer,and a deleted row cannot.diff --git a/products/workflows/mcp/tools.yaml b/products/workflows/mcp/tools.yamlindex 3316d081476c..42976dad6787 100644--- a/products/workflows/mcp/tools.yaml+++ b/products/workflows/mcp/tools.yaml@@ -508,7 +508,7 @@ tools:operation: hog_flows_proposals_createenabled: truescopes:- - hog_flow:write+ - hog_flow_proposal:writeannotations:readOnly: falsedestructive: falsediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 76f19cc84d8c..7d354dbc2ed5 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -14790,7 +14790,7 @@"feature": "workflows","summary": "Suggest a workflow change","title": "Suggest a workflow change",- "required_scopes": ["hog_flow:write"],+ "required_scopes": ["hog_flow_proposal:write"],"annotations": {"destructiveHint": false,"idempotentHint": false,diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 7aeb2e2dc974..38c311b0c641 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -15538,7 +15538,7 @@"feature": "workflows","summary": "Suggest a workflow change","title": "Suggest a workflow change",- "required_scopes": ["hog_flow:write"],+ "required_scopes": ["hog_flow_proposal:write"],"annotations": {"destructiveHint": false,"idempotentHint": false,diff --git a/services/mcp/src/lib/instructions.ts b/services/mcp/src/lib/instructions.tsindex 209cdd26c794..1720a9b39aaf 100644--- a/services/mcp/src/lib/instructions.ts+++ b/services/mcp/src/lib/instructions.ts@@ -234,6 +234,7 @@ export class ToolDomainExtractor {'ship','show','start',+ 'suggest','test','transfer','unarchive',diff --git a/services/mcp/tests/unit/tool-filtering.test.ts b/services/mcp/tests/unit/tool-filtering.test.tsindex 66175189fde8..e508dbbeebb3 100644--- a/services/mcp/tests/unit/tool-filtering.test.ts+++ b/services/mcp/tests/unit/tool-filtering.test.ts@@ -532,6 +532,7 @@ describe('OAUTH_SCOPES_SUPPORTED completeness', () => {// they are intentionally absent from OAUTH_SCOPES_SUPPORTED, so exclude them here.const SERVER_MINT_ONLY_SCOPES = new Set(['context_layer_internal:write',+ 'hog_flow_proposal:write','internal_run:read','loop_context_internal:write','signal_scout_internal:read',