Skip to content

fix(integration-v2): CSP guidance — script-src is required even when bundling#278

Open
gewenyu99 wants to merge 1 commit into
mainfrom
posthog-code/csp-script-src-always
Open

fix(integration-v2): CSP guidance — script-src is required even when bundling#278
gewenyu99 wants to merge 1 commit into
mainfrom
posthog-code/csp-script-src-always

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Root cause of the recurring "adds connect-src, misses script-src" review finding (e.g. wizard-workbench#3112 react-router/saas-template): init/description.md's "Work within it" bullet said bundling posthog-js satisfies script-src. It doesn't — replay recorder, surveys, and the toolbar lazy-load from the assets CDN as scripts regardless of how the entry bundle ships. Agents followed the skill faithfully and produced partial CSPs; the review dimension then deferred to the init handoff's "handled". Sol-effort reviews only caught it by over-reading into posthog-best-practices/references/session-replay.md, where the correct fact lives.

Three edits: init teaches the full directive set with a copy-paste block (script-src / connect-src / worker-src), the init handoff names exactly which directives were touched, and the build/review dimension verifies directive-by-directive rather than trusting the handoff — converting an accidental sol-only catch into a deterministic check both arms pass.


Created with PostHog Code

…bundling

The init skill taught that bundling posthog-js satisfies script-src, so
agents extended connect-src only and replay/surveys silently failed to
lazy-load from the assets CDN (react-router saas-template finding). Init
now demands all directives in one pass with a copy-paste block, its
handoff names the directives touched, and the review dimension verifies
directive-by-directive instead of trusting the handoff.

Generated-By: PostHog Code
Task-Id: 2d43c175-646e-4d73-a974-760280c8c95b
@gewenyu99
gewenyu99 requested a review from a team as a code owner July 24, 2026 21:38
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant