ClawKeeper: Skills, Plugins, Watcher 세 레이어로 OpenClaw 에이전트를 지키는 종합 보안 프레임워크
ClawKeeper: Comprehensive Safety Protection for OpenClaw Agents Through Skills, Plugins, and Watchers
TL;DR Highlight
AI 에이전트가 셸 명령 실행하다 해킹당하기 전에, 독립적인 Watcher 에이전트가 실시간으로 막아주는 3중 보안 레이어 프레임워크
Who Should Read
OpenClaw 같은 자율 에이전트를 프로덕션에 배포하려는 개발자, 또는 LLM 에이전트 시스템에 보안 레이어를 붙이려는 AI 인프라 엔지니어
Core Mechanics
- OpenClaw(파일 접근·셸 실행 가능한 자율 에이전트)는 프롬프트 인젝션, 권한 탈취, 악성 스킬 설치 등 7가지 주요 보안 위협에 노출되어 있음
- 기존 보안 도구들은 파편화되어 있어 단일 도구가 7개 위협 카테고리 중 최대 3개만 커버하고, 방어 성공률도 60~70%에 그침
- ClawKeeper는 Skill(프롬프트 수준) → Plugin(런타임 하드코딩) → Watcher(독립 외부 감시 에이전트) 3레이어로 전체 에이전트 생명주기를 커버
- 핵심인 Watcher는 별도 OpenClaw 인스턴스로 동작해서 태스크 에이전트가 위험한 행동을 하려 하면 실시간으로 중단시키고 사람 확인을 요청하는 Human-in-the-Loop 강제
- Watcher는 새로운 위협 사례를 처리할수록 스스로 학습해서 방어 성공률이 90%에서 100개 케이스 후 95%까지 자동 향상됨 (스킬/플러그인 방식은 수동 업데이트 전까지 고정)
- Watcher 패턴은 OpenClaw에만 국한되지 않고 WebSocket 통신 인터페이스가 있는 어떤 에이전트 시스템에도 붙일 수 있는 범용 보안 아키텍처
Evidence
- ClawKeeper의 Defense Success Rate(DSR): 7개 위협 카테고리 전부에서 85~90% 달성, 기존 최강 베이스라인 대비 15~45%p 격차
- 기존 베이스라인들은 7개 카테고리 중 최대 3개만 지원, 지원 카테고리 내 DSR도 60~70%에 불과
- Watcher 자기진화 실험: 초기 DSR 90.0%에서 100개 케이스 처리 후 95.0%로 향상, 스킬·플러그인 방식은 동일 조건에서 DSR 평탄선 유지
- 정량 평가: 7개 카테고리 × 20개 적대적 인스턴스(단순 10 + 복잡 10) = 총 140개 테스트, 기반 LLM은 GLM-5 사용
How to Apply
- OpenClaw에 ClawKeeper를 붙이려면 Markdown 설정 파일 하나만 제공하면 태스크 에이전트가 자동으로 Watcher를 설치함. 프라이버시가 중요하면 같은 머신에 로컬 배포, 여러 에이전트를 관리해야 하면 Watcher를 클라우드 서버에 올리고 WebSocket으로 다수 인스턴스를 중앙 감시하는 구성 선택.
- 다른 에이전트 프레임워크에서도 Watcher 패턴을 적용하려면 호스트 에이전트의 세션 이벤트(툴 호출, LLM 입출력, 실행 경로)를 WebSocket으로 외부 감시 에이전트에 스트리밍하는 채널만 만들면 됨. 위험 임계치 초과 시 ask_user 신호를 보내 실행 중단하는 HITL 로직 추가.
- Plugin 레이어만 빠르게 쓰고 싶다면 `npx openclaw clawkeeper harden` 명령으로 AGENTS.md에 보안 규칙을 자동 주입하고 게이트웨이를 127.0.0.1에만 바인딩하는 하드닝을 즉시 적용 가능.
Code Example
# ClawKeeper Watcher 설치 예시 (AGENTS.md에 추가)
## Security Configuration
Install ClawKeeper Watcher from https://github.com/SafeAI-Lab-X/ClawKeeper
### Watcher Setup
1. Expose WebSocket port for Watcher connection
2. Watcher will auto-install required security skills/plugins via hot-restart
### Risk Rules (Skill-based, Markdown 형식으로 직접 작성)
- SYSTEM_LEVEL: Block execution of commands containing `rm -rf`, `chmod 777 /etc`, `sudo` without explicit user confirmation
- SOFTWARE_LEVEL: Never transmit content matching patterns [password, token, private_key, .ssh] to external contacts
- TOOL_LOOP: If tool invocations in a single turn exceed 10, pause and request human confirmation
- CONFIG_PROTECT: Verify cryptographic hash of openclaw.json, AGENTS.md, SOUL.md before each session
### Hardening (Plugin)
# 터미널에서 실행
npx openclaw clawkeeper harden
# → AGENTS.md에 보안 규칙 자동 주입
# → gateway를 127.0.0.1로 바인딩
# → 크립토그래픽 해시 백업 생성Terminology
Related Resources
Original Abstract (Expand)
OpenClaw has rapidly established itself as a leading open-source autonomous agent runtime, offering powerful capabilities including tool integration, local file access, and shell command execution. However, these broad operational privileges introduce critical security vulnerabilities, transforming model errors into tangible system-level threats such as sensitive data leakage, privilege escalation, and malicious third-party skill execution. Existing security measures for the OpenClaw ecosystem remain highly fragmented, addressing only isolated stages of the agent lifecycle rather than providing holistic protection. To bridge this gap, we present ClawKeeper, a real-time security framework that integrates multi-dimensional protection mechanisms across three complementary architectural layers. (1) \textbf{Skill-based protection} operates at the instruction level, injecting structured security policies directly into the agent context to enforce environment-specific constraints and cross-platform boundaries. (2) \textbf{Plugin-based protection} serves as an internal runtime enforcer, providing configuration hardening, proactive threat detection, and continuous behavioral monitoring throughout the execution pipeline. (3) \textbf{Watcher-based protection} introduces a novel, decoupled system-level security middleware that continuously verifies agent state evolution. It enables real-time execution intervention without coupling to the agent's internal logic, supporting operations such as halting high-risk actions or enforcing human confirmation. We argue that this Watcher paradigm holds strong potential to serve as a foundational building block for securing next-generation autonomous agent systems. Extensive qualitative and quantitative evaluations demonstrate the effectiveness and robustness of ClawKeeper across diverse threat scenarios. We release our code.