: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(conversations): allow sandbox oauth on conversations gateway product (#68991)
Alex V43c36f98260e
diff --git a/products/conversations/backend/temporal/ai_reply/constants.py b/products/conversations/backend/temporal/ai_reply/constants.pyindex 3ba4652a836c..9d33f56edcb2 100644--- a/products/conversations/backend/temporal/ai_reply/constants.py+++ b/products/conversations/backend/temporal/ai_reply/constants.py@@ -71,11 +71,9 @@ BASE_DRAFT_SCOPES: list[str] = [# Django/ORM -- it's loaded inside the Temporal workflow sandbox via pipeline.py.DIAGNOSTIC_SCOPES_PRESET: Literal["read_only"] = "read_only"-# Sandbox agent model for the draft step. Must be in the LLM gateway's `background_agents`-# product allowlist (services/llm-gateway/src/llm_gateway/products/config.py) -- that's the-# product the sandbox agent server routes through, NOT `conversations`. `claude-sonnet-4-6`-# is allowed for `conversations` (the plain utility/validator calls) but NOT for-# `background_agents`, so the sandbox draft uses the strongest allowed sonnet instead.+# Sandbox agent model for the draft step. Must be in the LLM gateway `conversations`+# product allowlist (services/llm-gateway/src/llm_gateway/products/config.py) — support-reply+# sandbox tasks route through that product via @posthog/agent's resolveGatewayProduct().DRAFT_MODEL = "claude-sonnet-5"DRAFT_RUNTIME_ADAPTER = "claude"diff --git a/services/llm-gateway/src/llm_gateway/products/config.py b/services/llm-gateway/src/llm_gateway/products/config.pyindex 9c58326a899f..88f147ccc236 100644--- a/services/llm-gateway/src/llm_gateway/products/config.py+++ b/services/llm-gateway/src/llm_gateway/products/config.py@@ -179,8 +179,10 @@ PRODUCTS: Final[dict[str, ProductConfig]] = {allow_api_keys=True,),"conversations": ProductConfig(- allowed_application_ids=None,- allowed_models=frozenset({"claude-haiku-4-5", "claude-sonnet-4-6"}),+ # Sandbox support-reply tasks auth with the array (posthog_code) OAuth app but+ # route through this product so draft spend rolls up with utility prompts.+ allowed_application_ids=frozenset({POSTHOG_CODE_US_APP_ID, POSTHOG_CODE_EU_APP_ID, POSTHOG_CODE_DEV_APP_ID}),+ allowed_models=frozenset({"claude-haiku-4-5", "claude-sonnet-4-6", "claude-sonnet-5"}),allow_api_keys=True,billable=False,),diff --git a/services/llm-gateway/tests/test_product_config.py b/services/llm-gateway/tests/test_product_config.pyindex f4c4d8430e1a..27686fc50b57 100644--- a/services/llm-gateway/tests/test_product_config.py+++ b/services/llm-gateway/tests/test_product_config.py@@ -72,6 +72,14 @@ class TestCheckProductAccess:("signals", "oauth_access_token", "any-app-id", "claude-haiku-4-5", False, "not authorized"),("signals", "oauth_access_token", POSTHOG_CODE_US_APP_ID, "claude-haiku-4-5", True, None),("signals", "oauth_access_token", POSTHOG_CODE_EU_APP_ID, "claude-sonnet-4-5", True, None),+ # conversations: utility prompts (API key) and support-reply sandbox (array OAuth app)+ ("conversations", "personal_api_key", None, "claude-haiku-4-5", True, None),+ ("conversations", "personal_api_key", None, "claude-sonnet-4-6", True, None),+ ("conversations", "personal_api_key", None, "claude-sonnet-5", True, None),+ ("conversations", "personal_api_key", None, "claude-opus-4-8", False, "not allowed"),+ ("conversations", "oauth_access_token", "any-app-id", "claude-sonnet-5", False, "not authorized"),+ ("conversations", "oauth_access_token", POSTHOG_CODE_US_APP_ID, "claude-sonnet-5", True, None),+ ("conversations", "oauth_access_token", POSTHOG_CODE_EU_APP_ID, "claude-sonnet-4-6", True, None),# posthog_ai allows API keys with any model and OAuth from the PostHog AI app.("posthog_ai", "personal_api_key", None, "claude-sonnet-4-5", True, None),("posthog_ai", "personal_api_key", None, "gpt-5.3-codex", True, None),