본문으로 건너뛰기
Skillpedia
보안280k · #397

safety-guard

하는 일

이 AI 에이전트는 작업의 보디가드 역할을 합니다. 위험한 명령이 실수로 실행되는 것을 막고, 변경을 프로젝트의 특정 영역으로 제한할 수 있습니다.

사용하는 경우

  • ✓중요한(운영) 시스템에서 작업할 때.
  • ✓AI가 제한된 영역에서 혼자 작업하도록 하고 싶을 때.
  • ✓중요한 업데이트나 데이터 변경 중.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/skills/safety-guard/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/skills/safety-guard/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 never sessions
  • 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬