: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(ai-observability): gate MCP tagger tools behind llm-analytics-tags (#118041)
Radu Raicea0b51ad50a3be
diff --git a/products/ai_observability/mcp/tools.yaml b/products/ai_observability/mcp/tools.yamlindex 24eb2500903f..61fa04dcb16b 100644--- a/products/ai_observability/mcp/tools.yaml+++ b/products/ai_observability/mcp/tools.yaml@@ -1702,6 +1702,7 @@ tools:description); optionally set min_tags and max_tags. For tagger_type "hog", provide tagger_config.source Hogcode that returns a tag name string, a list of tag name strings, or null; optionally providetagger_config.tags as a whitelist. Use enabled=false while drafting, then update the tagger from the UI.+ feature_flag: llm-analytics-tagsurl_prefix: /ai-evals/taggersllma-tagger-list:operation: taggers_list@@ -1719,6 +1720,7 @@ tools:List AI observability taggers for the current project. Supports filtering by enabled status, id__in, search,and ordering. Returns each tagger's name, description, enabled state, type, configuration, conditions, modelconfiguration, creator, and timestamps.+ feature_flag: llm-analytics-tagsurl_prefix: /ai-evals/taggersllma-tagger-test-hog:operation: taggers_test_hog_create@@ -1735,6 +1737,7 @@ tools:return a tag name string, a list of tag name strings, or null. Optionally pass tags as a whitelist; returnedtags outside the whitelist are filtered out. Results include input/output previews, selected tags, stdoutreasoning, and any execution error for each sampled event.+ feature_flag: llm-analytics-tagsllma-trace-review-create:operation: llm_analytics_trace_reviews_createenabled: truediff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 43286862343e..bf2a7a9d8285 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -8812,7 +8812,8 @@"idempotentHint": false,"openWorldHint": true,"readOnlyHint": false- }+ },+ "feature_flag": "llm-analytics-tags"},"llma-tagger-list": {"description": "List AI observability taggers for the current project. Supports filtering by enabled status, id__in, search, and ordering. Returns each tagger's name, description, enabled state, type, configuration, conditions, model configuration, creator, and timestamps.",@@ -8826,7 +8827,8 @@"idempotentHint": true,"openWorldHint": true,"readOnlyHint": true- }+ },+ "feature_flag": "llm-analytics-tags"},"llma-tagger-test-hog": {"description": "Test Hog tagger source code against recent $ai_generation events without saving a tagger. The source should return a tag name string, a list of tag name strings, or null. Optionally pass tags as a whitelist; returned tags outside the whitelist are filtered out. Results include input/output previews, selected tags, stdout reasoning, and any execution error for each sampled event.",@@ -8840,7 +8842,8 @@"idempotentHint": false,"openWorldHint": true,"readOnlyHint": true- }+ },+ "feature_flag": "llm-analytics-tags"},"llma-trace-review-create": {"description": "Save a trace review. Supports an optional comment, an optional scores array, and an optional queue_id to clear a matching pending review-queue item after the review is saved.",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex bf876559093d..56232f4db53a 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -9191,7 +9191,8 @@"idempotentHint": false,"openWorldHint": true,"readOnlyHint": false- }+ },+ "feature_flag": "llm-analytics-tags"},"llma-tagger-list": {"description": "List AI observability taggers for the current project. Supports filtering by enabled status, id__in, search, and ordering. Returns each tagger's name, description, enabled state, type, configuration, conditions, model configuration, creator, and timestamps.",@@ -9205,7 +9206,8 @@"idempotentHint": true,"openWorldHint": true,"readOnlyHint": true- }+ },+ "feature_flag": "llm-analytics-tags"},"llma-tagger-test-hog": {"description": "Test Hog tagger source code against recent $ai_generation events without saving a tagger. The source should return a tag name string, a list of tag name strings, or null. Optionally pass tags as a whitelist; returned tags outside the whitelist are filtered out. Results include input/output previews, selected tags, stdout reasoning, and any execution error for each sampled event.",@@ -9219,7 +9221,8 @@"idempotentHint": false,"openWorldHint": true,"readOnlyHint": true- }+ },+ "feature_flag": "llm-analytics-tags"},"llma-trace-review-create": {"description": "Save a trace review. Supports an optional comment, an optional scores array, and an optional queue_id to clear a matching pending review-queue item after the review is saved.",diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-create.jsondeleted file mode 100644index 6259f3b85b67..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-create.json+++ /dev/null@@ -1,188 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {- "conditions": {- "description": "Conditions that scope when the tagger runs",- "items": {- "properties": {- "id": {- "description": "Stable identifier for this condition",- "maxLength": 100,- "type": "string"- },- "properties": {- "description": "Property filters that scope when this condition fires",- "items": {- "additionalProperties": {},- "propertyNames": {- "type": "string"- },- "type": "object"- },- "type": "array"- },- "rollout_percentage": {- "default": 100,- "description": "Percentage of matching events to apply this condition to",- "maximum": 100,- "minimum": 0,- "type": "number"- }- },- "required": ["id"],- "type": "object"- },- "type": "array"- },- "description": {- "type": "string"- },- "enabled": {- "type": "boolean"- },- "model_configuration": {- "anyOf": [- {- "properties": {- "model": {- "description": "Provider model identifier to use for this tagger.",- "maxLength": 100,- "type": "string"- },- "provider": {- "description": "LLM provider to use for this tagger.\n\n* `openai` - Openai\n* `anthropic` - Anthropic\n* `gemini` - Gemini\n* `openrouter` - Openrouter\n* `fireworks` - Fireworks\n* `azure_openai` - Azure OpenAI\n* `together_ai` - Together AI\n* `minimax` - MiniMax\n* `zeabur` - Zeabur AI Hub\n* `openai_compatible` - OpenAI-compatible",- "enum": [- "openai",- "anthropic",- "gemini",- "openrouter",- "fireworks",- "azure_openai",- "together_ai",- "minimax",- "zeabur",- "openai_compatible"- ],- "type": "string"- },- "provider_key_id": {- "anyOf": [- {- "type": "string"- },- {- "type": "null"- }- ],- "description": "Existing LLM provider key UUID for the current project. Do not invent this value; use a real provider key ID returned by PostHog, or omit/null when no provider key should be pinned."- }- },- "required": ["provider", "model"],- "type": "object"- },- {- "type": "null"- }- ]- },- "name": {- "maxLength": 400,- "type": "string"- },- "tagger_config": {- "anyOf": [- {- "properties": {- "max_tags": {- "anyOf": [- {- "minimum": 1,- "type": "number"- },- {- "type": "null"- }- ],- "description": "Maximum number of tags to apply (null = no limit)"- },- "min_tags": {- "default": 0,- "description": "Minimum number of tags to apply",- "minimum": 0,- "type": "number"- },- "prompt": {- "description": "Prompt instructing the LLM how to tag generations",- "minLength": 1,- "type": "string"- },- "tags": {- "description": "Available tags the LLM can assign",- "items": {- "properties": {- "description": {- "default": "",- "description": "Description to help the LLM classify",- "maxLength": 500,- "type": "string"- },- "name": {- "description": "Tag identifier",- "maxLength": 100,- "type": "string"- }- },- "required": ["name"],- "type": "object"- },- "type": "array"- }- },- "required": ["prompt", "tags"],- "type": "object"- },- {- "properties": {- "source": {- "description": "Hog source code to classify a generation into tags.",- "minLength": 1,- "type": "string"- },- "tags": {- "description": "Optional tag whitelist. Leave empty to allow any tag returned by the Hog code.",- "items": {- "properties": {- "description": {- "default": "",- "description": "Description to help the LLM classify",- "maxLength": 500,- "type": "string"- },- "name": {- "description": "Tag identifier",- "maxLength": 100,- "type": "string"- }- },- "required": ["name"],- "type": "object"- },- "type": "array"- }- },- "required": ["source"],- "type": "object"- }- ],- "description": "Tagger configuration. For tagger_type 'llm': {prompt, tags, min_tags?, max_tags?}. For tagger_type 'hog': {source, tags?}."- },- "tagger_type": {- "default": "llm",- "description": "* `llm` - LLM\n* `hog` - Hog",- "enum": ["llm", "hog"],- "type": "string"- }- },- "required": ["name", "tagger_config"],- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-list.jsondeleted file mode 100644index 3bba74b76799..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-list.json+++ /dev/null@@ -1,36 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {- "enabled": {- "description": "Filter by enabled status",- "type": "boolean"- },- "id__in": {- "description": "Multiple values may be separated by commas.",- "items": {- "type": "string"- },- "type": "array"- },- "limit": {- "description": "Number of results to return per page.",- "type": "number"- },- "offset": {- "description": "The initial index from which to return the results.",- "type": "number"- },- "order_by": {- "description": "Ordering\n\n* `created_at` - Created At\n* `-created_at` - Created At (descending)\n* `updated_at` - Updated At\n* `-updated_at` - Updated At (descending)\n* `name` - Name\n* `-name` - Name (descending)",- "items": {- "type": "string"- },- "type": "array"- },- "search": {- "description": "Search in name or description",- "type": "string"- }- },- "type": "object"-}diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-test-hog.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-test-hog.jsondeleted file mode 100644index 94f146a97d58..000000000000--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/llma-tagger-test-hog.json+++ /dev/null@@ -1,40 +0,0 @@-{- "$schema": "https://json-schema.org/draft/2020-12/schema",- "properties": {- "sample_count": {- "default": 5,- "description": "Number of recent $ai_generation events to test against (1-10, default 5).",- "maximum": 10,- "minimum": 1,- "type": "number"- },- "source": {- "description": "Hog source code to test. Return a tag name string, a list of tag name strings, or null.",- "minLength": 1,- "type": "string"- },- "tags": {- "description": "Optional tag whitelist. Returned tags outside this list are filtered out.",- "items": {- "properties": {- "description": {- "default": "",- "description": "Optional description for the tag.",- "maxLength": 500,- "type": "string"- },- "name": {- "description": "Tag identifier to allow in Hog test results.",- "maxLength": 100,- "type": "string"- }- },- "required": ["name"],- "type": "object"- },- "type": "array"- }- },- "required": ["source"],- "type": "object"-}diff --git a/services/mcp/tests/unit/tool-filtering.test.ts b/services/mcp/tests/unit/tool-filtering.test.tsindex e594f8ed1c8c..189003718f3b 100644--- a/services/mcp/tests/unit/tool-filtering.test.ts+++ b/services/mcp/tests/unit/tool-filtering.test.ts@@ -1089,6 +1089,7 @@ describe('Tool Filtering - Feature Flags', () => {'replay-vision-scanner-dashboard','metrics-dashboard-import','managed-warehouse-trino-query',+ 'llm-analytics-tags',]expect(allFlags).toEqual(expect.arrayContaining(branchFlags))// The flags branches add are asserted on the line above and held out of the list and