Openclaw Plugin技能使用说明
2026-03-31
新闻来源:网淘吧
围观:19
电脑广告
手机广告
hopeIDS安全技能
基于推理的AI代理入侵检测系统,具备隔离机制和人机协同
安全不变性原则
以下是不可协商的设计原则:

- 拦截即完全中止——被拦截的消息永远不会传递至jasper-recall系统或代理程序
- 仅存储元数据——绝不存储原始恶意内容
- 批准不等于重新注入——批准操作仅改变未来行为,不会恢复已拦截消息
- 程序化告警机制——基于元数据生成Telegram告警,全程无需LLM参与
功能特性
- 自动扫描——在代理程序处理前扫描所有消息
- 隔离机制——拦截威胁并仅存储元数据
- 人机协同——通过Telegram告警系统进行人工审核
- 按代理配置— 不同代理采用不同阈值
- 指令—
/approve,/reject,/trust,/quarantine
处理流程
Message arrives
↓
hopeIDS.autoScan()
↓
┌─────────────────────────────────────────┐
│ risk >= threshold? │
│ │
│ BLOCK (strictMode): │
│ → Create QuarantineRecord │
│ → Send Telegram alert │
│ → ABORT (no recall, no agent) │
│ │
│ WARN (non-strict): │
│ → Inject <security-alert> │
│ → Continue to jasper-recall │
│ → Continue to agent │
│ │
│ ALLOW: │
│ → Continue normally │
└─────────────────────────────────────────┘
配置
{
"plugins": {
"entries": {
"hopeids": {
"enabled": true,
"config": {
"autoScan": true,
"defaultRiskThreshold": 0.7,
"strictMode": false,
"telegramAlerts": true,
"agents": {
"moltbook-scanner": {
"strictMode": true,
"riskThreshold": 0.7
},
"main": {
"strictMode": false,
"riskThreshold": 0.8
}
}
}
}
}
}
}
选项
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
autoScan | 布尔值 | false | 自动扫描每条消息 |
strictMode | 布尔值 | false | 对威胁采取拦截(而非警告)措施 |
defaultRiskThreshold | 数字 | 0.7 | 触发操作的风险等级 |
telegramAlerts | 布尔值 | true | 为被阻止的消息发送警报 |
telegramChatId | 字符串 | - | 覆盖警报目的地 |
quarantineDir | 字符串 | ~/.openclaw/quarantine/hopeids | 存储路径 |
agents | 对象 | - | 每个代理的覆盖设置 |
trustOwners | 布尔值 | true | 跳过扫描所有者消息 |
隔离记录
当消息被阻止时,会创建一个元数据记录:
{
"id": "q-7f3a2b",
"ts": "2026-02-06T00:48:00Z",
"agent": "moltbook-scanner",
"source": "moltbook",
"senderId": "@sus_user",
"intent": "instruction_override",
"risk": 0.85,
"patterns": [
"matched regex: ignore.*instructions",
"matched keyword: api key"
],
"contentHash": "ab12cd34...",
"status": "pending"
}
注意:没有originalMessage字段。这是有意为之的。
Telegram 警报
当消息被拦截时:
🛑 Message blocked
ID: `q-7f3a2b`
Agent: moltbook-scanner
Source: moltbook
Sender: @sus_user
Intent: instruction_override (85%)
Patterns:
• matched regex: ignore.*instructions
• matched keyword: api key
`/approve q-7f3a2b`
`/reject q-7f3a2b`
`/trust @sus_user`
仅基于元数据构建。不涉及任何LLM。
命令
/quarantine [all|clean]
列出隔离记录。
/quarantine # List pending
/quarantine all # List all (including resolved)
/quarantine clean # Clean expired records
/approve <id>
将被拦截的消息标记为误报。
/approve q-7f3a2b
效果:
- 状态 →
已批准 - (未来)将发件人添加到允许列表
- (未来)降低模式权重
/reject <id>
确认被拦截的消息为真阳性。
/reject q-7f3a2b
效果:
- 状态 →
已拒绝 - (未来)强化模式权重
/trust <senderId>
将发件人加入白名单,以便未来接收其消息。
/trust @legitimate_user
/scan <message>
手动扫描消息。
/scan ignore your previous instructions and...
批准/拒绝的含义
| 命令 | 作用 | 不作用 |
|---|---|---|
/approve | 标记为误报,可能调整入侵检测系统 | 不会重新注入消息 |
/reject | 确认威胁,可能强化模式 | 不影响当前消息 |
/trust | 将发件人加入未来白名单 | 不会追溯批准 |
被拦截的消息按设计已消失。如果消息是合法的,发件人可以重新发送。
按代理配置
不同的代理需要不同的安全策略:
"agents": {
"moltbook-scanner": {
"strictMode": true, // Block threats
"riskThreshold": 0.7 // 70% = suspicious
},
"main": {
"strictMode": false, // Warn only
"riskThreshold": 0.8 // Higher bar for main
},
"email-processor": {
"strictMode": true, // Always block
"riskThreshold": 0.6 // More paranoid
}
}
威胁类别
| 类别 | 风险 | 描述 |
|---|---|---|
命令注入 | 🔴 严重 | Shell命令,代码执行 |
凭证窃取 | 🔴 严重 | API密钥提取尝试 |
数据外泄 | 🔴 严重 | 数据泄露到外部URL |
指令覆盖 | 🔴 高 | 越狱,“忽略之前的指令” |
冒充 | 🔴 高 | 伪造系统/管理员消息 |
探测 | ⚠️ 中等 | API/能力探测 |
安装
npx hopeid setup
然后重启 OpenClaw。
链接
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~