safe-audit-fix
safe-audit-fix
앱을 망가뜨리지 않고 npm 취약점을 수정하세요.
npm audit fix --force는 메이저 버전을 조용히 건너뛰고, 패키지를 다운그레이드하며, 빌드를 깨뜨릴 수 있습니다. safe-audit-fix는 그 반대 접근 방식을 취합니다 — 망치 대신 신중한 외과의처럼:
먼저 계획 — 아무것도 변경되기 전에 모든 수정 사항에 위험 등급(
low/moderate/high-breaking)을 매깁니다.한 번에 하나씩 수정 — 한 번에 몰아서 변경하지 않습니다.
수정 후마다 테스트 — 각 단계 후에 사용자의 테스트 명령이 실행됩니다.
자동 되돌림 — 설치나 테스트가 실패하면 해당 수정은 즉시 취소됩니다(package.json + lockfile 복원, node_modules 재동기화).
호환성 깨지는 업그레이드는 선택 사항 —
--include-major를 전달하지 않으면 메이저 버전 점프는 건너뛰며, 전달하더라도 테스트로 보호됩니다.전체 실행 취소 —
safe-audit-fix revert는 실행 전 상태를 모두 복원합니다.
하나의 공유 엔진으로 두 가지 방식으로 작동합니다.
┌────────────────────┐
you ──────────► CLI │
├────────────────────┤──► core engine: scan → plan → fix one → test → keep/revert
AI assistant ─► MCP server │
(Claude Code, └────────────────────┘
Cursor, ...)요구 사항
Node.js ≥ 18, npm ≥ 7 (최신
npm audit --json포맷 필요)대상 프로젝트의
package-lock.json(없으면npm install을 한 번 실행)
Related MCP server: locklens
설치
즉시 사용 — 설치 불필요 (프로젝트 폴더 안에서 실행):
npx safe-audit-fix scan
npx safe-audit-fix fix또는 전역 설치:
npm install -g safe-audit-fix
safe-audit-fix scan또는 소스에서 설치:
git clone https://github.com/pasindudilshan1/safe-audit-fix.git
cd safe-audit-fix
npm install
npm link # makes the `safe-audit-fix` command available globallyCLI 사용법
safe-audit-fix scan # show vulnerabilities + whether each fix is safe or breaking
safe-audit-fix plan # show the ordered fix plan (changes nothing)
safe-audit-fix fix # apply fixes one at a time, testing after each
safe-audit-fix fix --include-major # also attempt breaking upgrades (test-protected)
safe-audit-fix fix --dry-run # preview only
safe-audit-fix fix --test "npm run test:unit" # custom verify command
safe-audit-fix fix --no-test # skip test verification (install failures still revert)
safe-audit-fix revert # undo the entire last fix run모든 명령어는 다른 프로젝트를 대상으로 --dir <path>를 받으며, scan/plan은 --json을 허용합니다.
수정이 적용되기 전에 테스트가 베이스라인으로 한 번 실행됩니다. 테스트가 이미 실패하면 도구는 시작을 거부합니다(그렇지 않으면 모든 수정이 잘못된 원인으로 지목되어 되돌려질 수 있습니다).
MCP 서버 (Claude Code, Cursor 등에서 사용)
서버를 등록한 다음 AI 어시스턴트에게 이렇게 요청하세요: "내 프로젝트의 취약점을 안전하게 수정해줘".
Claude Code:
claude mcp add safe-audit-fix -- npx -y --package=safe-audit-fix safe-audit-fix-mcp또는 .mcp.json / MCP 구성 파일을 통해:
{
"mcpServers": {
"safe-audit-fix": {
"command": "npx",
"args": ["-y", "--package=safe-audit-fix", "safe-audit-fix-mcp"]
}
}
}(전역에 설치한 경우 npx 대신 명령어로 safe-audit-fix-mcp를 직접 사용할 수 있습니다.)
노출된 도구:
도구 | 기능 | 파일 변경 |
| 구조화된 감사 보고서 | 아니요 |
| 순서가 지정되고 위험도가 표시된 수정 계획 | 아니요 |
| 수정-테스트-되돌림 루프 ( | 예 |
| 마지막 수정 실행 취소 | 예 |
비교
|
| 채팅에서 AI에게 요청 | safe-audit-fix | |
범위 내 취약점 수정 | ✅ | ✅ | 수동 | ✅ |
호환성 깨지는 취약점 수정 | ❌ | ✅ 조용히 | 수동 | ✅ 선택 |
변경 후마다 테스트 실행 | ❌ | ❌ | ❌ | ✅ |
잘못된 수정 자동 복원 | ❌ | ❌ | ❌ | ✅ |
위험 등급이 표시된 계획을 먼저 표시 | ❌ | ❌ | ⚠️ | ✅ |
원클릭 전체 실행 취소 | ❌ | ❌ | ❌ | ✅ |
AI 어시스턴트에서 사용 가능 (MCP) | ❌ | ❌ | — | ✅ |
라이브러리 사용
엔진은 직접 임포트할 수 있습니다.
import { scan, planFix, fixAll, revertSession } from 'safe-audit-fix';
const result = fixAll('/path/to/project', { includeMajor: false });
console.log(result.applied, result.failed, result.blocked);로드맵
--explain: LLM을 사용하여 계획된 메인 업그레이드의 변경 사항/호환성이 깨지는 변경 사항을 요약도달 가능성 분석: 취약한 코드 경로가 코드에서 호출되지 않는 취약점을 건너뜀
상위 수정이 없는 전이적 취약점에 대해 자동
overrides제안pnpm / yarn 지원
라이선스
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
The MCP server that vets MCP servers: identity, risk grade and per-tool risk before you install.
Scan any MCP server for tool-poisoning, security, auth & license. Trust score before install.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Security grades for MCP servers and npm/PyPI packages, ranked by CISA KEV and EPSS.
1
Related MCP Servers
- AlicenseCqualityDmaintenanceAudits npm package dependencies for security vulnerabilities, providing detailed reports and fix recommendations with MCP integration.169 npm57MIT
- AlicenseBqualityDmaintenanceAudits package lockfiles for vulnerabilities, supporting npm, yarn, and pnpm. Runs via CLI or as an MCP server over stdio.111 npm83MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that scans project dependencies for security vulnerabilities (CVEs) and provides fix instructions directly in VS Code via Copilot.3-
- AlicenseAqualityDmaintenanceMCP server that audits npm dependencies against the live registry, providing per-dependency reports on versions behind, deprecation, and license.29 npmMIT