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.

fix(prompts): stop accepting per-prompt access control rules (#119375)

Juraj Majerikb1ef43383490
diff --git a/posthog/api/llm_prompt.py b/posthog/api/llm_prompt.py
index dac91ebfc0fd..b5f14303918a 100644
--- a/posthog/api/llm_prompt.py
+++ b/posthog/api/llm_prompt.py
@@ -74,7 +74,6 @@ from posthog.rate_limit import (
)
from posthog.storage.llm_prompt_cache import get_prompt_by_name_from_cache
-from products.access_control.backend.presentation.access_control import AccessControlViewSetMixin
from products.ai_observability.backend.activity_logging import log_llm_prompt_activity
from products.ai_observability.backend.api.metrics import llma_track_latency
from products.ai_observability.backend.models.llm_prompt import LLMPrompt, LLMPromptLabel, get_prompt_outline
@@ -94,7 +93,6 @@ PROMPT_FETCHED_EVENT_SOURCE = "llm_prompt_management"
@extend_schema(extensions={"x-product": "llm_analytics"})
class LLMPromptViewSet(
TeamAndOrgViewSetMixin,
- AccessControlViewSetMixin,
mixins.CreateModelMixin,
mixins.ListModelMixin,
viewsets.GenericViewSet,
diff --git a/posthog/api/test/test_llm_prompt.py b/posthog/api/test/test_llm_prompt.py
index 407dfd7cd774..f7b56d65d281 100644
--- a/posthog/api/test/test_llm_prompt.py
+++ b/posthog/api/test/test_llm_prompt.py
@@ -1226,6 +1226,13 @@ class TestLLMPromptAPI(APIBaseTest):
# + label created and label deleted-on-archive.
assert len(rows) == 6
+ def test_per_prompt_access_control_route_does_not_exist(self):
+ prompt = self.create_prompt_version(name="guarded-prompt")
+
+ response = self.client.get(f"/api/environments/{self.team.id}/llm_prompts/{prompt.id}/access_controls/")
+
+ assert response.status_code == status.HTTP_404_NOT_FOUND
+
class TestLLMPromptConfigAPI(APIBaseTest):
def create_prompt_version(
diff --git a/products/access_control/backend/tests/__snapshots__/test_access_control.ambr b/products/access_control/backend/tests/__snapshots__/test_access_control.ambr
index 6afcef36e6c4..b4150f9c546e 100644
--- a/products/access_control/backend/tests/__snapshots__/test_access_control.ambr
+++ b/products/access_control/backend/tests/__snapshots__/test_access_control.ambr
@@ -15,7 +15,6 @@
'heatmap',
'hog_flow',
'insight',
- 'llm_prompt',
'llm_provider_key',
'llm_skill',
'notebook',
@@ -51,7 +50,6 @@
'hog_flow',
'insight',
'llm_analytics',
- 'llm_prompt',
'llm_provider_key',
'llm_skill',
'notebook',