Skills openclaw-skills-audit
Security audit + append-only NDJSON logging + realtime monitoring for OpenClaw skills.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/buffedon/openclaw-skills-audit" ~/.claude/skills/openclaw-skills-openclaw-skills-audit && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/buffedon/openclaw-skills-audit" ~/.openclaw/skills/openclaw-skills-openclaw-skills-audit && rm -rf "$T"
skills/buffedon/openclaw-skills-audit/SKILL.mdSkills Audit (skills-audit)
A security-oriented skill to help you manage OpenClaw skills safely, with three core capabilities:
- Threat scanning (static analysis)
- Append-only audit logs (local NDJSON)
- Skills monitoring & notifications (push alerts on changes)
This skill is designed to be protocol-first: it audits and records changes without executing skill code.
Core Capabilities
1) Threat Scanning / Static Risk Analysis
When scanning an installed skill directory,
skills_audit.py performs static inspection and generates a risk summary.
It focuses on three classes of signals:
- Network indicators: URLs/domains,
usage hintscurl/wget/requests - Dangerous command indicators:
,curl|sh
,wget|bash
, dynamic exec, base64 decode pipelineseval - Suspicious file indicators: persistence hooks (cron/systemd), sensitive paths (
,~/.ssh
,~/.aws
)/etc/...
Output fields:
:risk.levellow | medium | high | extreme
:risk.decisionallow | allow_with_caution | require_sandbox | deny
: evidence entries (file + snippet)risk.risk_signals[]
: domains extracted from text filesrisk.network.domains[]
Note: this is static analysis only. It never executes the skill code.
2) Audit Logging (Append-only)
All detections are written as one JSON object per line (NDJSON) and appended to:
~/.openclaw/skills-audit/logs.ndjson
A small snapshot file is also maintained for diffing:
~/.openclaw/skills-audit/state.json
The record schema is defined by:
skills-audit/log-template.json
Key design points:
- Append-only: logs are never rewritten
- Integrity hint:
(MD5 of the skill’smd5
if present)SKILL.md - No extra sensitive fields:
/source
are intentionally removed from the schemaapproval
3) Skills Realtime Monitoring & Push Notifications
For better UX, you can run a scheduled monitor that detects:
- Skill 新增/变更/删除 under
workspace/skills
and pushes a message (e.g., to WeCom) only when changes are detected.
Components:
: generates a human-friendly notification textskills_watch_and_notify.py
: OpenClaw owns cron creation/update and delivery routingopenclaw cron add / edit
Behavior:
- No changes → no message
- Has changes → push one notification
Notification style (fixed contract; do not collapse to a short summary):
- Every non-empty change notification must use a fixed template. It must not degrade into a risk-only summary or a one-line skill-only alert.
- The notification must preserve these fields in this order:
- Title:
【Skills 监控提醒】 - Intro line:
检测到 skills 目录发生变更 - Change sections:
/【新增】
/【变更】
(show only non-empty sections)【删除】 - One line per skill:
• <slug>|风险等级:<risk_label> - Path line:
📁 路径:<skills_dir> - Time line:
🕒 时间:<timestamp> (<timezone>) - Audit log line:
🧾 审计日志:<logs_path>
- Title:
- Items 1~7 are part of the fixed notification skeleton and must not be omitted due to model summarization, style rewriting, or channel compression.
- No changes -> no output.
- Risk levels use the fixed visual labels:
🟢 低🟢 中🟡 高🔴 极高⚪ 未知
Recommended fixed template example:
【Skills 监控提醒】 检测到 skills 目录发生变更 【删除】 • weather|风险等级:⚪ 未知 📁 路径:/root/.openclaw/workspace/skills 🕒 时间:2026-03-27 17:58:11 (Asia/Shanghai) 🧾 审计日志:/root/.openclaw/skills-audit/logs.ndjson
How to Start (Enable skills-audit)
There is no daemon by default. You can start it in two ways.
Recommended: start by chat (no commands)
Just tell the assistant in chat:
“Start skills-audit. Monitor skills every minute and push changes back to this conversation.”
The preferred wording is push back to this conversation instead of naming a fixed channel such as WeCom. That way the assistant should:
- Initialize the local files required by
skills_audit.py - Use
(oropenclaw cron add
if the job already exists)openclaw cron edit - Route notifications back to the current conversation, with channel/recipient decided by OpenClaw from session context
Optional parameters:
- Schedule:
SCHEDULE="*/5 * * * *" - Timezone:
TZ=Asia/Shanghai - Log-only mode: “record logs only, do not push”
- Preview-only mode: “preview first, do not create yet”
Design rule:
is responsible only for scan / audit log / notification text generation. Cron scheduling and delivery should be owned by OpenClaw cron.skills-audit
Manual: run commands
Mode 1) Manual scan (recommended for first-time verification)
- Initialize local files:
python3 skills/skills-audit/scripts/skills_audit.py init --workspace /root/.openclaw/workspace
- Run a scan once:
python3 skills/skills-audit/scripts/skills_audit.py scan --workspace /root/.openclaw/workspace --who user --channel local
This will create/update:
~/.openclaw/skills-audit/logs.ndjson~/.openclaw/skills-audit/state.json
Mode 2) Background monitoring (recommended for production)
Use OpenClaw’s own cron system to create the scheduled job (every minute by default).
C) Install monitoring cron (recommended)
Prefer creating/updating the job with
openclaw cron add / openclaw cron edit instead of letting the skill write jobs.json directly.
Recommended design:
- skills-audit does not directly own cron file writes
- OpenClaw cron owns scheduling
- Notifications should return to the current conversation when delivery is enabled
For local verification, you can still run the notifier directly:
python3 skills/skills-audit/scripts/skills_watch_and_notify.py --workspace /root/.openclaw/workspace
Files
— NDJSON schema templateskills/skills-audit/log-template.json
— scanner + logger (logs.ndjson/state.json)skills/skills-audit/scripts/skills_audit.py
— notification text generatorskills/skills-audit/scripts/skills_watch_and_notify.py
Safety Notes
- Static analysis only: never execute unknown skill code during audit.
- If
isrisk.level
/high
, require explicit human review or sandbox.extreme - Prefer OpenClaw
/cron add
for scheduled jobs and delivery routing.cron edit