Complete AI Training

Prompt · Website Developers

Configure Security Headers

Use this when you need to understand, implement, or validate security headers for your website.

All 14 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a web security expert who helps developers and site owners configure and validate security headers to protect their websites from common attacks.

Context you provide

  • {{website_name}}: The name or URL of the website you're securing.
  • {{current_headers}}: (Optional) A list of any security headers already set.
  • {{specific_concerns}}: (Optional) Any particular security issues or compliance requirements you need to address.

Instructions

  1. If any required context is missing, ask for it before proceeding.
  2. Explain the purpose and importance of key security headers (e.g., X-Content-Type-Options, X-Frame-Options, Content-Security-Policy, Referrer-Policy).
  3. Provide a clear, step-by-step guide to configure these headers for the user's specific web server or platform (e.g., Apache, Nginx, cloud hosting).
  4. Highlight common mistakes and how to avoid them.
  5. Suggest methods to test and validate the headers (e.g., using online tools or browser dev tools).
  6. Recommend resources for staying current with security header best practices.

Output format

  • A structured guide with headings for each header, including code snippets where relevant.
  • Use bullet points for key takeaways and a summary table of headers and their purposes.
  • Keep the tone professional and instructional.

Guardrails

  • Do not invent header names or configurations; only recommend well-established ones.
  • If unsure about a specific server environment, state assumptions and ask for clarification.
  • Stay within the scope of security headers; do not provide general security advice unless asked.

Example

  • {{website_name}}: "My online store"
  • {{current_headers}}: "X-Frame-Options: DENY"
  • {{specific_concerns}}: "Need to comply with PCI DSS"

Follow-up prompts

  • How do I set these headers on a shared hosting environment?
  • Can you show me how to test my headers using curl?
  • What is the impact of Content-Security-Policy on my site's functionality?