OpenClaw Triage
Incident response and forensics for agent workspaces. When something goes wrong — a skill behaves unexpectedly, files change without explanation, or another security tool flags an anomaly — triage investigates what happened, assesses the damage, and guides recovery.
This is the "detective" that pulls together evidence from all OpenClaw security tools into a unified incident report.
Commands
Full Investigation
Run a comprehensive incident investigation. Collects workspace state, checks for signs of compromise (recently modified critical files, new skills, unusual permissions, off-hours modifications, large files, hidden files), cross-references with warden/ledger/signet/sentinel data, builds an event timeline, and calculates an incident severity score (CRITICAL / HIGH / MEDIUM / LOW).
CODEBLOCK0
Event Timeline
Build a chronological timeline of all file modifications in the workspace. Groups events by hour, highlights suspicious burst activity (many files modified in a short window), shows which directories and skills were affected, and cross-references with ledger entries if available.
CODEBLOCK1
Look back further than the default 24 hours:
CODEBLOCK2
Blast Radius (Scope)
Assess the blast radius of a potential compromise. Categorizes all files by risk level (critical, memory, skill, config), checks for credential exposure patterns in recently modified files, scans for outbound exfiltration URLs, and estimates scope as CONTAINED (single area), SPREADING (multiple skills), or SYSTEMIC (workspace-level).
CODEBLOCK3
Evidence Collection
Collect and preserve forensic evidence before remediation. Snapshots the full workspace state (file list with SHA-256 hashes, sizes, timestamps), copies all available security tool data (.integrity/, .ledger/, .signet/, .sentinel/), and generates a summary report. Always run this before any remediation to preserve the forensic trail.
CODEBLOCK4
Save to a custom output directory:
CODEBLOCK5
Quick Status
One-line summary of triage state: last investigation timestamp, current threat level, and whether evidence has been collected.
CODEBLOCK6
Workspace Auto-Detection
If --workspace is omitted, the script tries:
- 1.
OPENCLAW_WORKSPACE environment variable - Current directory (if AGENTS.md exists)
- INLINECODE2 (default)
Cross-Reference Sources
Triage automatically checks for data from these OpenClaw tools:
| Tool | Data Path | What Triage Checks |
|---|
| Warden | INLINECODE3 | Baseline deviations — files modified since last known-good state |
| Ledger |
.ledger/chain.jsonl | Chain breaks, unparseable entries, suspicious log entries |
|
Signet |
.signet/manifest.json | Tampered skill signatures — skills modified after signing |
|
Sentinel |
.sentinel/threats.json | Known threats and high-severity findings |
Incident Severity Levels
| Level | Meaning | Trigger |
|---|
| CRITICAL | Immediate response required | Any critical finding, or 3+ high findings |
| HIGH |
Investigation warranted | High-severity findings from any source |
|
MEDIUM | Review recommended | Multiple medium findings or volume threshold |
|
LOW | No immediate action | Informational findings only |
Exit Codes
- -
0 — Clean, no actionable findings - INLINECODE8 — Findings detected (investigation recommended)
- INLINECODE9 — Critical findings (immediate action needed)
No External Dependencies
Python standard library only. No pip install. No network calls. Everything runs locally.
Cross-Platform
Works with OpenClaw, Claude Code, Cursor, and any tool using the Agent Skills specification.
OpenClaw 分类排查
面向智能体工作空间的应急响应与取证分析。当出现异常情况——技能行为异常、文件无故变更、或其他安全工具标记异常时,分类排查工具将调查事件经过、评估损害程度并指导恢复工作。
这是一款侦探工具,能将所有 OpenClaw 安全工具的证据整合为统一的事件报告。
命令
全面调查
执行全面的事件调查。收集工作空间状态,检查入侵迹象(近期修改的关键文件、新增技能、异常权限、非工作时间修改、大文件、隐藏文件),与 warden/ledger/signet/sentinel 数据进行交叉比对,构建事件时间线,并计算事件严重性评分(严重/高危/中危/低危)。
bash
python3 {baseDir}/scripts/triage.py investigate --workspace /path/to/workspace
事件时间线
构建工作空间内所有文件修改的时间顺序时间线。按小时分组事件,高亮可疑的突发活动(短时间内大量文件被修改),显示受影响的目录和技能,并与账本条目进行交叉比对(如有)。
bash
python3 {baseDir}/scripts/triage.py timeline --workspace /path/to/workspace
回溯超过默认的24小时:
bash
python3 {baseDir}/scripts/triage.py timeline --hours 72 --workspace /path/to/workspace
影响范围
评估潜在入侵的影响范围。按风险等级(关键、内存、技能、配置)对所有文件进行分类,检查近期修改文件中是否存在凭证泄露模式,扫描外泄URL,并评估范围为:受限(单一区域)、扩散(多个技能)或系统性(工作空间级别)。
bash
python3 {baseDir}/scripts/triage.py scope --workspace /path/to/workspace
证据收集
在修复前收集并保存取证证据。快照完整的工作空间状态(包含SHA-256哈希值、大小、时间戳的文件列表),复制所有可用的安全工具数据(.integrity/、.ledger/、.signet/、.sentinel/),并生成摘要报告。在进行任何修复操作前务必执行此命令,以保留取证线索。
bash
python3 {baseDir}/scripts/triage.py evidence --workspace /path/to/workspace
保存到自定义输出目录:
bash
python3 {baseDir}/scripts/triage.py evidence --output /path/to/evidence/dir --workspace /path/to/workspace
快速状态
分类排查状态的一行摘要:上次调查时间戳、当前威胁等级、以及是否已收集证据。
bash
python3 {baseDir}/scripts/triage.py status --workspace /path/to/workspace
工作空间自动检测
如果省略 --workspace 参数,脚本将依次尝试:
- 1. OPENCLAW_WORKSPACE 环境变量
- 当前目录(如果存在 AGENTS.md)
- ~/.openclaw/workspace(默认路径)
交叉引用来源
分类排查工具会自动检查以下 OpenClaw 工具的数据:
| 工具 | 数据路径 | 分类排查检查内容 |
|---|
| Warden | .integrity/manifest.json | 基线偏差——自上次已知良好状态后修改的文件 |
| Ledger |
.ledger/chain.jsonl | 链断裂、无法解析的条目、可疑日志条目 |
|
Signet | .signet/manifest.json | 被篡改的技能签名——签名后被修改的技能 |
|
Sentinel | .sentinel/threats.json | 已知威胁和高严重性发现 |
事件严重性等级
| 等级 | 含义 | 触发条件 |
|---|
| 严重 | 需要立即响应 | 任何关键发现,或3个以上高危发现 |
| 高危 |
需要调查 | 来自任何来源的高严重性发现 |
|
中危 | 建议审查 | 多个中危发现或达到数量阈值 |
|
低危 | 无需立即行动 | 仅信息性发现 |
退出代码
- - 0 — 干净,无可操作发现
- 1 — 检测到发现(建议调查)
- 2 — 关键发现(需要立即行动)
无外部依赖
仅使用 Python 标准库。无需 pip 安装。无需网络调用。一切在本地运行。
跨平台
兼容 OpenClaw、Claude Code、Cursor 以及任何使用智能体技能规范的工具。