DeadClaw — Emergency Kill Switch for OpenClaw Agents
"One tap. Everything stops."
DeadClaw is a single-purpose emergency kill switch. When triggered, it immediately
halts all running OpenClaw agent processes, stops Docker containers, pauses all
scheduled cron jobs and heartbeats, kills all active sessions, and writes a
timestamped incident log. It then confirms back to whichever surface triggered it.
Works with both native OpenClaw installs and Docker-based deployments
(Hostinger VPS, etc.). Auto-detects your setup.
Why DeadClaw Exists
The ClawHavoc attack (February 2026) exposed 1,184 malicious skills in the OpenClaw
ecosystem. People run agents autonomously — often overnight, often unattended. When
something goes wrong, you need a way to stop everything from wherever you are, even
from your phone. DeadClaw is that way.
Activation Methods
DeadClaw supports three activation methods. All three execute the exact same kill
sequence — the only difference is how the user triggers it.
Method 1: Message Trigger
The user sends a trigger word to any connected OpenClaw channel (Telegram, WhatsApp,
Discord, Slack, or any other connected channel). The following words activate DeadClaw:
- -
kill or INLINECODE1 - INLINECODE2
- INLINECODE3
- INLINECODE4
- INLINECODE5
- INLINECODE6
When a trigger word is detected:
- 1. Execute
scripts/kill.sh from the DeadClaw skill directory - Capture the output (process count, containers stopped, cron jobs paused, timestamp)
- Send confirmation back to the same channel the trigger came from:
INLINECODE8
Method 2: WebChat Kill Button
A persistent red button rendered in the OpenClaw WebChat dashboard. The HTML widget
is located at ui/deadclaw-button.html. It calls kill.sh via OpenClaw's WebChat
API hooks (window.OpenClaw.exec()). If the WebChat hooks are unavailable, the
button degrades to showing an error message with manual instructions.
To embed the button, use OpenClaw's WebChat customization hooks:
CODEBLOCK0
Method 3: Phone Home Screen Shortcut
A pre-built shortcut that sends the kill trigger message (deadclaw) to the user's
configured Telegram bot. Setup guides for iOS and Android are in docs/:
- -
docs/iphone-shortcut-guide.md — iOS Shortcuts setup - INLINECODE15 — Android widget setup (Tasker or HTTP Shortcuts)
Watchdog (Passive Protection)
DeadClaw includes a background watchdog (scripts/watchdog.sh) that monitors for
dangerous conditions and auto-triggers the kill without any user action.
The watchdog checks every 60 seconds for (after a 5-minute startup grace period):
- 1. Runaway loops — Any agent process or Docker session running longer than 30 minutes
- Token burn — Token spend exceeding 50,000 tokens in under 10 minutes
- Unauthorized network — Outbound network calls to domains not on the user's whitelist
- Sandbox escape — Any process attempting to write outside the designated OpenClaw workspace
The watchdog uses zero AI tokens — all checks use local system commands only.
When the watchdog auto-triggers, it sends an alert explaining the reason:
INLINECODE17
Watchdog Configuration
The watchdog reads its thresholds from environment variables (with sensible defaults):
| Variable | Default | Description |
|---|
| INLINECODE18 | 30 | Max agent runtime in minutes before auto-kill |
| INLINECODE19 |
50000 | Max token spend in the monitoring window |
|
DEADCLAW_TOKEN_WINDOW_MIN | 10 | Token spend monitoring window in minutes |
|
DEADCLAW_WHITELIST |
./network-whitelist.txt | Allowed outbound domains (one per line) |
|
DEADCLAW_WORKSPACE |
$OPENCLAW_WORKSPACE | Designated workspace directory |
Start the watchdog:
CODEBLOCK1
Stop the watchdog:
CODEBLOCK2
Additional Commands
Status Check
User sends status to any connected channel. DeadClaw responds with a plain-English
health report by executing scripts/status.sh:
- - What agents are currently running (name, PID, uptime)
- Current token spend rate
- Whether the watchdog is active
- Any warnings about approaching thresholds
Restore After Kill
User sends restore to any connected channel. DeadClaw executes scripts/restore.sh,
which:
- 1. Shows what will be restored (backed-up crontab entries, stopped Docker containers, disabled services)
- Prompts: "Restore [X] cron jobs from backup taken at [timestamp]? (yes/no)"
- Restores the crontab from the most recent backup
- Restarts stopped OpenClaw Docker containers
- Detects the OpenClaw gateway
- Confirms restoration with a summary
The watchdog does NOT auto-start after restore — the user verifies stability first,
then starts it manually with scripts/watchdog.sh start.
Scripts Reference
| Script | Purpose |
|---|
| INLINECODE30 | Core kill script — stops all agents + Docker containers, pauses cron, logs incident |
| INLINECODE31 |
Background monitor daemon — auto-triggers kill on threshold breach |
|
scripts/status.sh | Health report — shows running agents, Docker containers, token spend, watchdog status |
|
scripts/restore.sh | Post-kill recovery — restores crontab, restarts Docker containers |
All scripts support a --dry-run flag that logs what would happen without taking action.
Incident Log
All kill events are logged to deadclaw.log in the skill directory. Each entry
records: timestamp, trigger source (channel name), trigger method (message/button/
watchdog/auto), processes killed (count and PIDs), Docker containers stopped, cron
jobs paused, and token spend at time of kill. The log is append-only and never
automatically cleared.
Platform Support
DeadClaw works on both Linux (VPS, bare metal) and macOS (Mac Mini, MacBook).
Scripts auto-detect the OS and use the appropriate commands:
- - Linux:
systemctl for services, pgrep for processes, Docker support - macOS:
launchctl for agents, pgrep for processes, Docker support
DeadClaw — OpenClaw代理的紧急终止开关
一键。一切停止。
DeadClaw是一个单一用途的紧急终止开关。触发时,它会立即停止所有正在运行的OpenClaw代理进程,停止Docker容器,暂停所有计划中的cron任务和心跳检测,终止所有活跃会话,并写入带时间戳的事件日志。然后向触发它的任何界面发送确认信息。
同时支持原生OpenClaw安装和基于Docker的部署(Hostinger VPS等)。自动检测您的环境配置。
DeadClaw存在的原因
ClawHavoc攻击(2026年2月)暴露了OpenClaw生态系统中的1,184个恶意技能。人们自主运行代理——通常是在夜间,通常无人值守。当出现问题时,您需要一种方法从任何地方停止一切,甚至从您的手机。DeadClaw就是这种方法。
激活方式
DeadClaw支持三种激活方式。三种方式执行完全相同的终止序列——唯一的区别是用户触发方式。
方式1:消息触发
用户向任何已连接的OpenClaw频道(Telegram、WhatsApp、Discord、Slack或任何其他已连接频道)发送触发词。以下词语可激活DeadClaw:
- - kill 或 KILL
- dead
- stop everything
- emergency stop
- deadclaw
- 🔴
检测到触发词时:
- 1. 从DeadClaw技能目录执行 scripts/kill.sh
- 捕获输出(进程数、已停止的容器、已暂停的cron任务、时间戳)
- 向触发来源的同一频道发送确认信息:
🔴 DeadClaw已激活。所有代理已停止。[时间戳] — [X]个已终止([X]个进程,[X]个容器)。[X]个cron任务已暂停。查看deadclaw.log获取完整报告。
方式2:WebChat终止按钮
在OpenClaw WebChat仪表板中渲染的持久红色按钮。HTML小部件位于 ui/deadclaw-button.html。它通过OpenClaw的WebChat API钩子(window.OpenClaw.exec())调用 kill.sh。如果WebChat钩子不可用,按钮会降级显示错误信息并附带手动操作说明。
要嵌入按钮,请使用OpenClaw的WebChat自定义钩子:
javascript
OpenClaw.WebChat.registerWidget(deadclaw-button, {
src: skills/deadclaw/ui/deadclaw-button.html,
position: top-bar,
persistent: true
});
方式3:手机主屏幕快捷方式
一个预构建的快捷方式,将终止触发消息(deadclaw)发送到用户配置的Telegram机器人。iOS和Android的设置指南位于 docs/:
- - docs/iphone-shortcut-guide.md — iOS快捷指令设置
- docs/android-widget-guide.md — Android小部件设置(Tasker或HTTP Shortcuts)
看门狗(被动保护)
DeadClaw包含一个后台看门狗(scripts/watchdog.sh),用于监控危险条件并在无需用户操作的情况下自动触发终止。
看门狗每60秒检查一次(在5分钟启动宽限期后):
- 1. 失控循环 — 任何运行超过30分钟的代理进程或Docker会话
- 令牌消耗 — 在10分钟内令牌消耗超过50,000
- 未经授权的网络 — 向用户白名单之外的域名发起出站网络调用
- 沙箱逃逸 — 任何尝试写入指定OpenClaw工作空间之外的进程
看门狗使用零AI令牌——所有检查仅使用本地系统命令。
当看门狗自动触发时,它会发送一条解释原因的警报:
🔴 DeadClaw自动触发。原因:[具体原因]。所有进程已停止。检查deadclaw.log。
看门狗配置
看门狗从环境变量读取其阈值(具有合理的默认值):
| 变量 | 默认值 | 描述 |
|---|
| DEADCLAWMAXRUNTIMEMIN | 30 | 自动终止前代理最大运行时间(分钟) |
| DEADCLAWMAX_TOKENS |
50000 | 监控窗口内最大令牌消耗 |
| DEADCLAW
TOKENWINDOW_MIN | 10 | 令牌消耗监控窗口(分钟) |
| DEADCLAW_WHITELIST | ./network-whitelist.txt | 允许的出站域名(每行一个) |
| DEADCLAW
WORKSPACE | $OPENCLAWWORKSPACE | 指定的工作空间目录 |
启动看门狗:
bash
scripts/watchdog.sh start
停止看门狗:
bash
scripts/watchdog.sh stop
附加命令
状态检查
用户向任何已连接频道发送 status。DeadClaw通过执行 scripts/status.sh 返回一份通俗易懂的健康报告:
- - 当前正在运行的代理(名称、PID、运行时间)
- 当前令牌消耗速率
- 看门狗是否活跃
- 任何接近阈值的警告
终止后恢复
用户向任何已连接频道发送 restore。DeadClaw执行 scripts/restore.sh,该脚本:
- 1. 显示将要恢复的内容(备份的crontab条目、已停止的Docker容器、已禁用的服务)
- 提示:从[时间戳]的备份中恢复[X]个cron任务?(是/否)
- 从最近的备份恢复crontab
- 重新启动已停止的OpenClaw Docker容器
- 检测OpenClaw网关
- 通过摘要确认恢复
恢复后看门狗不会自动启动——用户先验证稳定性,然后手动使用 scripts/watchdog.sh start 启动。
脚本参考
| 脚本 | 用途 |
|---|
| scripts/kill.sh | 核心终止脚本 — 停止所有代理 + Docker容器,暂停cron,记录事件 |
| scripts/watchdog.sh |
后台监控守护进程 — 在阈值被突破时自动触发终止 |
| scripts/status.sh | 健康报告 — 显示运行中的代理、Docker容器、令牌消耗、看门狗状态 |
| scripts/restore.sh | 终止后恢复 — 恢复crontab,重新启动Docker容器 |
所有脚本支持 --dry-run 标志,该标志会记录将要执行的操作而不实际执行。
事件日志
所有终止事件记录在技能目录的 deadclaw.log 中。每条记录包含:时间戳、触发来源(频道名称)、触发方式(消息/按钮/看门狗/自动)、终止的进程(数量和PID)、已停止的Docker容器、已暂停的cron任务以及终止时的令牌消耗。日志仅追加,永远不会自动清除。
平台支持
DeadClaw同时支持Linux(VPS、裸机)和macOS(Mac Mini、MacBook)。脚本自动检测操作系统并使用相应的命令:
- - Linux:systemctl 用于服务,pgrep 用于进程,支持Docker
- macOS:launchctl 用于代理,pgrep 用于进程,支持Docker