Install
openclaw skills install skills-auditorSecurity audit + append-only logging + monitoring for OpenClaw skills (file-level diff, baseline approval, SHA-256 integrity). Requires Python ≥3.9 and git.
openclaw skills install skills-auditorA security-oriented skill for managing OpenClaw skills safely. This package includes executable Python scripts (not instructions-only), with six core capabilities:
This skill performs static analysis of audited skills — it does not execute the code of the audited skill itself. The audit tool executes local trusted commands/subprocesses such as
git, Python helper scripts, and controlled local process calls needed for snapshotting, diffing, and notification generation.Scope of this skill: The included Python scripts perform file reading, git operations, regex-based scanning, and local log writing. The scripts themselves do not contain any network or HTTP client code.
Semantic analysis is performed by the hosting Agent as part of the audit workflow. This is an Agent-level capability, not a script-level operation — the Agent reads code context and applies its language model to assess risk. Data handling during semantic analysis is governed by the Agent's own deployment configuration and security policies, which is outside the scope of this skill package.
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
Manage 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
Semantic analysis operates in two layers:
Built-in rule engine (script-level): The semantic_analyze_skill() function in skills_audit.py performs regex pattern matching, keyword scoring, and context-aware weighting. This is a pure local Python function — no network access, no model dependency.
Agent semantic understanding (Agent-level): The hosting Agent applies its language model to perform deeper code comprehension — identifying obfuscated patterns, indirect calls, and contextual risk that pure regex cannot catch. This is an Agent-level capability; its data handling is governed by the Agent's deployment configuration and security policies, not by this skill package.
The combined result is written to the semantic_analysis field in the audit log, covering:
eval, exec, os.system, subprocess with shell=True, curl|sh, wget|bash — evaluating whether usage is benign (documentation examples, rule-table entries) or genuinely dangerouslevel / decision / reasonMandatory rules:
semantic_analysis is missing or empty in the scan result, the scan must fail rather than silently proceeding without itResponsibility boundary:
config/semantic-patterns.json (editable, no code changes needed)Analysis context awareness:
real_execution / rule_sample / doc_example / config_sampleconfig/semantic-patterns.json) are deprioritized in dangerous-function scoringskills_audit.py), analysis prioritizes real execution paths and does not treat pattern-string tables as dangerous executionsubprocess.run([...], shell=False) with fixed argv) do not automatically imply hostile intentWhen 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 existspython3 {baseDir}/scripts/skills_audit.py init --workspace <workspace>
skills-audit-watch cron job already exists (openclaw cron list)openclaw cron add \
--name "skills-audit-watch" \
--cron "*/1 * * * *" \
--tz "Asia/Shanghai" \
--session isolated \
--message "python3 {baseDir}/scripts/skills_watch_and_notify.py --workspace <workspace>" \
--announce \
--channel <current_channel> \
--to <current_user_id>
Design principle:
skills-audithandles 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
showcommand 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):
python3 {baseDir}/scripts/skills_audit.py show --skill <skill-name>
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:
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
This skill is lightweight and does not consume significant CPU or memory. Below are benchmark results on a 2-core / 4 GB host, comparing a 60-second idle baseline with the skill running in a relatively silent state:
| Metric | Idle Baseline | With skills-audit | Increment |
|---|---|---|---|
| CPU avg | 10.20 % | 22.79 % | +12.59 % |
| Memory avg | 48.95 % | 59.01 % | +10.06 % |
| CPU max | 80.00 % | 97.51 % | +17.51 % |
| Memory max | 58.59 % | 72.28 % | +13.69 % |
The skill adds only ~12 % CPU and ~10 % memory on average. Peak spikes occur during git snapshot commits and are transient.
risk.level is high/extreme, require human review or sandbox.cron add / cron edit for scheduling.