safety-guard
하는 일
이 AI 에이전트는 작업의 보디가드 역할을 합니다. 위험한 명령이 실수로 실행되는 것을 막고, 변경을 프로젝트의 특정 영역으로 제한할 수 있습니다.
사용하는 경우
- ✓중요한(운영) 시스템에서 작업할 때.
- ✓AI가 제한된 영역에서 혼자 작업하도록 하고 싶을 때.
- ✓중요한 업데이트나 데이터 변경 중.
스킬 링크
https://github.com/affaan-m/ECC/blob/main/skills/safety-guard/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“위험한 명령으로부터 제 프로젝트를 보호하고, 편집을 'src/components/' 폴더로 제한해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI가 실행하려는 명령을 확인하는 방식으로 작동합니다. 명령이 위험하다고 판단되면(예: 모든 것을 삭제) 또는 AI가 허용된 영역 밖을 편집하려고 하면, 멈추고 사용자의 확인을 요청합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Safety Guard — Prevent Destructive Operations
When to Use
- When working on production systems
- When agents are running autonomously (full-auto mode)
- When you want to restrict edits to a specific directory
- During sensitive operations (migrations, deploys, data changes)
How It Works
Three modes of protection:
Mode 1: Careful Mode
Intercepts destructive commands before execution and warns:
Watched patterns:
- rm -rf (especially /, ~, or project root)
- git push --force
- git reset --hard
- git checkout . (discard all changes)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish (accidental publishes)
- Any command with --no-verify
When detected: shows what the command does, asks for confirmation, suggests safer alternative.
Mode 2: Freeze Mode
Locks file edits to a specific directory tree:
/safety-guard freeze src/components/
Any Write/Edit outside src/components/ is blocked with an explanation. Useful when you want an agent to focus on one area without touching unrelated code.
Mode 3: Guard Mode (Careful + Freeze combined)
Both protections active. Maximum safety for autonomous agents.
/safety-guard guard --dir src/api/ --allow-read-all
Agents can read anything but only write to src/api/. Destructive commands are blocked everywhere.
Unlock
/safety-guard off
Implementation
Uses PreToolUse hooks to intercept Bash, Write, Edit, and MultiEdit tool calls. Checks the command/path against the active rules before allowing execution.
Integration
- Enable by default for
codex -a neversessions - Pair with observability risk scoring in ECC 2.0
- Logs all blocked actions to
~/.claude/safety-guard.log
자주 묻는 질문
어떤 위험한 명령을 막나요?
'rm -rf'(모든 것 삭제), 버전 관리 시스템에서의 강제 푸시(git push --force), 데이터베이스 테이블 삭제(DROP TABLE) 같은 명령을 막습니다.
보호를 끄려면 어떻게 하나요?
'/safety-guard off'를 입력하면 보호를 끌 수 있습니다.
AI가 모든 것을 읽되 한 곳에만 쓰게 할 수 있나요?
네. 'Guard Mode'를 사용하면 됩니다. AI가 쓸 수 있는 폴더를 지정하면, AI는 프로젝트의 다른 부분을 수정할 수 없습니다.
상세 정보
작성자의 원본 설명
Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both via PreToolUse hooks. Use when working on production systems, running agents autonomously, restricting edits to a directory, or during migrations, deploys, and data changes.
repo: affaan-m/ECC
인기도
- GitHub 스타
- 280k
- 순위
- #397
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
accessibility
280k에이전트가 모든 사람이 쓸 수 있는 인터페이스를 만들도록 돕습니다. 시각 장애나 운동 장애가 있는 사람도 쓸 수 있게 합니다.
agent-architecture-audit
280k에이전트가 모든 것이 올바르게 작동하는지 점검하도록 돕습니다. AI 시스템의 문제를 찾아 고쳐서 기대대로 작동하게 합니다.
agent-eval
280k에이전트가 서로 다른 AI 코딩 도구를 비교하도록 돕습니다. 특정 작업에서 어느 도구가 더 빠르고, 저렴하고, 믿을 만한지 측정합니다.
agent-harness-construction
280k에이전트가 작업을 더 잘 이해하도록 돕습니다. 에이전트가 쓰는 도구와 지시문을 최적화해 성공 가능성을 높입니다.