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.

chore(demo): grant onboarding wizard scopes to demo oauth app (#62270)

Fernando Gomes6fe6e38334b0
diff --git a/posthog/demo/products/hedgebox/matrix.py b/posthog/demo/products/hedgebox/matrix.py
index 51b2aa1703d6..87641376b5dd 100644
--- a/posthog/demo/products/hedgebox/matrix.py
+++ b/posthog/demo/products/hedgebox/matrix.py
@@ -52,6 +52,7 @@ from posthog.demo.matrix.randomization import Industry
from posthog.exceptions_capture import capture_exception
from posthog.models.event.util import create_event
from posthog.models.oauth import OAuthApplication
+from posthog.scopes import UNPRIVILEGED_SCOPES
from posthog.storage import object_storage
from products.actions.backend.models.action import Action
@@ -1789,6 +1790,14 @@ class HedgeboxMatrix(Matrix):
authorization_grant_type=OAuthApplication.GRANT_AUTHORIZATION_CODE,
algorithm="RS256",
is_first_party=True,
+ # An empty ceiling resolves to UNPRIVILEGED_SCOPES at /authorize, which
+ # excludes the privileged/hidden scopes the onboarding wizard requests
+ # (llm_gateway:read, wizard_session:*) — so it failed with invalid_scope.
+ # Reproduce the broad default and add those so the wizard works locally.
+ scopes=sorted(
+ UNPRIVILEGED_SCOPES
+ | {"llm_gateway:read", "llm_gateway:write", "wizard_session:read", "wizard_session:write"}
+ ),
)
except (IntegrityError, ValidationError):
pass