Whenever I mention my astro-strict-csp package, the first question developers usually ask is: "Wait, doesn't Astro already have built-in security.csp in astro.config.mjs ?"
It does—and Astro's native security.csp is actually the exact reason I still needed to build astro-strict-csp .
If you enable Astro's built-in CSP on a real project that uses Markdown code blocks, <Image /> components, or UI islands, your pages immediately break or flood the browser console with Content Security Policy violations. When you check the official Astro documentation for how to fix it, the recommended workarounds are either switching your syntax highlighter from Shiki to Prism , or adding 'unsafe-inline' to style-src .
Here is why Astro's native CSP hits that wall, why switching from Shiki to Prism is a painful downgrade for a technical blog, and how extracting inline styles at build time solves both problems cleanly.
Why Native security.csp Stops at Inline Styles
Astro's built-in security.csp does a fine job computing…