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.
Goal
Fix security findings
How to Run
Run this loop in your terminal-based coding agent to automatically remediate npm security issues. The agent will iteratively check for vulnerabilities and apply fixes without requiring manual intervention beyond loop initialization.
- 01
Initiate Loop
Start the loop in your preferred coding agent (Cursor, Claude Code, etc.)
- 02
Monitor Progress
Observe console output as the agent runs npm audit and applies fixes
- 03
Verify Completion
Confirm exit condition when no critical vulnerabilities remain
Workflow Steps
- 01
Run npm audit to identify current vulnerability state
- 02
Parse critical vulnerabilities from audit output
- 03
Apply automated fixes using npm audit fix --force
- 04
Manually address remaining critical issues if automated fix fails
- 05
Run check_command again to verify fixes
- 06
If exit_condition unmet and iterations remain, return to step 1
Kickoff Prompt
Start the "Vulnerability Until Zero" loop. Goal: Fix security findings Max iterations: 10 Between iterations run: npm audit Exit when: No critical vulnerabilities Execute an automated security remediation loop for this npm project. Begin by running 'npm audit', identify all critical vulnerabilities, and attempt to fix them using 'npm audit fix --force'. If any critical vulnerabilities persist after automated fixes, manually update the affected packages to patched versions while preserving compatibility. Re-run 'npm audit' after each fix attempt until either no critical vulnerabilities remain or 10 iterations have passed, whichever comes first. Log all changes made during this process. Self-pace this loop. After each iteration, run `npm audit` and evaluate the output, and only continue if the exit condition is not met (No critical vulnerabilities). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Prevent automatic package removals that might break functionality
- ·Avoid breaking changes by prioritizing non-breaking patches first
- ·Document all changes in a security-fixes.log file
- ·Run npm audit with --production flag to focus on deployable vulnerabilities
- ·Manually review and approve major version upgrades before application
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
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.