: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(replay-vision): tell scanners how to judge large masked media (#109526)
Kim Svatos Dugan1059d198b76a
diff --git a/products/replay_vision/backend/temporal/scanners/prompts/preamble.jinja b/products/replay_vision/backend/temporal/scanners/prompts/preamble.jinjaindex 91a2dd3da547..454efdea9c4b 100644--- a/products/replay_vision/backend/temporal/scanners/prompts/preamble.jinja+++ b/products/replay_vision/backend/temporal/scanners/prompts/preamble.jinja@@ -11,6 +11,8 @@ The video plays at normal speed but at a low frame rate (about 3 frames per seco<masking>Session Replay hides privacy-sensitive content before it is recorded. Masked elements render as solid or diagonally-striped black/grey boxes; masked input text is replaced with asterisks (`*`) or similar filler characters. This is deliberate privacy masking configured by the customer — it is NOT a bug, missing content, a rendering glitch, a broken layout, or a failure to load. Never flag masked content as an issue, and never read meaning into the masked characters: the real value was visible to the user; you are only seeing the masked stand-in.++Images and videos are often masked, and a masked area can be large. A whole image, video, or embedded player can show as one full black or striped box for as long as the user looks at it. That box alone does not mean that the content failed to load or play. But masking can also hide a real failure, so do not dismiss the area either. Use the events at that moment and the screen around the box to decide. Controls and overlays outside the masked area are still recorded. A scrubber or playback time that advances shows that a video played, and a loading overlay that clears shows that the content loaded. An error or a failed request for that media, a loading state that never clears, or a user who retries, reloads, or rage-clicks the area points to a real failure. Treat these signs as evidence, not proof: a user can retry while the media plays, and an unrelated error can occur at the same moment. When the evidence points both ways, describe both sides and lower `confidence`. When the evidence does not decide it, say that the content is masked in the recording, not that it failed, and lower `confidence`.</masking>{% if session_identity %}<session_identity>diff --git a/products/replay_vision/backend/tests/test_scanners.py b/products/replay_vision/backend/tests/test_scanners.pyindex a57a206abcd0..27ab8b01dcdc 100644--- a/products/replay_vision/backend/tests/test_scanners.py+++ b/products/replay_vision/backend/tests/test_scanners.py@@ -99,6 +99,9 @@ class TestPreamble:assert "<masking>" in renderedassert "asterisks" in renderedassert "not a bug" in rendered.lower()+ # A masked image or video can fill a whole player, so the model must judge a real failure from the evidence.+ assert "scrubber" in rendered+ assert "real failure" in rendereddef test_preamble_forbids_reproducing_personal_data_verbatim(self) -> None:# Masking hides PII in the video, but the events tool / navigation URLs can expose it in the clear;