| name | vercel-harden |
| description | Harden a Vercel deployment with security headers, CSP, bot protection, and deployment configuration |
| arguments | [--check-only] [--plan hobby|pro] |
Vercel Deployment Hardening
Purpose
Audit and harden a Next.js project deployed on Vercel. Applies security headers at the edge, configures CSP, blocks malicious bots, and provides a dashboard checklist for manual Vercel settings.
Arguments
--check-only — Audit current security posture without making changes
--plan hobby|pro — Target Vercel plan (default: pro). Controls which features are available (WAF rules, bot protection, etc.)
Workflow
1. Audit current posture
Scan the project for existing security configuration:
- next.config.ts: poweredByHeader, headers() (static headers only — NOT CSP)
- proxy.ts: CSP header, bot blocking, honeypot paths
- vercel.json: edge-level headers
- robots.ts: bot disallow rules
Report findings as a checklist with pass/fail for each item.
2. Apply code-level hardening
If not --check-only, apply these changes:
Static headers (next.config.ts)
- Set
poweredByHeader: false
- Add
headers() function applying non-CSP security headers to /:path*
- Required headers: see
reference/vercel-harden-reference.md
- CSP must NOT go here — static headers cannot handle Next.js inline scripts