: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
fix(experiments/MCP): Require confirmation before ship-variant + Add further lifecycle evals (#57650)
Marcel Poelkere5df7e176d34
diff --git a/ee/hogai/eval/sandboxed/experiments/eval_lifecycle_skills.py b/ee/hogai/eval/sandboxed/experiments/eval_lifecycle_skills.pynew file mode 100644index 000000000000..c36ee66fc5cf--- /dev/null+++ b/ee/hogai/eval/sandboxed/experiments/eval_lifecycle_skills.py@@ -0,0 +1,118 @@+"""Lifecycle skill behavioral evals.++Three cases that each exercise multiple distinct contracts in the+``managing-experiment-lifecycle`` skill body, picked for high coverage+per case rather than one-contract-per-case repetition.++Coverage:++* ``lifecycle_ship_requires_confirmation`` — name resolution and the+ "always confirm before shipping" guardrail+ (``managing-experiment-lifecycle/SKILL.md`` line 81).++* ``lifecycle_duplicate_unique_key`` — name resolution and the "always+ provide a unique feature_flag_key" guardrail (line 111).++* ``lifecycle_clear_winner_recommendation`` — decision-framework+ correctness (lines 117-126: ship-variant vs end).++We intentionally do NOT include a ``SkillLoaded`` scorer here. As more+guidance moves into the tool descriptions themselves (e.g. Edit 1's+skill pointers, the ship-variant confirmation requirement), the agent+can produce correct behavior without an explicit ``Skill`` invocation.+That's a valid path, not a regression — but the binary ``SkillLoaded``+metric becomes a noisy signal for it. We measure outcomes instead.+Skill-load coverage belongs in a focused, single-purpose eval.++To run:+ flox activate -- bash -c "set -a; source .env; set +a; \\+ pytest -c ee/hogai/eval/pytest.ini \\+ ee/hogai/eval/sandboxed/experiments/eval_lifecycle_skills.py \\+ -v --mcp-mode tools"+"""++from __future__ import annotations++import pytest++from ee.hogai.eval.sandboxed.base import SandboxedPrivateEval+from ee.hogai.eval.sandboxed.config import SandboxedEvalCase+from ee.hogai.eval.sandboxed.experiments.scorers import (+ AskedForConfirmation,+ DuplicateUniqueFlagKey,+ RecommendsShipVariant,+)+from ee.hogai.eval.sandboxed.experiments.seeders import ROLLOUT_EXPERIMENT_NAME, seed_running_experiment+from ee.hogai.eval.sandboxed.scorers import ExitCodeZero, NoToolCall, RequiredToolCall+++# Cases are bundled into one test function rather than @pytest.mark.parametrize+# because the sandboxed harness wraps a list of cases in a single+# SandboxedPrivateEval call: one Braintrust experiment, parallel execution via+# max_concurrency=2, per-case filtering via --eval at the runner level. Pytest-+# level parametrize would create N separate Braintrust experiments, lose the+# parallelism, and break cross-case comparison. Every existing sandboxed eval+# (eval_funnel, eval_retention, eval_insight_retrieval, eval_rollout_skill)+# follows this same single-function-multiple-cases shape.+async def eval_lifecycle_skills(sandboxed_demo_data, pytestconfig, posthog_client, mcp_mode):+ cases: list[SandboxedEvalCase] = [+ # Case 1: Ship variant must require confirmation.+ # Tests name resolution + the "Always confirm before shipping"+ # guardrail (SKILL.md:81).+ SandboxedEvalCase(+ name="lifecycle_ship_requires_confirmation",+ prompt=f"Ship the test variant of experiment '{ROLLOUT_EXPERIMENT_NAME}'.",+ setup=seed_running_experiment,+ expected={"asked_for_confirmation": True},+ ),+ # Case 2: Duplicate must use a fresh feature_flag_key.+ # Tests name resolution + the "always provide a unique+ # feature_flag_key" guardrail (SKILL.md:111). Silently destructive+ # default if the agent omits it.+ SandboxedEvalCase(+ name="lifecycle_duplicate_unique_key",+ prompt=f"Duplicate experiment '{ROLLOUT_EXPERIMENT_NAME}' as a draft.",+ setup=seed_running_experiment,+ expected={"duplicate_unique_flag_key": True},+ ),+ # Case 3: Decision framework — ship vs end disambiguation.+ # Tests decision-framework correctness (SKILL.md:117-126).+ # Pure recommendation case; no tool call+ # necessarily fires. Prompt is intent-only — no claims about+ # lift / p-values, since the seeded experiment has no metrics or+ # exposures and a smart agent would (correctly) push back on+ # data-grounded claims.+ SandboxedEvalCase(+ name="lifecycle_clear_winner_recommendation",+ prompt=(+ f"I want the test variant of experiment '{ROLLOUT_EXPERIMENT_NAME}' "+ f"to be served to all users from now on. What action should I take?"+ ),+ setup=seed_running_experiment,+ expected={"recommends_ship_variant": True},+ ),+ ]++ await SandboxedPrivateEval(+ experiment_name=f"sandboxed-experiments-lifecycle-{mcp_mode}",+ cases=cases,+ scorers=[+ ExitCodeZero(),+ # Agent must look up the named experiment (either tool counts).+ RequiredToolCall(+ required={"experiment-list", "experiment-get-all"},+ name="resolved_experiment_by_name",+ ),+ # Case 1 specifically: agent must NOT ship without asking.+ # Trivially passes for cases 2 and 3 (they don't ship anyway).+ NoToolCall(forbidden=["experiment-ship-variant"], name="no_unconfirmed_ship"),+ # Case-specific (gated via expected={}):+ AskedForConfirmation(),+ DuplicateUniqueFlagKey(),+ RecommendsShipVariant(),+ ],+ pytestconfig=pytestconfig,+ sandboxed_demo_data=sandboxed_demo_data,+ posthog_client=posthog_client,+ )diff --git a/ee/hogai/eval/sandboxed/experiments/scorers.py b/ee/hogai/eval/sandboxed/experiments/scorers.pynew file mode 100644index 000000000000..ef01c5c45c76--- /dev/null+++ b/ee/hogai/eval/sandboxed/experiments/scorers.py@@ -0,0 +1,372 @@+"""Custom scorers for the experiments-domain sandboxed evals.++Three scorers, all case-aware via ``expected`` so they short-circuit on+cases where they aren't applicable. We return ``score=1.0`` with+``metadata={"skipped": True}`` on inapplicable cases instead of+``score=None`` because Braintrust's local summary builder crashes when+aggregating ``None`` (``int + None``). The trade-off: per-scorer+aggregates are mildly inflated (a 100% score with one case checked and+two trivially skipped). Per-case detail is preserved in the local log+dir under ``ee/hogai/eval/sandboxed/logs/``.++* ``DuplicateUniqueFlagKey`` — deterministic. Verifies that when the agent+ calls ``experiment-duplicate``, it provides a ``feature_flag_key`` that+ differs from the seeded original. Tests the explicit guardrail at+ ``managing-experiment-lifecycle/SKILL.md`` line 111.++* ``AskedForConfirmation`` — LLM judge (binary). Did the agent's final+ assistant message ask the user to confirm before a destructive action?+ Tests the guardrail at ``managing-experiment-lifecycle/SKILL.md`` line+ 81 ("Always confirm with the user before shipping").++* ``RecommendsShipVariant`` — LLM judge (binary). Given a "clear winner"+ scenario, did the agent recommend ``experiment-ship-variant`` rather+ than ``experiment-end``? Tests row 1 of the decision-framework matrix.+"""++from __future__ import annotations++from typing import Any++from autoevals.llm import LLMClassifier+from braintrust import Score+from braintrust_core.score import Scorer++from ee.hogai.eval.sandboxed.scorers import LogParser++BINARY_CHOICE_SCORES = {"yes": 1.0, "no": 0.0}+_JUDGE_MODEL = "gpt-4.1"+++def _parser_for(output: dict[str, Any] | None) -> LogParser | None:+ if not output:+ return None+ raw_log = output.get("raw_log")+ if not raw_log:+ return None+ return LogParser(raw_log, initial_prompt=output.get("prompt", "") or "")+++def _user_prompt(output: dict[str, Any] | None) -> str:+ parser = _parser_for(output)+ if parser is not None:+ return parser.get_user_prompt()+ if output:+ prompt = output.get("prompt")+ if isinstance(prompt, str):+ return prompt+ return ""+++def _is_applicable(expected: Any, key: str) -> bool:+ """Return True iff ``expected[key]`` is truthy — case-specific opt-in."""+ return isinstance(expected, dict) and bool(expected.get(key))+++class DuplicateUniqueFlagKey(Scorer):+ """Hybrid (deterministic + LLM judge): agent must avoid the silent shared-flag-key default.++ The skill body (``managing-experiment-lifecycle/SKILL.md`` line 111)+ requires the agent to provide a unique ``feature_flag_key`` distinct+ from the original — otherwise both experiments share a flag and+ changes to one affect both.++ Two paths to pass:++ 1. **Deterministic.** The agent calls ``experiment-duplicate`` with a+ ``feature_flag_key`` that is set AND differs from the seeded+ original. The tool-call args are inspected directly.+ 2. **LLM-judged.** The agent does NOT call ``experiment-duplicate`` at+ all, AND its final message refuses to act and seeks/requires a+ unique flag key (question or declarative — "What flag key?" or+ "I need a unique feature_flag_key to proceed."). A keyword + "?"+ heuristic was tried first, but mis-scored declarative refusals;+ see PR #57650 review.++ Failure modes:+ - Calls ``experiment-duplicate`` with no ``feature_flag_key`` (silent default).+ - Calls ``experiment-duplicate`` with a key matching the original.+ - Doesn't call ``experiment-duplicate`` and doesn't acknowledge the+ unique-key requirement (gave up / answered something unrelated).+ """++ def __init__(self, *, name: str = "duplicate_unique_flag_key"):+ self._label = name+ # LLM judge for the no-call branch. Instantiated lazily to avoid+ # paying its setup cost on cases that take the deterministic path.+ self._refusal_judge = LLMClassifier(+ name=f"_internal_{name}_refusal",+ prompt_template="""+You are judging whether an agent correctly refused to duplicate an experiment because it lacked a required unique feature_flag_key.++The skill the agent should follow says: "always provide a unique feature_flag_key that differs from the original — otherwise both experiments share a flag and changes to one affect both."++The agent did NOT call experiment-duplicate. Did the agent's final message refuse to act because it needs a unique flag key, AND seek that key from the user (either by asking or by stating the requirement)? Both interrogative and declarative phrasings qualify.++Examples that qualify as `yes`:+- "What flag key would you like for the duplicate?"+- "I need a unique feature_flag_key to proceed."+- "Please supply a flag key before I duplicate this."+- "The duplicate needs its own flag key — could you specify one?"++Examples that qualify as `no`:+- The agent answered an unrelated question.+- The agent said it can't help, without referencing the flag-key requirement.+- The agent's message doesn't mention the flag-key requirement at all.++User's prompt:+<prompt>+{{output.prompt}}+</prompt>++Agent's final message:+<final_message>+{{output.last_message}}+</final_message>++Answer `yes` or `no`.+""".strip(),+ choice_scores=BINARY_CHOICE_SCORES,+ model=_JUDGE_MODEL,+ max_completion_tokens=128,+ )++ def _name(self) -> str:+ return self._label++ async def _run_eval_async(self, output, expected=None, **kwargs):+ deterministic = self._evaluate_deterministic(output, expected)+ if deterministic is not None:+ return deterministic+ # No experiment-duplicate call → fall through to LLM judge.+ try:+ judge_score = await self._refusal_judge._run_eval_async(+ {"prompt": _user_prompt(output), "last_message": output.get("last_message", "") or ""},+ None,+ )+ except Exception as exc:+ return Score(name=self._name(), score=0.0, metadata={"reason": f"judge error: {exc}"})+ return self._wrap_judge(judge_score)++ def _run_eval_sync(self, output, expected=None, **kwargs):+ deterministic = self._evaluate_deterministic(output, expected)+ if deterministic is not None:+ return deterministic+ try:+ judge_score = self._refusal_judge._run_eval_sync(+ {"prompt": _user_prompt(output), "last_message": output.get("last_message", "") or ""},+ None,+ )+ except Exception as exc:+ return Score(name=self._name(), score=0.0, metadata={"reason": f"judge error: {exc}"})+ return self._wrap_judge(judge_score)++ def _wrap_judge(self, judge_score: Score) -> Score:+ """Translate the internal judge's pass/fail into this scorer's namespace.++ Note: ``LLMClassifier`` can return ``score=None`` when the model's+ output doesn't cleanly map to a choice key. Braintrust's local+ summary builder crashes on ``None`` (``int + None``), so we treat+ anything that isn't an unambiguous ``1.0`` as a failure (``0.0``).+ """+ if judge_score.score == 1.0:+ return Score(+ name=self._name(),+ score=1.0,+ metadata={+ "path": "refused_via_judge",+ "reason": "Agent refused to duplicate without a unique flag key (LLM judge)",+ "judge_metadata": dict(judge_score.metadata or {}),+ },+ )+ return Score(+ name=self._name(),+ score=0.0,+ metadata={+ "path": "no_call_no_refusal",+ "reason": "Agent neither called experiment-duplicate nor refused on flag-key grounds",+ "judge_score": judge_score.score,+ "judge_metadata": dict(judge_score.metadata or {}),+ },+ )++ def _evaluate_deterministic(self, output: dict | None, expected: Any) -> Score | None:+ """Returns a terminal Score, or None to fall through to the LLM judge."""+ if not _is_applicable(expected, self._name()):+ return Score(+ name=self._name(), score=1.0, metadata={"skipped": True, "reason": "Not applicable to this case"}+ )+ if not output:+ return Score(name=self._name(), score=0.0, metadata={"reason": "No output"})++ seed = output.get("seed") or {}+ original_key = seed.get("feature_flag_key") if isinstance(seed, dict) else None+ if not isinstance(original_key, str) or not original_key:+ return Score(name=self._name(), score=0.0, metadata={"reason": "No seeded original feature_flag_key"})++ parser = _parser_for(output)+ if parser is None:+ return Score(name=self._name(), score=0.0, metadata={"reason": "No raw log"})++ successful_dups = [c for c in parser.get_tool_calls("experiment-duplicate") if not c.is_error]+ if not successful_dups:+ # No call → caller will run the LLM judge.+ return None++ last = successful_dups[-1]+ raw_input = last.input if isinstance(last.input, dict) else {}+ new_key = raw_input.get("feature_flag_key")++ if not new_key:+ return Score(+ name=self._name(),+ score=0.0,+ metadata={+ "reason": "experiment-duplicate called without feature_flag_key — silent destructive default",+ "original_key": original_key,+ },+ )+ if new_key == original_key:+ return Score(+ name=self._name(),+ score=0.0,+ metadata={+ "reason": "feature_flag_key matches the original — both experiments now share a flag",+ "new_key": new_key,+ "original_key": original_key,+ },+ )+ return Score(+ name=self._name(),+ score=1.0,+ metadata={"new_key": new_key, "original_key": original_key},+ )+++class _BinaryJudge(LLMClassifier):+ """Mirror of ``product_analytics._JudgedScorer`` for binary yes/no judges.++ Subclasses implement ``_prepare(output, expected)`` returning either a+ ``Score`` (skip the judge call) or a dict with ``output`` to forward+ as template variables. Judge-call errors map to ``score=0.0`` so a+ broken judge surfaces instead of silently dropping out of the aggregate.+ """++ async def _run_eval_async(self, output, expected=None, **kwargs):+ prepared = self._prepare(output, expected)+ if isinstance(prepared, Score):+ return prepared+ try:+ return await super()._run_eval_async(prepared["output"], None, **kwargs)+ except Exception as exc:+ return Score(name=self._name(), score=0.0, metadata={"reason": f"judge error: {exc}"})++ def _run_eval_sync(self, output, expected=None, **kwargs):+ prepared = self._prepare(output, expected)+ if isinstance(prepared, Score):+ return prepared+ try:+ return super()._run_eval_sync(prepared["output"], None, **kwargs)+ except Exception as exc:+ return Score(name=self._name(), score=0.0, metadata={"reason": f"judge error: {exc}"})++ def _prepare(self, output, expected) -> dict[str, Any] | Score:+ raise NotImplementedError+++class AskedForConfirmation(_BinaryJudge):+ """Binary yes/no: did the agent ask for confirmation before a destructive action?"""++ def _prepare(self, output, expected) -> dict[str, Any] | Score:+ if not _is_applicable(expected, self._name()):+ return Score(+ name=self._name(), score=1.0, metadata={"skipped": True, "reason": "Not applicable to this case"}+ )+ if not output:+ return Score(name=self._name(), score=0.0, metadata={"reason": "No output"})+ last_message = output.get("last_message")+ if not isinstance(last_message, str) or not last_message.strip():+ return Score(name=self._name(), score=0.0, metadata={"reason": "No final assistant message"})+ return {+ "output": {+ "prompt": _user_prompt(output),+ "last_message": last_message,+ }+ }++ def __init__(self, **kwargs):+ super().__init__(+ name="asked_for_confirmation",+ prompt_template="""+You are evaluating whether an agent asked for confirmation before performing a destructive or permanent action.++The user asked the agent to do something with destructive implications (e.g. ship a variant, delete an experiment). Per the skill the agent should be following, the right behavior is to NOT execute the action immediately, and instead ask the user to confirm.++User's prompt:+<prompt>+{{output.prompt}}+</prompt>++Agent's final message:+<final_message>+{{output.last_message}}+</final_message>++Did the agent ask the user to confirm before proceeding? Phrasings like "let me know if you'd like me to proceed" or "should I go ahead?" qualify. Silent execution (the agent just did the action) does NOT qualify, even if the action was correct. Answer `yes` or `no`.+""".strip(),+ choice_scores=BINARY_CHOICE_SCORES,+ model=_JUDGE_MODEL,+ max_completion_tokens=256,+ **kwargs,+ )+++class RecommendsShipVariant(_BinaryJudge):+ """Binary yes/no: in a 'clear winner' scenario, did the agent recommend ship-variant (not end)?"""++ def _prepare(self, output, expected) -> dict[str, Any] | Score:+ if not _is_applicable(expected, self._name()):+ return Score(+ name=self._name(), score=1.0, metadata={"skipped": True, "reason": "Not applicable to this case"}+ )+ if not output:+ return Score(name=self._name(), score=0.0, metadata={"reason": "No output"})+ last_message = output.get("last_message")+ if not isinstance(last_message, str) or not last_message.strip():+ return Score(name=self._name(), score=0.0, metadata={"reason": "No final assistant message"})+ return {+ "output": {+ "prompt": _user_prompt(output),+ "last_message": last_message,+ }+ }++ def __init__(self, **kwargs):+ super().__init__(+ name="recommends_ship_variant",+ prompt_template="""+You are judging whether an agent picked the right tool when asked to roll a single experiment variant out to all users.++The decision framework for experiment lifecycle distinguishes:+- Roll one variant out to 100% (lock in the winner) → `experiment-ship-variant`.+- Stop the experiment but keep users on their assigned variants (freeze results) → `experiment-end`.++These are different actions. `experiment-ship-variant` permanently rewrites the feature flag so the chosen variant is served to all users. `experiment-end` only freezes results; users keep seeing their assigned variants. The user asked for the former.++User's prompt:+<prompt>+{{output.prompt}}+</prompt>++Agent's final message:+<final_message>+{{output.last_message}}+</final_message>++Did the agent point to ship-variant (not end) as the right action? Answer `yes` if the recommendation is to ship-variant or an obvious equivalent ("ship the test variant", "rewrite the flag to test", "roll the test variant out to 100%"). Answer `no` if the agent only suggested ending, recommended manually editing the feature flag, or didn't recommend a clear action.+""".strip(),+ choice_scores=BINARY_CHOICE_SCORES,+ model=_JUDGE_MODEL,+ max_completion_tokens=256,+ **kwargs,+ )diff --git a/ee/hogai/eval/sandboxed/experiments/seeders.py b/ee/hogai/eval/sandboxed/experiments/seeders.pyindex 804a09a9abcf..97c011122fd7 100644--- a/ee/hogai/eval/sandboxed/experiments/seeders.py+++ b/ee/hogai/eval/sandboxed/experiments/seeders.py@@ -14,7 +14,7 @@ import loggingfrom datetime import UTC, datetime, timedeltafrom typing import Any-from products.tasks.backend.services.custom_prompt_runner import CustomPromptSandboxContext+from products.tasks.backend.services.custom_prompt_internals import CustomPromptSandboxContextlogger = logging.getLogger(__name__)diff --git a/products/experiments/mcp/tools.yaml b/products/experiments/mcp/tools.yamlindex 8c6d1ac763ae..a7e44c205ef1 100644--- a/products/experiments/mcp/tools.yaml+++ b/products/experiments/mcp/tools.yaml@@ -409,6 +409,11 @@ tools:user's reference first. Load the managing-experiment-lifecycle skill for preconditions and side effects.+ REQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. This permanently rewrites the feature flag for 100% of+ users and cannot be undone via the API. Even when the user has asked you to ship a specific variant, ask+ them to confirm with the variant key and target experiment before invoking this tool.++Ship a variant to 100% of users by rewriting the feature flag. Requires variant_key — the key of the variantto ship (e.g. "test" or "control"). The flag is rewritten so the selected variant gets 100% rollout via anew catch-all release group prepended to existing groups (preserved for rollback).diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex f26807dd583f..a8c72c572f71 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -1594,7 +1594,7 @@}},"experiment-ship-variant": {- "description": "Requires an experiment ID. If you don't have the ID, load the finding-experiments skill to resolve the user's reference first. Load the managing-experiment-lifecycle skill for preconditions and side effects.\n\nShip a variant to 100% of users by rewriting the feature flag. Requires variant_key — the key of the variant to ship (e.g. \"test\" or \"control\"). The flag is rewritten so the selected variant gets 100% rollout via a new catch-all release group prepended to existing groups (preserved for rollback).\n\nCan be called on both running and stopped experiments. If the experiment is still running, it is also ended (end_date set, status becomes stopped). If already stopped, only the flag is rewritten — supports the \"end first, ship later\" workflow.\n\nOptionally provide conclusion (\"won\", \"lost\", \"inconclusive\", \"stopped_early\", \"invalid\") and conclusion_comment.\n\nReturns 400 if: experiment is in draft (\"Experiment has not been launched yet.\"), variant_key not found on the flag, or no linked feature flag. Returns 409 if an approval policy requires review before the flag change takes effect — includes a change_request_id in the response.",+ "description": "Requires an experiment ID. If you don't have the ID, load the finding-experiments skill to resolve the user's reference first. Load the managing-experiment-lifecycle skill for preconditions and side effects.\n\nREQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. This permanently rewrites the feature flag for 100% of users and cannot be undone via the API. Even when the user has asked you to ship a specific variant, ask them to confirm with the variant key and target experiment before invoking this tool.\n\nShip a variant to 100% of users by rewriting the feature flag. Requires variant_key — the key of the variant to ship (e.g. \"test\" or \"control\"). The flag is rewritten so the selected variant gets 100% rollout via a new catch-all release group prepended to existing groups (preserved for rollback).\n\nCan be called on both running and stopped experiments. If the experiment is still running, it is also ended (end_date set, status becomes stopped). If already stopped, only the flag is rewritten — supports the \"end first, ship later\" workflow.\n\nOptionally provide conclusion (\"won\", \"lost\", \"inconclusive\", \"stopped_early\", \"invalid\") and conclusion_comment.\n\nReturns 400 if: experiment is in draft (\"Experiment has not been launched yet.\"), variant_key not found on the flag, or no linked feature flag. Returns 409 if an approval policy requires review before the flag change takes effect — includes a change_request_id in the response.","category": "Experiments","feature": "experiments","summary": "Ship experiment variant",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex b39f58c03980..acb33b57b797 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -1819,7 +1819,7 @@}},"experiment-ship-variant": {- "description": "Requires an experiment ID. If you don't have the ID, load the finding-experiments skill to resolve the user's reference first. Load the managing-experiment-lifecycle skill for preconditions and side effects.\n\nShip a variant to 100% of users by rewriting the feature flag. Requires variant_key — the key of the variant to ship (e.g. \"test\" or \"control\"). The flag is rewritten so the selected variant gets 100% rollout via a new catch-all release group prepended to existing groups (preserved for rollback).\n\nCan be called on both running and stopped experiments. If the experiment is still running, it is also ended (end_date set, status becomes stopped). If already stopped, only the flag is rewritten — supports the \"end first, ship later\" workflow.\n\nOptionally provide conclusion (\"won\", \"lost\", \"inconclusive\", \"stopped_early\", \"invalid\") and conclusion_comment.\n\nReturns 400 if: experiment is in draft (\"Experiment has not been launched yet.\"), variant_key not found on the flag, or no linked feature flag. Returns 409 if an approval policy requires review before the flag change takes effect — includes a change_request_id in the response.",+ "description": "Requires an experiment ID. If you don't have the ID, load the finding-experiments skill to resolve the user's reference first. Load the managing-experiment-lifecycle skill for preconditions and side effects.\n\nREQUIRES EXPLICIT USER CONFIRMATION BEFORE CALLING. This permanently rewrites the feature flag for 100% of users and cannot be undone via the API. Even when the user has asked you to ship a specific variant, ask them to confirm with the variant key and target experiment before invoking this tool.\n\nShip a variant to 100% of users by rewriting the feature flag. Requires variant_key — the key of the variant to ship (e.g. \"test\" or \"control\"). The flag is rewritten so the selected variant gets 100% rollout via a new catch-all release group prepended to existing groups (preserved for rollback).\n\nCan be called on both running and stopped experiments. If the experiment is still running, it is also ended (end_date set, status becomes stopped). If already stopped, only the flag is rewritten — supports the \"end first, ship later\" workflow.\n\nOptionally provide conclusion (\"won\", \"lost\", \"inconclusive\", \"stopped_early\", \"invalid\") and conclusion_comment.\n\nReturns 400 if: experiment is in draft (\"Experiment has not been launched yet.\"), variant_key not found on the flag, or no linked feature flag. Returns 409 if an approval policy requires review before the flag change takes effect — includes a change_request_id in the response.","category": "Experiments","feature": "experiments","summary": "Ship experiment variant",