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.
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.
- 01
Initialize Security Check
Run initial header test to establish baseline
- 02
Apply Fixes Iteratively
Agent adds missing headers based on check results
- 03
Retest Headers
Verify fixes with repeated header tests
Workflow Steps
- 01
Run header test command
Parse missing headers from test output
- 02
Identify target configuration file (nginx.conf, .htaccess, etc.)
Confirm file path and security header syntax support
- 03
Add missing security headers
Ensure proper header syntax and placement
- 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
Related loops — Security
Security
Dependency Security Upgrade
This loop automates the process of identifying and remediating security vulnerabilities in project dependencies. It continuously scans for outdated or vulnerable packages, applies necessary upgrades, and validates fixes to ensure the codebase remains secure without manual intervention. The loop adapts to different package managers and security tools based on the project environment.
Security
OWASP Compliance Loop
This loop helps developers iteratively identify and remediate OWASP Top 10 security vulnerabilities in their codebase. It follows a self-paced act-check-inspect cycle, ensuring thorough compliance with security best practices through automated auditing and targeted fixes.
Security
Vulnerability Until Zero
An automated loop to systematically eliminate critical npm security vulnerabilities in your project by iteratively running npm audit, analyzing findings, and applying fixes until the codebase reaches a secure state.