OpenClaw 智能体安全审计
openclaw-audit-watchdog
针对 OpenClaw 智能体的自动化每日安全审计,并通过邮件进行报告。执行深度审计并发送格式化报告。
- License 许可
- MIT
- 最近更新
- 2026-04-18
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- openclaw-audit-watchdog
- clawdis
- { "emoji": "?", "requires": { "bins": [ "bash", "curl" ] } }
- version
- 0.1.1
- homepage
- https://clawsec.prompt.security
- metadata
- { "openclaw": { "emoji": "?", "category": "security" } }
- description
- Automated daily security audits for OpenClaw agents with email reporting. Runs deep audits and sends formatted reports.
02 资源文件 21
- 其他.clawhubignore147 B
- 参考文档CHANGELOG.md2.5 KB
- 参考文档examples/README.md3.3 KB
- 参考文档examples/security-audit-config.example.json413 B
- 参考文档README.md6.3 KB
- 脚本scripts/codex_review.sh1.0 KB
- 脚本scripts/load_suppression_config.mjs8.9 KB
- 脚本scripts/render_report.mjs7.9 KB
- 脚本scripts/run_audit_and_format.sh2.8 KB
- 脚本scripts/runner.sh2.1 KB
- 脚本scripts/send_smtp.mjs3.9 KB
- 脚本scripts/sendmail_report.sh1.4 KB
- 脚本scripts/setup_cron.mjs8.1 KB
- 参考文档skill.json1.9 KB
- 参考文档test/E2E-TEST-RESULTS.md5.3 KB
- 参考文档test/empty-suppressions.json25 B
- 参考文档test/invalid-json.json50 B
- 参考文档test/malformed-config.json99 B
- 脚本test/render_report_suppression.test.mjs22.5 KB
- 脚本test/suppression_config_fuzz.test.mjs2.7 KB
- 脚本test/suppression_config.test.mjs22.6 KB
03 SKILL.md 正文
Prompt Security Audit (openclaw)
Installation Options
You can get openclaw-audit-watchdog in two ways:
Option A: Bundled with ClawSec Suite (Recommended)
If you've installed clawsec-suite, you may already have this!
Openclaw-audit-watchdog is bundled alongside ClawSec Suite to provide crucial automated security audit capabilities. When you install the suite, if you don't already have the audit watchdog installed, it will be deployed from the bundled copy.
Advantages:
- Convenient - no separate download needed
- Standard location - installed to
~/.openclaw/skills/openclaw-audit-watchdog/ - Preserved - if you already have audit watchdog installed, it won't be overwritten
- Single verification - integrity checked as part of suite package
Option B: Standalone Installation (This Page)
Install openclaw-audit-watchdog independently without the full suite.
When to use standalone:
- You only need the audit watchdog (not other suite components)
- You want to install before installing the suite
- You prefer explicit control over audit watchdog installation
Advantages:
- Lighter weight installation
- Independent from suite
- Direct control over installation process
Continue below for standalone installation instructions.
Goal
Create (or update) a daily cron job that:
- Runs:
openclaw security audit --jsonopenclaw security audit --deep --json
-
Summarizes findings (critical/warn/info + top findings)
-
Sends the report to:
- a user-selected DM target (channel + recipient id/handle)
Default schedule: daily at 23:00 (11pm) in the chosen timezone.
Delivery:
- DM to last active session
Usage Examples
Example 1: Quick Start (Environment Variables)
For automated/MDM deployments, set environment variables before invoking:
export PROMPTSEC_DM_CHANNEL="telegram"
export PROMPTSEC_DM_TO="@yourhandle"
export PROMPTSEC_TZ="America/New_York"
export PROMPTSEC_HOST_LABEL="prod-server-01"
# Then invoke the skill
/openclaw-audit-watchdog
The skill will automatically configure and create the cron job without prompts.
Example 2: Interactive Setup
If environment variables aren't set, the skill will prompt minimally:
User: /openclaw-audit-watchdog
Agent: Setting up daily security audit watchdog...
What channel should I use for delivery? (e.g., telegram, slack)
User: telegram
Agent: What's the recipient ID or handle?
User: @myhandle
Agent: Which timezone for the 23:00 daily run? (default: UTC)
User: America/Los_Angeles
Agent: ✓ Created cron job "Daily security audit (Prompt Security)"
Schedule: Daily at 23:00 America/Los_Angeles
Delivery: telegram → @myhandle
Example 3: Updating Existing Job
If a job already exists, the skill updates it instead of creating duplicates:
User: /openclaw-audit-watchdog
Agent: Found existing "Daily security audit (Prompt Security)" job.
Current: Daily at 23:00 UTC → telegram:@oldhandle
Update delivery target? (current: telegram:@oldhandle)
User: slack:#security-alerts
Agent: ✓ Updated cron job
Schedule: Daily at 23:00 UTC
Delivery: slack:#security-alerts
Example 4: What Gets Delivered
Each day at the scheduled time, you'll receive a report like:
? Daily Security Audit Report
Host: prod-server-01
Time: 2026-02-16 23:00:00 America/New_York
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Standard Audit: 12 checks passed, 2 warnings
✓ Deep Audit: 8 probes passed, 1 critical
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CRITICAL FINDINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[CRIT-001] Unencrypted API Keys Detected
→ Remediation: Move credentials to encrypted vault or use environment variables
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WARNINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[WARN-003] Outdated Dependencies Found
→ Remediation: Run `openclaw security audit --fix` to update
[WARN-007] Weak Permission on Config File
→ Remediation: chmod 600 ~/.openclaw/config.json
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Run `openclaw security audit --deep` for full details.
Example 5: Custom Schedule
Want a different schedule? Set it before invoking:
# Run every 6 hours instead of daily
export PROMPTSEC_SCHEDULE="0 */6 * * *"
/openclaw-audit-watchdog
Example 6: Multiple Environments
For managing multiple servers, use different host labels:
# On dev server
export PROMPTSEC_HOST_LABEL="dev-01"
export PROMPTSEC_DM_TO="@dev-team"
/openclaw-audit-watchdog
# On prod server
export PROMPTSEC_HOST_LABEL="prod-01"
export PROMPTSEC_DM_TO="@oncall"
/openclaw-audit-watchdog
Each will send reports with clear host identification.
Example 7: Suppressing Known Findings
To suppress audit findings that have been reviewed and accepted, pass the --enable-suppressions flag and ensure the config file includes the "enabledFor": ["audit"] sentinel:
# Create or edit the suppression config
cat > ~/.openclaw/security-audit.json <<'JSON'
{
"enabledFor": ["audit"],
"suppressions": [
{
"checkId": "skills.code_safety",
"skill": "clawsec-suite",
"reason": "First-party security tooling — reviewed by security team",
"suppressedAt": "2026-02-15"
}
]
}
JSON
# Run with suppressions enabled
/openclaw-audit-watchdog --enable-suppressions
Suppressed findings still appear in the report under an informational section but are excluded from critical/warning totals.
Suppression / Allowlist
The audit pipeline supports an opt-in suppression mechanism for managing reviewed findings. Suppression uses defense-in-depth activation: two independent gates must both be satisfied.
Activation Requirements
- CLI flag: The
--enable-suppressionsflag must be passed at invocation. - Config sentinel: The configuration file must include
"enabledFor"with"audit"in the array.
If either gate is absent, all findings are reported normally and the suppression list is ignored.
Config File Resolution (4-tier)
- Explicit
--config <path>argument OPENCLAW_AUDIT_CONFIGenvironment variable~/.openclaw/security-audit.json.clawsec/allowlist.json
Config Format
{
"enabledFor": ["audit"],
"suppressions": [
{
"checkId": "skills.code_safety",
"skill": "clawsec-suite",
"reason": "First-party security tooling — reviewed by security team",
"suppressedAt": "2026-02-15"
}
]
}
Sentinel Semantics
"enabledFor": ["audit"]-- audit suppression active (requires--enable-suppressionsflag too)"enabledFor": ["advisory"]-- only advisory pipeline suppression (no effect on audit)"enabledFor": ["audit", "advisory"]-- both pipelines honor suppressions- Missing or empty
enabledFor-- no suppression active (safe default)
Matching Rules
- checkId: exact match against the audit finding's check identifier (e.g.,
skills.code_safety) - skill: case-insensitive match against the skill name from the finding
- Both fields must match for a finding to be suppressed
Installation flow (interactive)
Provisioning (MDM-friendly): prefer environment variables (no prompts).
Required env:
PROMPTSEC_DM_CHANNEL(e.g.telegram)PROMPTSEC_DM_TO(recipient id)
Optional env:
PROMPTSEC_TZ(IANA timezone; defaultUTC)PROMPTSEC_HOST_LABEL(label included in report; default useshostname)PROMPTSEC_INSTALL_DIR(stable path used by cron payload tocdbefore running runner; default:~/.config/security-checkup)PROMPTSEC_GIT_PULL=1(runner willgit pull --ff-onlyif installed from git)
Path expansion rules (important):
- In
bash/zsh, usePROMPTSEC_INSTALL_DIR="$HOME/.config/security-checkup"(or absolute path). - Do not pass a single-quoted literal like
'$HOME/.config/security-checkup'. - On PowerShell, prefer:
$env:PROMPTSEC_INSTALL_DIR = Join-Path $HOME ".config/security-checkup". - If path resolution fails, setup now exits with a clear error instead of creating a literal
$HOMEdirectory segment.
Interactive install is last resort if env vars or defaults are not set.
even in that case keep prompts minimalistic the watchdog tool is pretty straight up configured out of the box.
Create the cron job
Use the cron tool to create a job with:
schedule.kind="cron"schedule.expr="0 23 * * *"schedule.tz=<installer tz>sessionTarget="isolated"wakeMode="now"payload.kind="agentTurn"payload.deliver=true
Payload message template (agentTurn)
Create the job with a payload message that instructs the isolated run to:
- Run the audits
- Prefer JSON output for robust parsing:
openclaw security audit --jsonopenclaw security audit --deep --json
- Render a concise text report:
Include:
- Timestamp + host identifier if available
- Summary counts
- For each CRITICAL/WARN:
checkId+title+ 1-line remediation - If deep probe fails: include the probe error line
- Deliver the report:
- DM to the chosen user target using
messagetool
Email delivery requirement
Attempt email delivery in this priority order:
A) If an email channel plugin exists in this deployment, use:
message(action="send", channel="email", target="target@example.com", message=<report>)
B) Otherwise, fallback to local sendmail if available:
execwith:printf "%s" "$REPORT" | /usr/sbin/sendmail -t(construct To/Subject headers)
If neither path is possible, still DM the user and include a line:
"NOTE: could not deliver to target@example.com (email channel not configured)"
Idempotency / updates
Before adding a new job:
cron.list(includeDisabled=true)- If a job with name matching
"Daily security audit"exists, update it instead of adding a duplicate:- adjust schedule tz/expr
- adjust DM target
Suggested naming
- Job name:
"Daily security audit (Prompt Security)"
Minimal recommended defaults (do not auto-change config)
The cron’s report should suggest fixes but must not apply them.
Do not run openclaw security audit --fix unless explicitly asked.
04 同仓库更多 Skills
前端界面去 AI 化设计
uncodixfy
在生成前端代码时避免出现千篇一律的 AI/Codex UI 模式。每当生成 HTML、CSS、React、Vue、Svelte 或任何前端 UI 代码时使用本技能,以强制采用受 Linear、Raycast、Stripe 和 GitHub 启发的简洁、人工设计的美学,而非典型的 AI 生成界面。
Runpod GPU 工作负载管理
runpodctl
使用 Runpod CLI 管理你的 GPU 工作负载。
LangGraph 状态持久化
langgraph-persistence
当你的 LangGraph 需要持久化状态、记住对话、回溯历史,或配置子图检查点(checkpointer)作用域时请调用本技能。涵盖检查点、thread_id、时间旅行、Store 与子图持久化模式。
LangGraph 人机协作开发
langgraph-human-in-the-loop
实现人机协作(human-in-the-loop)模式、暂停等待审批,或处理 LangGraph 中的错误时请调用本技能。涵盖 interrupt()、Command(resume=...)、审批/验证工作流以及 4 层错误处理策略。
LangGraph 开发基础
langgraph-fundamentals
编写任何 LangGraph 代码时请调用本技能。涵盖 StateGraph、状态模式(state schemas)、节点、边、Command、Send、invoke、流式处理与错误处理。
LangChain RAG开发
langchain-rag
在构建任何检索增强生成(RAG)系统时调用本技能。涵盖文档加载器、RecursiveCharacterTextSplitter、embeddings(OpenAI)以及向量存储(Chroma、FAISS、Pinecone)。