Securityprompt onlyIntermediate

Security Headers Fixer

Automates the detection and remediation of missing or misconfigured HTTP security headers across web applications. Uses securityheader.com API and curl-based testing to validate headers like CSP, HSTS, X-Frame-Options, and more.

← all loops
securityhttp-headerscsphstsweb-securityautomated-fixdevops

Goal

Improve web security headers

How to Run

This loop automatically identifies missing security headers and applies fixes until all HTTP security headers meet best practices.

  1. 01

    Initialize Security Check

    Run initial header test to establish baseline

  2. 02

    Apply Fixes Iteratively

    Agent adds missing headers based on check results

  3. 03

    Retest Headers

    Verify fixes with repeated header tests

Workflow Steps

  1. 01

    Run header test command

    Parse missing headers from test output

  2. 02

    Identify target configuration file (nginx.conf, .htaccess, etc.)

    Confirm file path and security header syntax support

  3. 03

    Add missing security headers

    Ensure proper header syntax and placement

  4. 04

    Retest headers to verify fixes

    Exit loop on passing tests or continue if failures remain

Kickoff Prompt

Start the "Security Headers Fixer" loop.

Goal: Improve web security headers
Max iterations: 10
Between iterations run: header test
Exit when: Header tests pass


Analyze my web application for missing HTTP security headers using the 'header test' command. Add any missing headers (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy) to the appropriate server configuration file. After each addition, re-run the header test to verify the fix. Continue this process until all security header checks pass.

Self-pace this loop. After each iteration, run `header test` and evaluate the output, and only continue if the exit condition is not met (Header tests pass). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only modify HTTP header configuration files
  • ·Do not alter core application logic
  • ·Maintain existing header functionality while improving security
  • ·Log all changes for audit purposes

Flow Diagram

rendering…

Related loops — Security