Back to Templates
4.1 (5)
Security Headers
Implement security headers (CSP, HSTS, X-Frame-Options, etc.) to protect against common web vulnerabilities.
security
Official
Featured
by RepoBird
Updated 10/18/2025
49 executions
Template Instructions
These instructions will be passed to the AI agent when executing this template
Add security headers to protect the application:
- Add Content Security Policy (CSP)
- Implement HTTP Strict Transport Security (HSTS)
- Add X-Frame-Options to prevent clickjacking
- Add X-Content-Type-Options
- Add Referrer-Policy
- Configure CORS securely
Create middleware or configuration based on framework to set these headers on all responses.
Success Criteria
- All recommended security headers implemented
- CSP policy configured without breaking functionality
- HSTS with appropriate max-age set
- Headers verified on all routes
- CORS configured securely with proper origins
Completion Checklist
- Test headers with security scanning tools
- Create tests verifying header presence
- Document header configuration
- Verify headers work in production environment
- Test for header conflicts or issues
Tags
security
headers
CSP
HSTS
Supported Languages
Any Language