Claude Code 가드레일 오픈소스 지도

Claude Code의 가드레일은 보통 hooks, tool-call policy, 감사/로그, IP/라이선스 검증, sandboxing 조합으로 구현된다.

핵심 해석

  • 전용 가드레일 제품은 아직 많지 않다.
  • 생태계의 중심은 CLAUDE.md + hooks + MCP + CI/CD + pre-commit/pre-push 조합이다.
  • 그래서 오픈소스들도 완전한 단일 제품보다, 특정 문제를 좁게 푸는 정책 레이어로 쪼개져 있다.

전체 오픈소스 가드레일 생태계 맵

Claude Code / Codex / Gemini CLI 등 코딩 에이전트에 직접 붙이거나 가드레일로 같이 쓸 수 있는 오픈소스 목록.

1) Claude Code 전용 / 직접 연동 가드레일

프로젝트용도핵심 기능평가
dwarvesf/claude-guardrailsClaude Code 전용 가드레일PreToolUse hook 기반 위험 명령 차단, 데이터 유출 패턴, 권한 상승 패턴, git commit secret scan⭐ 16 · 가장 직접적. 먼저 볼 만함
mattpocock/skills — git-guardrails-claude-codeClaude Code용 Git 안전장치git push, reset —hard, clean, branch -D, restore . 차단⭐ 75k · 가볍게 도입하기 좋음
alexknowshtml/claude-code-safety-hooksClaude Code safety hooks위험 명령 guard + untrusted content defense⭐ 3 · Claude Code 훅 기반 실전형
rulebricks/claude-code-guardrailsClaude Code tool call 실시간 가드레일Rulebricks API 연동 정책 기반 실행 차단⭐ 67 · 별도 정책 엔진 형태
JustHereToHelp/claude-bouncerClaude Code command filtering위험 명령 block, 애매한 명령 ask, 정상 명령 allow⭐ — · 단순 명령 필터링용
algorismo-au/lanekeep정책/거버넌스/승인 피로 완화로컬 실행 정책 기반 경계 설정, Claude Code hooks 연동⭐ 17 · permission fatigue 완화
marcusgoll/atlas-guardrails컨텍스트/중복/드리프트 제어Context Packing, Anti-Duplication, Drift Detection⭐ — · npm 패키지, Claude Code/Cursor 겸용
mugdhav/claude-skill-ip-guardIP/라이선스 컴플라이언스OSS 라이선스(GPL 등) 체크, 상용 프로젝트용⭐ — · Anthropic skills PR #686
OpSentryClaude Code PreToolUse 보안 훅credential leak 방지, deterministic security enforcement⭐ — · repo 링크 확인 필요
disler/claude-code-hooks-masteryClaude Code hook 예제/학습hook flow, exit code, JSON output 패턴⭐ 3k+ · 가드레일 자체보다는 hook 구현 레퍼런스

Claude Code는 공식적으로 Hooks를 제공하며, PreToolUse / PostToolUse / Stop 등 이벤트에 사용자 정의 shell command, HTTP endpoint, prompt hook을 붙일 수 있음. 공식 문서에서도 hooks를 “LLM 지시에 기대지 않고 결정론적으로 동작을 강제하는 방법”으로 설명. → 공식 문서

2) Codex 전용 / Codex 내장 가드레일

항목용도핵심 기능평가
openai/codexCodex CLI 본체로컬 코딩 에이전트, Rust 기반 오픈소스⭐ 83.7k · Codex 자체가 오픈소스
Codex sandbox / approvalsCodex 내장 보안 경계workspace-write, network off, approval policy기본 가드레일로 가장 중요
Codex Rules명령 승인/차단 규칙command prefix 기준 allow / prompt / forbidden 정책Claude Code hook의 Codex식 대응책
Codex Auto-review승인 자동화sandbox boundary 승인 요청을 별도 reviewer agent가 검토팀/엔터프라이즈 워크플로우에 유용
Codex config.toml로컬/프로젝트별 정책 설정approval policy, sandbox, MCP 설정프로젝트 단위 정책화 가능

Codex는 sandbox + approval policy + rules 조합이 핵심. Codex Rules는 명령 패턴별로 forbidden > prompt > allow 우선순위를 적용해 차단/승인을 설정 가능.

3) Claude Code / Codex / Gemini CLI 공통 명령 차단 도구

프로젝트용도핵심 기능평가
Dicklesworthstone/destructive_command_guard범용 destructive command guardAI agent가 실행하는 위험한 git/shell 명령 차단 (Rust, SIMD)⭐ 1k · 별도 CLI/훅으로 붙이기 좋음
OpenClaw HarnessClaude 기반 에이전트 보호/운영Claude Code, OpenClaw 계열 보호용 command guardClaude Code 직접 연동 후보
wiserautomation/suprawall-pluginsOpenClaw/Hermes 보안 skill suiteskill installer, file integrity, security audit, advisory verificationClaude Code보다는 OpenClaw/Hermes 쪽

이 계층은 Codex/Claude Code 내부 기능에 의존하지 않고, shell wrapper, hook, pre-exec guard 형태로 붙이는 방식이 적합.

4) 프롬프트 인젝션 / PII / Tool Call / RAG 보안용 범용 오픈소스

프로젝트용도핵심 기능Claude Code/Codex 적용성
NVIDIA NeMo GuardrailsLLM app guardrails대화 흐름, 출력 제어, 정책 기반 rails (Colang)CLI 에이전트보다는 앱/게이트웨이에 적합
LlamaFirewall (PurpleLlama)AI Agent 보안 가드레일prompt injection, jailbreak, agent misalignment 방어에이전트 런타임 앞단에 붙일 수 있음
vpdeva/blackwall-llm-shield-jsJS/Python LLM 보안 툴킷prompt injection, sensitive data leak, unsafe tool call, hostile RAG content 방어FE/Node/Python 기반 프록시로 붙이기 좋음
wiserautomation/SupraWallAI agent zero-trust guardrailsprompt injection, PII scrubbing, policy enforcement, Dify/MCP/LangChain/CrewAI 연동MCP/에이전트 플랫폼 쪽에 적합
guardrails-ai/guardrailsLLM output validationschema validation, output validation, re-ask보안보다는 출력 품질/검증 중심
protectai/rebuffprompt injection detectorprompt injection 탐지업데이트 상태 확인 필요
NVIDIA/garakLLM red teamingjailbreak/prompt injection 취약점 테스트운영 가드레일보다는 평가/테스트용
Azure/PyRITAI red teamingMicrosoft 계열 AI red team framework사전 점검/회귀 테스트용
promptfoo/promptfooLLM eval/red team프롬프트 인젝션/정책 우회 테스트CI에서 guardrail 회귀 테스트에 좋음

5) 코드 보안 / Secret / 취약점 탐지 (같이 붙이면 좋은 도구들)

프로젝트용도Claude Code/Codex에서의 역할
gitleaks/gitleakssecret scancommit 전/후 API key, token 탐지
trufflesecurity/trufflehogsecret scanrepo/history/cloud secret 탐지
Yelp/detect-secretssecret baselinesecret drift 관리
semgrep/semgrepSAST / custom ruleAI가 만든 취약 코드 차단
github/codeql정적 분석PR 단계 보안 검증
google/osv-scannerdependency vuln scan취약 dependency 차단
pre-commit/pre-commit로컬 hook orchestrationClaude/Codex가 commit 전에 검증 강제
GitHubSecurityLab/seclab-taskflow-agentAI 기반 보안 분석auth bypass, IDOR, token leak 등 찾는 오픈소스 프레임워크

6) 인접 레이어 (스킬 컬렉션, 훅 대시보드, 설정 템플릿)

프로젝트용도핵심 기능평가
alirezarezvani/claude-skillsClaude Code skills 컬렉션300+ skills, 11개 플랫폼 지원⭐ 14.7k
trailofbits/claude-code-config보안 설정 템플릿보안 분석/테스트용 Claude Code 설정 템플릿⭐ —
trailofbits/claude-code-devcontainerDevContainer 샌드박스Claude Code DevContainer 기반 격리 실행 환경⭐ 812
felipeelias/hook-labClaude Code hook 대시보드hook 이벤트를 실시간 가시화하는 Elixir/Phoenix 대시보드⭐ 6 · MIT

실전 도입 가이드

상황별 추천

상황추천 도구
untrusted repo + 민감 자격증명claude-guardrails
tool call을 강하게 통제claude-code-guardrails
조직 내 운영 정책/승인 피로 관리lanekeep
컨텍스트 중복/드리프트 억제atlas-guardrails
법무/상용 배포 전 IP 검증claude-skill-ip-guard
Git 위험 명령만 차단mattpocock git-guardrails-claude-code

우선순위 추천

실제로 도입한다면 순서는 이렇게 보는 게 좋습니다.

  1. Claude Code: dwarvesf/claude-guardrails 부터 확인
  2. Git 위험 명령 차단: mattpocock git-guardrails-claude-code
  3. Codex: 내장 sandbox + approvals + rules 먼저 적용
  4. 공통 방어막: destructive_command_guard
  5. Secret/취약점 방지: gitleaks + Semgrep + pre-commit
  6. 프롬프트 인젝션/RAG/tool-call 방어: LlamaFirewall 또는 Blackwall LLM Shield

추천 조합

Claude Code용

  1. Claude Code Hooks 공식 기능
  2. dwarvesf/claude-guardrails
  3. mattpocock/skills — git-guardrails-claude-code
  4. gitleaks 또는 trufflehog
  5. Semgrep
  6. pre-commit

Codex용

  1. Codex sandbox = workspace-write
  2. Codex approval policy = on-request
  3. Codex Rules로 위험 명령 forbidden/prompt 처리
  4. destructive_command_guard 를 shell wrapper 또는 hook처럼 추가
  5. gitleaks / trufflehog / Semgrep / pre-commit

공통 게이트웨이/엔터프라이즈형

  1. LiteLLM Gateway 또는 자체 AI Gateway
  2. LlamaFirewall 또는 NeMo Guardrails
  3. Blackwall LLM Shield / SupraWall 계열
  4. Langfuse trace
  5. promptfoo / Garak / PyRIT 로 red team regression test

핵심 원칙: 프롬프트로 “하지 마”라고 말하는 게 아니라, hook/rule/sandbox/pre-commit에서 물리적으로 막는 구조로 가야 함. Claude Code는 hooks 생태계가 앞서 있고, Codex는 sandbox/rules 쪽이 더 공식적이고 안정적인 방향.

관련 페이지