LogionOS/openclaw-shield

GitHub: LogionOS/openclaw-shield

为 OpenClaw AI Agent 平台提供企业级合规防护的开源插件,覆盖 PII 保护、Prompt 注入防御、工具访问控制和防篡改审计日志。

Stars: 0 | Forks: 0

# LogionOS Shield for OpenClaw OpenClaw 是增长最快的开源 AI Agent 平台,但其内置的合规性控制为零。LogionOS Shield 在不改变用户体验的前提下增加了企业级的安全性。 ## 功能概述 | 能力 | 描述 | |---|---| | **Inbound Guard** | 在用户消息到达 AI 之前,扫描其中的 PII、凭据和 Prompt Injection | | **Outbound Guard** | 过滤 AI 响应中的数据泄露,添加监管免责声明 | | **Prompt Guard** | 检测系统 Prompt 中的 ClawJacked 攻击和上下文注入 | | **Tool Guard** | 控制 Agent 可使用的工具,扫描工具参数和结果 | | **Audit Trail** | 每一项合规决策的防篡改哈希链 | | **Policy Engine** | 从 LogionOS API 同步企业策略 | | **Kill Switch** | 紧急关闭所有 AI 交互 | ## 快速开始 ### 1. 安装 ``` openclaw plugins install @logionos/openclaw-shield ``` ### 2. 配置 添加到你的 `~/.openclaw/openclaw.json`: ``` { plugins: { entries: { "@logionos/openclaw-shield": { enabled: true, config: { apiEndpoint: "http://localhost:8000", // Your LogionOS API apiKey: "los_your_api_key_here", mode: "monitor", // Start with monitor, upgrade to enforce/strict }, }, }, }, } ``` ### 3. 重启 Gateway ``` openclaw restart ``` ### 4. 验证 ``` # 在任何已连接的频道中,输入: /shield status ``` ## 执行模式 | 模式 | PASS | WARN | FLAG | BLOCK | |---|---|---|---|---| | **Monitor** | 允许 | 允许 + 日志 | 允许 + 日志 + 事件 | 阻止 + 告警 | | **Enforce** | 允许 | 允许 + 日志 | 阻止 + 事件 | 阻止 + 告警 | | **Strict** | 允许 | 允许 + 告警 | 阻止 + 事件 + 告警 | 阻止 + 告警 + 通知管理员 | 从 `monitor` 模式开始以了解你的流量模式,准备好后升级到 `enforce` 模式。 ## Agent 命令 | 命令 | 描述 | |---|---| | `/shield` | 显示 Shield 状态 | | `/shield stats` | 合规统计 | | `/shield mode ` | 更改执行模式 | | `/shield sessions` | 活跃会话摘要 | ## HTTP API 端点 Shield 在 OpenClaw Gateway 上暴露以下端点: | 端点 | 方法 | 描述 | |---|---|---| | `/logionos/status` | GET | Shield 状态 + 配置 | | `/logionos/stats` | GET | 合规统计 | | `/logionos/sessions` | GET | 活跃会话数据 | ## 配置参考 ``` { // LogionOS API connection apiEndpoint: "http://localhost:8000", apiKey: "los_xxxxxxxxxxxx", // Enforcement mode: monitor | enforce | strict mode: "monitor", // Toggle individual guards guards: { inbound: true, // Scan incoming messages outbound: true, // Scan outgoing responses prompt: true, // Detect prompt injection tool: true, // Control tool access }, // Tool access control toolPolicy: { allowlist: [], // Empty = allow all denylist: ["shell_exec"], // Always block these tools requireApproval: ["send_email"], // Flag for review }, // Audit trail settings audit: { enabled: true, localBufferPath: "~/.openclaw/logionos-audit/", syncInterval: 30, // Seconds between API syncs retentionDays: 90, }, // Alert configuration alerts: { webhookUrl: "", // Webhook for real-time alerts notifyOnBlock: true, notifyOnFlag: true, dailyDigest: false, }, // Performance tuning performance: { localCacheTtl: 300, // Policy cache TTL (seconds) deepCheckTimeout: 5000, // API timeout (ms) failMode: "fail-open", // fail-open | fail-closed }, } ``` ## 架构 ``` OpenClaw Gateway ├─ [request.pre] → Inbound Guard → PII + blocklist scan ├─ [prompt.pre] → Prompt Guard → ClawJacked detection ├─ [tool.pre] → Tool Guard → Access control + arg scan ├─ [tool.post] → Tool Guard → Result PII scan ├─ [message.pre] → Outbound Guard → Response filtering │ └─► LogionOS API (self-hosted or cloud) ├─ L1: PII + Blocklist (hot rules) ├─ L2: Regulation Matching (semantic) ├─ L3: AI Judge (intent analysis) └─ Audit DB (hash chain) ``` **双层设计:** 快速的本地检查 (<2ms) 处理 90% 以上的流量。只有复杂的情况才会调用 LogionOS API 进行深度分析。 ## 系统要求 - OpenClaw 2026.2+ (Lifecycle Interception API) - LogionOS API v0.4+ (自托管或云端) - Node.js 20+ ## 许可证 Apache 2.0 — 免费且开源。详情请参阅 [LICENSE](LICENSE)。 ## 贡献 我们欢迎各种贡献!请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 了解指南。 ## 企业版 需要法规匹配、AI 驱动的意图分析或本地部署?[联系我们](mailto:chris@logionos.com) 了解 LogionOS Cloud 和企业版计划。
标签:Apache 2.0, API安全, DLP, DNS 反向解析, JSON输出, Kill Switch, MITM代理, OpenClaw, PII保护, Streamlit, 人工智能安全, 人工智能安全, 企业安全, 合规性, 合规性, 哈希链, 安全网关, 审计追踪, 工具调用控制, 库, 应急响应, 开源, 提示词注入防御, 插件, 数据脱敏, 智能体安全, 策略引擎, 网络安全, 网络安全审计, 网络安全挑战, 网络资产管理, 自动化攻击, 访问控制, 隐私保护