What the agent does
Security headers are the cheapest protection the production site can have: a few lines of config that stop clickjacking, MIME sniffing, protocol downgrades and many script injections. Set them once, in one place, for every response, and roll out the Content-Security-Policy in report-only mode first so nothing breaks on launch day.
1. See what is sent today
Find where response headers are set (framework config, middleware, the current host config, a CDN rule in the repository) and list the headers the homepage, an API route and a static asset send now. Note anything set in two places that could disagree.
2. HTTPS everywhere
Every HTTP request should redirect to HTTPS in one hop. Add
Strict-Transport-Security: max-age=31536000; includeSubDomains. Only addpreloadif I confirm every subdomain serves HTTPS, because preloading is hard to undo.3. The simple headers
Set on every HTML response, from one place:
X-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originX-Frame-Options: DENY(orSAMEORIGINif the app frames itself), plusframe-ancestorsin the CSPPermissions-Policyturning off what the site does not use, e.g.camera=(), microphone=(), geolocation=()- Remove
X-Powered-Byand server version banners where the framework allows.
4. Content-Security-Policy, safely
Inventory every script, style, font, image, frame and fetch origin the site loads (analytics, payments, chat widgets, fonts, CDNs). Write a policy that allows exactly those, and ship it first as
Content-Security-Policy-Report-Only. Where inline scripts are needed, prefer nonces or hashes over'unsafe-inline'; say plainly where the framework makes that hard. Tell me how to switch to the enforcing header once a few days show no violations.
Done means
- HTTP redirects to HTTPS in one hop and HSTS is set.
- Every HTML response sends nosniff, a referrer policy, framing protection and a permissions policy.
- A Content-Security-Policy that lists every origin the site uses ships in report-only mode, with steps to enforce it.
- Headers are set in one place, and the site still works on every main page.
Questions
Will a Content-Security-Policy break my site?
It can, which is why the prompt ships it as report-only first. The browser reports what the policy would block without blocking it, and you switch it on once the reports are clean.
Is X-Frame-Options still needed with CSP frame-ancestors?
Modern browsers follow frame-ancestors, and sending both covers older ones. The prompt sets both, consistently.
Should I preload HSTS?
Only when every subdomain serves HTTPS and will keep doing so. Preload lists ship in browsers, and removing a site takes months.
Does this prompt add links to Aback Launch to my site?
No. Nothing in the prompt mentions Aback Launch or asks your agent to link to us. The only exception is an optional badge step, which stays off unless you tick it. Some prompt libraries slip their own link into your codebase by default; we think that should always be your choice.
Which coding agents does it work with?
Claude Code, Cursor, Codex, GitHub Copilot, Windsurf, Cline, and any agent that can read your project and edit files. You can copy it as a plain prompt, save it as a Claude Code skill or a Cursor rule, or add it to AGENTS.md.
Is it safe to run on my real codebase?
The prompt makes the agent read first, show a plan and wait for your approval, and it forbids touching secrets, deploying and deleting data. Still review the changes and run your tests before you deploy, as with any change.
Changelog
- v1.0First version.