Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when reviewing headers, forms, cookies, or third-party integrations related to Implement a content security policy. Validate the effective browser and HTTP behavior in a production-like environment.
.claude/skills/thedaviddias-content-security-policy/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-12 | ✓→✗ | ▼ Worse | -5% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 13% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 23% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 2% | 0% |
Content Security Policy prevents cross-site scripting (XSS), clickjacking, and data injection attacks by controlling which resources can be loaded and executed on your pages. It reduces blast radius, but it does not replace output encoding and sanitization.
Check if this website implements a Content Security Policy header and analyze its directives. Also review any use of innerHTML, dangerouslySetInnerHTML, HTML template injection, and Trusted Types enforcement for large applications.
Implement a strict Content Security Policy to prevent XSS attacks and control resource loading. Sanitize untrusted HTML before rendering and add Trusted Types enforcement where the application has enough DOM injection surface to benefit from it.
Explain how CSP provides a security layer that helps detect and mitigate XSS and data injection attacks, and why sanitization is still required before rendering untrusted HTML.
Review server config, headers, forms, and integration points related to Implement a content security policy. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response. Inspect HTML injection sinks and note whether Trusted Types or sanitization protects them.
For full implementation details, code examples, and framework-specific guidance, see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/security/content-security-policy
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 21,235 | 22,868 | +8% | 1 | 1 | 0% | 2,530 | 3,111 | +23% | 0 | 0 | — |
case-02 | pass→pass | 11,568 | 10,952 | -5% | 1 | 1 | 0% | 2,167 | 2,446 | +13% | 0 | 0 | — |
case-03 | pass→pass | 10,035 | 9,326 | -7% | 1 | 1 | 0% | 1,772 | 2,186 | +23% | 0 | 0 | — |
case-04 | pass→pass | 8,527 | 8,920 | +5% | 1 | 1 | 0% | 1,820 | 1,865 | +2% | 0 | 0 | — |
case-05 | pass→pass | 12,875 | 8,911 | -31% | 1 | 1 | 0% | 2,065 | 2,123 | +3% | 0 | 0 | — |
case-06 | pass→pass | 12,387 | 8,678 | -30% | 1 | 1 | 0% | 2,165 | 2,003 | -7% | 0 | 0 | — |
case-07 | pass→pass | 7,634 | 8,073 | +6% | 1 | 1 | 0% | 1,544 | 1,854 | +20% | 0 | 0 | — |
case-08 | pass→pass | 12,149 | 9,499 | -22% | 1 | 1 | 0% | 2,354 | 2,514 | +7% | 0 | 0 | — |
case-09 | pass→pass | 15,693 | 15,767 | +0% | 1 | 1 | 0% | 3,081 | 3,671 | +19% | 0 | 0 | — |
case-10 | pass→pass | 4,964 | 4,698 | -5% | 1 | 1 | 0% | 994 | 1,253 | +26% | 0 | 0 | — |
case-11 | pass→pass | 10,049 | 9,001 | -10% | 1 | 1 | 0% | 2,122 | 2,161 | +2% | 0 | 0 | — |
case-12 | pass→fail | 15,603 | 15,063 | -3% | 1 | 1 | 0% | 3,178 | 3,008 | -5% | 0 | 0 | — |
case-13 | pass→pass | 10,903 | 12,273 | +13% | 1 | 1 | 0% | 2,123 | 2,820 | +33% | 0 | 0 | — |
case-14 | pass→pass | 7,781 | 5,011 | -36% | 1 | 1 | 0% | 1,595 | 1,370 | -14% | 0 | 0 | — |
case-15 | pass→pass | 2,807 | 3,037 | +8% | 1 | 1 | 0% | 518 | 902 | +74% | 0 | 0 | — |
case-16 | pass→pass | 3,958 | 3,859 | -3% | 1 | 1 | 0% | 798 | 1,142 | +43% | 0 | 0 | — |
case-17 | pass→pass | 12,685 | 10,420 | -18% | 1 | 1 | 0% | 2,612 | 2,284 | -13% | 0 | 0 | — |
case-18 | pass→pass | 11,805 | 11,619 | -2% | 1 | 1 | 0% | 1,979 | 2,464 | +25% | 0 | 0 | — |
case-19 | pass→pass | 10,022 | 8,576 | -14% | 1 | 1 | 0% | 1,859 | 2,159 | +16% | 0 | 0 | — |
case-20 | pass→pass | 5,701 | 6,580 | +15% | 1 | 1 | 0% | 1,173 | 1,713 | +46% | 0 | 0 | — |
case-21 | pass→pass | 4,460 | 3,566 | -20% | 1 | 1 | 0% | 806 | 1,132 | +40% | 0 | 0 | — |
case-22 | pass→pass | 11,973 | 10,472 | -13% | 1 | 1 | 0% | 2,529 | 2,539 | +0% | 0 | 0 | — |
case-23 | pass→pass | 11,107 | 9,223 | -17% | 1 | 1 | 0% | 1,875 | 2,269 | +21% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.