Securityprompt onlyintermediate

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.

← all loops
securitynpmvulnerability-managementautomated-remediationdevops

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.

  1. 01

    Initiate Loop

    Start the loop in your preferred coding agent (Cursor, Claude Code, etc.)

  2. 02

    Monitor Progress

    Observe console output as the agent runs npm audit and applies fixes

  3. 03

    Verify Completion

    Confirm exit condition when no critical vulnerabilities remain

Workflow Steps

  1. 01

    Run npm audit to identify current vulnerability state

  2. 02

    Parse critical vulnerabilities from audit output

  3. 03

    Apply automated fixes using npm audit fix --force

  4. 04

    Manually address remaining critical issues if automated fix fails

  5. 05

    Run check_command again to verify fixes

  6. 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

rendering…

Related loops — Security