Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Security Headers Configuration

  • 454 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

security-headers-configuration is a Claude Code skill that guides developers through configuring CSP, HSTS, X-Frame-Options, Referrer-Policy, and related HTTP response headers to reduce XSS, clickjacking, and MIME-type a

About

security-headers-configuration is a Security skill from aj-geddes/useful-ai-prompts that walks developers through setting Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, Referrer-Policy, and companion HTTP headers on web applications. The skill explains which directives block inline scripts, enforce HTTPS, prevent clickjacking, and control referrer leakage so teams can harden Express, Next.js, nginx, or CDN configs before a security review. Developers reach for security-headers-configuration when launching a SaaS or API surface and need a structured checklist instead of copying generic header snippets. It focuses on pre-production header design rather than ongoing WAF tuning or penetration testing.

  • CSP directive design for real asset graphs
  • HSTS and TLS enforcement guidance
  • Clickjacking protection via frame ancestors
  • Referrer and permissions policy tuning
  • Staging validation before strict production rollout

Security Headers Configuration by the numbers

  • 454 all-time installs (skills.sh)
  • Ranked #521 of 2,203 Security skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill security-headers-configuration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs454
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you configure CSP and HSTS headers correctly?

Configure CSP, HSTS, X-Frame-Options, Referrer-Policy, and related HTTP headers to reduce XSS, clickjacking, and MIME risks before production launch and security review.

Who is it for?

Backend and full-stack developers shipping a web app or API who need correct security headers before launch or a security audit.

Skip if: Teams that only need dependency vulnerability scanning or runtime WAF rules without changing HTTP response headers.

When should I use this skill?

A developer asks to add CSP, HSTS, clickjacking protection, or MIME-snippet headers before production or during a security review.

What you get

Production-ready HTTP security header configs with CSP directives, HSTS max-age, X-Frame-Options, and Referrer-Policy values documented for your stack.

  • CSP directive set
  • HSTS and frame-options config
  • Header documentation for review

Files

SKILL.mdMarkdownGitHub ↗

Security Headers Configuration

Table of Contents

Overview

Implement comprehensive HTTP security headers to protect web applications from XSS, clickjacking, MIME sniffing, and other browser-based attacks.

When to Use

  • New web application deployment
  • Security audit remediation
  • Compliance requirements
  • Browser security hardening
  • API security
  • Static site protection

Quick Start

Minimal working example:

// security-headers.js
const helmet = require("helmet");

function configureSecurityHeaders(app) {
  // Comprehensive Helmet configuration
  app.use(
    helmet({
      // Content Security Policy
      contentSecurityPolicy: {
        directives: {
          defaultSrc: ["'self'"],
          scriptSrc: [
            "'self'",
            "'unsafe-inline'", // Remove in production
            "https://cdn.example.com",
            "https://www.google-analytics.com",
          ],
          styleSrc: [
            "'self'",
            "'unsafe-inline'",
            "https://fonts.googleapis.com",
          ],
          fontSrc: ["'self'", "https://fonts.gstatic.com"],
          imgSrc: ["'self'", "data:", "https:", "blob:"],
          connectSrc: ["'self'", "https://api.example.com"],
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Node.js/Express Security HeadersNode.js/Express Security Headers
Nginx Security Headers ConfigurationNginx Security Headers Configuration
Python Flask Security HeadersPython Flask Security Headers
Apache .htaccess ConfigurationApache .htaccess Configuration
Security Headers Testing ScriptSecurity Headers Testing Script

Best Practices

✅ DO

  • Use HTTPS everywhere
  • Implement strict CSP
  • Enable HSTS with preload
  • Block framing with X-Frame-Options
  • Prevent MIME sniffing
  • Report CSP violations
  • Test headers regularly
  • Use security scanners

❌ DON'T

  • Allow unsafe-inline in CSP
  • Skip HSTS on subdomains
  • Ignore CSP violations
  • Use overly permissive policies
  • Forget to test changes

Related skills

How it compares

Pick this skill when you need concrete HTTP header values and stack-specific config snippets rather than general OWASP reading lists.

FAQ

Which HTTP security headers does security-headers-configuration cover?

security-headers-configuration covers Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, Referrer-Policy, and related headers that reduce XSS, clickjacking, and MIME-type risks on production web applications.

When should developers use security-headers-configuration?

Developers should use security-headers-configuration before production launch or a security review when a web app or API still lacks hardened CSP, HSTS, and anti-clickjacking headers on its HTTP responses.

Securityappseccompliance

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.