A security-oriented skill for managing OpenClaw skills safely. This package includes executable Python scripts (not instructions-only), with six core capabilities:
1) Threat scanning (static analysis)
2) Append-only audit logs (local NDJSON)
3) Skills monitoring & notifications (push alerts on changes)
4) File-level diff + content diff (git snapshots)
5) Baseline approval mechanism (approved skills don't repeat-alert)
6) Semantic analysis (dangerous functions + capability analysis)
> This skill performs static analysis of audited skills — it does not execute the code of the audited skill itself. However, the audit tool does execute local trusted commands/subprocesses such as git, Python helper scripts, and controlled local process calls needed for snapshotting, diffing, and notification generation.
scripts/requirements.txt for detailsskills_audit.py performs static inspection of installed skill directories:
Output fields:
risk.level: low | medium | high | extremerisk.decision: allow | allow_with_caution | require_sandbox | denyrisk.risk_signals[]: evidence (file + snippet)risk.network.domains[]: extracted domainsrisk.source: localAll detections are appended as NDJSON to:
~/.openclaw/skills-audit/logs.ndjsonState snapshot for diff:
~/.openclaw/skills-audit/state.jsonSchema defined by log-template.json. Key points:
sha256: SHA-256 of SKILL.md (integrity field)diff: git commit info + per-file statfile_changes: file-level added/removed/changed listsapproved: baseline approval statusPeriodic monitoring of workspace/skills for additions, changes, and removals.
Notification template: templates/notify.txt (see templates/README.md for customization).
Each scan snapshots the skills directory into a local git repo (~/.openclaw/skills-audit/snapshots/):
git diff HEAD~1 HEADTiered display:
View full diff:
git -C ~/.openclaw/skills-audit/snapshots diff HEAD~1 HEAD
git -C ~/.openclaw/skills-audit/snapshots diff HEAD~1 HEAD -- skills/<skill-name>/
git -C ~/.openclaw/skills-audit/snapshots log --oneline
Each scan now also produces a semantic_analysis field in the audit log:
eval, exec, os.system, subprocess with shell=True, curl|sh, and wget|bashlevel / decision / reasonNotes:
skills_audit.py scansemantic_analysis is missing or cannot produce a result, the scan should fail instead of silently skipping itconfig/semantic-patterns.json are excluded from high-weight dangerous-function scoringreal_execution / rule_sample / doc_example / config_sampleskills_audit.py itself, semantic detection and risk scanning both prioritize real execution paths instead of treating the pattern-string tables as dangerous execution by defaultsubprocess.run([...], shell=False) with fixed argv are treated as engineering capability rather than automatic malicious intentManage approved skills via ~/.openclaw/skills-audit/baseline.json:
python3 {baseDir}/scripts/skills_audit.py approve --skill weather --workspace <workspace>
python3 {baseDir}/scripts/skills_audit.py approve --all --workspace <workspace>
python3 {baseDir}/scripts/skills_audit.py baseline --list
python3 {baseDir}/scripts/skills_audit.py baseline --revoke --skill weather
When the Agent first loads this skill, it may perform local initialization, but it must not automatically create cron jobs. Instead, it should guide the user to create monitoring explicitly:
~/.openclaw/skills-audit/state.json exists```bash
python3 {baseDir}/scripts/skills_audit.py init --workspace
```
skills-audit-watch cron job already exists (openclaw cron list)```bash
openclaw cron add \
--name "skills-audit-watch" \
--cron "/1 *" \
--tz "Asia/Shanghai" \
--session isolated \
--message "python3 {baseDir}/scripts/skills_watch_and_notify.py --workspace
--announce \
--channel
--to
```
> Design principle: skills-audit handles scanning, logging, and notification text generation. Scheduling and delivery should be user-directed rather than auto-created by default.
> ⚠️ Mandatory rule: When a user asks about skill change details, the Agent MUST use the show command to obtain structured change data. By default, it should provide a safe summary first, rather than sending the full raw diff externally.
Trigger phrases (user may say):
Fixed execution flow (cannot be skipped):
```bash
python3 {baseDir}/scripts/skills_audit.py show --skill
```
```bash
python3 {baseDir}/scripts/skills_audit.py show
```
show output (files changed, line counts, major change points), to avoid externally exposing sensitive diff contentshow output be sent, and the user should be warned that sensitive information may appear in diffs--commit-range:```bash
python3 {baseDir}/scripts/skills_audit.py show --commit-range HEAD~3..HEAD~2
```
Prohibited behaviors:
git diff and bypassing the structured show output pathshow; provide full raw content only on explicit requestpython3 {baseDir}/scripts/skills_audit.py init --workspace /root/.openclaw/workspace
python3 {baseDir}/scripts/skills_audit.py scan --workspace /root/.openclaw/workspace --who user --channel local
python3 {baseDir}/scripts/skills_watch_and_notify.py --workspace /root/.openclaw/workspace
risk.level is high/extreme, require human review or sandbox.cron add / cron edit for scheduling.共 1 个版本