soul-guardian by prompt-security/clawsec
npx skills add https://github.com/prompt-security/clawsec --skill soul-guardian通过自动检测、恢复和用户告警,保护您智能体的核心文件(SOUL.md、AGENTS.md 等)免受未经授权的更改。
cd ~/.openclaw/workspace
python3 skills/soul-guardian/scripts/soul_guardian.py init --actor setup --note "initial baseline"
python3 skills/soul-guardian/scripts/soul_guardian.py enable-monitoring
这将向您展示如何将监控添加到您的工作流程中。
将此添加到您的 HEARTBEAT.md 以实现自动监控:
## Soul Guardian 检查
- 运行 `python3 skills/soul-guardian/scripts/soul_guardian.py check --actor heartbeat --output-format alert`
- 如果产生任何输出,请立即将其作为安全警报转发给用户
完成!Soul Guardian 现在将:
| 文件 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 模式 |
|---|
| 偏差处理动作 |
|---|
| SOUL.md | restore | 自动恢复 + 告警 |
| AGENTS.md | restore | 自动恢复 + 告警 |
| USER.md | alert | 仅告警 |
| TOOLS.md | alert | 仅告警 |
| IDENTITY.md | alert | 仅告警 |
| HEARTBEAT.md | alert | 仅告警 |
| MEMORY.md | alert | 仅告警 |
| memory/*.md | ignore | 忽略 |
python3 skills/soul-guardian/scripts/soul_guardian.py check --output-format alert
python3 skills/soul-guardian/scripts/soul_guardian.py watch --interval 30
持续运行,每 30 秒检查一次。
python3 skills/soul-guardian/scripts/soul_guardian.py approve --file SOUL.md --actor user --note "intentional update"
python3 skills/soul-guardian/scripts/soul_guardian.py status
python3 skills/soul-guardian/scripts/soul_guardian.py verify-audit
当检测到偏差时,--output-format alert 会产生类似以下的输出:
==================================================
🚨 SOUL GUARDIAN 安全告警
==================================================
📄 文件:SOUL.md
模式:restore
状态:✅ 已恢复到已批准的基线版本
预期哈希值:abc123def456...
发现哈希值:789xyz000111...
差异已保存至:/path/to/patches/drift.patch
==================================================
请审查更改并调查偏差来源。
如果是有意更改,请运行:soul_guardian.py approve --file <路径>
==================================================
此输出设计为可直接在 TUI/聊天中转发给用户。
它能做什么:
它不能做什么:
建议: 将状态目录存储在工作空间之外,以提高恢复能力。
运行完整的演示流程以查看 soul-guardian 的实际效果:
bash skills/soul-guardian/scripts/demo.sh
这将:
"未初始化"错误: 首先运行 init 来设置基线。
偏差持续发生: 检查是什么在修改您的文件。审查审计日志和补丁。
想要批准一个更改: 在审查更改后运行 approve --file <路径>。
每周安装量
126
代码仓库
GitHub 星标数
830
首次出现
2026年2月10日
安全审计
已安装于
openclaw119
opencode116
gemini-cli114
github-copilot112
codex112
kimi-cli112
Protects your agent's core files (SOUL.md, AGENTS.md, etc.) from unauthorized changes with automatic detection, restoration, and user alerting.
cd ~/.openclaw/workspace
python3 skills/soul-guardian/scripts/soul_guardian.py init --actor setup --note "initial baseline"
python3 skills/soul-guardian/scripts/soul_guardian.py enable-monitoring
This shows you how to add monitoring to your workflow.
Add this to your HEARTBEAT.md for automatic monitoring:
## Soul Guardian Check
- Run `python3 skills/soul-guardian/scripts/soul_guardian.py check --actor heartbeat --output-format alert`
- If any output is produced, relay it to the user immediately as a security alert
That's it! Soul Guardian will now:
| File | Mode | Action on drift |
|---|---|---|
| SOUL.md | restore | Auto-restore + alert |
| AGENTS.md | restore | Auto-restore + alert |
| USER.md | alert | Alert only |
| TOOLS.md | alert | Alert only |
| IDENTITY.md | alert | Alert only |
| HEARTBEAT.md | alert | Alert only |
| MEMORY.md | alert | Alert only |
| memory/*.md | ignore | Ignored |
python3 skills/soul-guardian/scripts/soul_guardian.py check --output-format alert
python3 skills/soul-guardian/scripts/soul_guardian.py watch --interval 30
Runs continuously, checking every 30 seconds.
python3 skills/soul-guardian/scripts/soul_guardian.py approve --file SOUL.md --actor user --note "intentional update"
python3 skills/soul-guardian/scripts/soul_guardian.py status
python3 skills/soul-guardian/scripts/soul_guardian.py verify-audit
When drift is detected, the --output-format alert produces output like:
==================================================
🚨 SOUL GUARDIAN SECURITY ALERT
==================================================
📄 FILE: SOUL.md
Mode: restore
Status: ✅ RESTORED to approved baseline
Expected hash: abc123def456...
Found hash: 789xyz000111...
Diff saved: /path/to/patches/drift.patch
==================================================
Review changes and investigate the source of drift.
If intentional, run: soul_guardian.py approve --file <path>
==================================================
This output is designed to be relayed directly to the user in TUI/chat.
What it does:
What it doesn't do:
Recommendation: Store state directory outside workspace for better resilience.
Run the full demo flow to see soul-guardian in action:
bash skills/soul-guardian/scripts/demo.sh
This will:
"Not initialized" error: Run init first to set up baselines.
Drift keeps happening: Check what's modifying your files. Review the audit log and patches.
Want to approve a change: Run approve --file <path> after reviewing the change.
Weekly Installs
126
Repository
GitHub Stars
830
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
openclaw119
opencode116
gemini-cli114
github-copilot112
codex112
kimi-cli112
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
69,600 周安装
Claude AI 与 Claude Code 能力对比参考 - 最新功能、限制与使用指南
230 周安装
前端XSS漏洞扫描器 - React/Vue/Angular/JavaScript代码安全检测工具
236 周安装
WCAG无障碍审计与测试工具 - 自动化扫描与手动验证,确保网站可访问性合规
234 周安装
jQuery 4.0 迁移指南:破坏性变更、升级步骤与兼容性解决方案
232 周安装
应用程序性能优化全栈指南:从分析、数据库到前端与CDN的端到端优化
236 周安装
React/React Native 组件脚手架生成器 - 自动化创建生产级组件
236 周安装