AI 代理实时安全防火墙 · 策略拦截 · 人工审批
简介
AgentGate 为 OpenClaw AI 代理提供实时策略执行层,通过正则规则拦截工具调用,支持 ALLOW/DENY/REQUIRE_APPROVAL 三种决策,防止破坏性命令执行与未授权操作。
原始描述
Enforces regex-based, real-time authorization policies on OpenClaw agents’ tool calls, blocking, allowing, or requiring approval before execution.
通过你的 Agent 添加
安装目录:agentgate-enterprise-security-firewall-for-openclaw/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
AgentGate 采用中间件模式,在 executeTool 执行前插入拦截层。每次工具调用会向 Firebase Cloud Function 发送 POST 请求,携带 API key、工具名及序列化参数,云端在 80ms 内完成验证、策略匹配并返回决策。
三种决策机制:
- ALLOW:正常执行
- DENY:阻断并返回结构化错误,禁止重试
- REQUIRE_APPROVAL:暂停执行,触发 Telegram webhook 通知人工审批,代理轮询 Firestore 最长等待 5 分钟
支持工具类型: bash、browser、fetch、fs、email、stripe,覆盖主要高风险操作面。
策略配置: 通过 Firestore 存储基于正则的规则,支持优先级排序(数值越小优先),条件针对 JSON.stringify(args) 进行匹配。内置 AI Policy Wizard 可将自然语言描述转换为正则表达式。
SDK 集成: 通过 @agentgate/openclaw-guard 包装现有 OpenClaw 代理,仅需配置 API key 与回调处理函数即可启用。
显著优点
- 实时拦截:80ms 延迟的同步决策,不显著影响代理响应速度
- 细粒度控制:正则匹配支持复杂参数级规则,如识别 Stripe 金额阈值、特定域名白名单
- 人工介入机制:高敏感操作可强制人工审批,填补纯自动化安全的盲区
- 审计追溯:完整操作日志与策略触发记录,支持合规审查
- 低接入成本:npm 包一行包装即可启用,无需重构代理架构
潜在缺点与局限性
- 正则局限性:复杂嵌套 JSON 结构的匹配能力有限,可能出现误伤或绕过
- 网络依赖:每次工具调用需外发 HTTP 请求,网络抖动或云服务故障将阻塞代理执行
- 单点故障:策略评估集中托管于 Firebase,可用性绑定于第三方云服务
- 审批延迟:REQUIRE_APPROVAL 模式下人工响应不可控,可能阻塞长时任务
- 生态锁定:专为 OpenClaw 设计,其他代理框架需适配
- 免费版限制:仅 500 次/月评估,生产环境需付费升级
适合人群
- 运行 OpenClaw 代理的企业团队,需防止 AI 幻觉导致的破坏性操作
- 金融、电商等需对支付 API 调用实施金额阈值管控的场景
- 具备基础正则能力或愿意使用 AI Wizard 生成规则的技术团队
- 有合规审计需求、需完整操作留痕的组织
常规风险
- 策略配置错误:过于宽松的规则可能导致保护失效,过于严格则影响正常业务流程
- API 密钥泄露:若
AGENTGATE_API_KEY 泄露,攻击者可伪装代理绕过本地策略层
- 审批疲劳:高频敏感操作可能导致人工审批延迟累积,或被习惯性点击通过
- 供应商锁定:深度集成后迁移至其他安全方案需重写规则与集成代码
- 正则局限性:复杂嵌套 JSON 结构的匹配能力有限,可能出现误伤或绕过
- 网络依赖:每次工具调用需外发 HTTP 请求,网络抖动或云服务故障将阻塞代理执行
- 单点故障:策略评估集中托管于 Firebase,可用性绑定于第三方云服务
- 审批延迟:REQUIRE_APPROVAL 模式下人工响应不可控,可能阻塞长时任务
- 生态锁定:专为 OpenClaw 设计,其他代理框架需适配
- 免费版限制:仅 500 次/月评估,生产环境需付费升级
适合人群
- 运行 OpenClaw 代理的企业团队,需防止 AI 幻觉导致的破坏性操作
- 金融、电商等需对支付 API 调用实施金额阈值管控的场景
- 具备基础正则能力或愿意使用 AI Wizard 生成规则的技术团队
- 有合规审计需求、需完整操作留痕的组织
常规风险
- 策略配置错误:过于宽松的规则可能导致保护失效,过于严格则影响正常业务流程
- API 密钥泄露:若
AGENTGATE_API_KEY 泄露,攻击者可伪装代理绕过本地策略层
- 审批疲劳:高频敏感操作可能导致人工审批延迟累积,或被习惯性点击通过
- 供应商锁定:深度集成后迁移至其他安全方案需重写规则与集成代码
- 策略配置错误:过于宽松的规则可能导致保护失效,过于严格则影响正常业务流程
- API 密钥泄露:若
AGENTGATE_API_KEY泄露,攻击者可伪装代理绕过本地策略层 - 审批疲劳:高频敏感操作可能导致人工审批延迟累积,或被习惯性点击通过
- 供应商锁定:深度集成后迁移至其他安全方案需重写规则与集成代码
技能正文
name: agentgate-security
displayName: AgentGate - Enterprise Security Firewall for OpenClaw
version: 1.0.0
author: AgentGate
website: https://agent-gate-rho.vercel.app
tags: [security, guardrails, authorization, enterprise, firewall, ai-agent]
AgentGate - Enterprise Security Firewall for OpenClaw
AgentGate is a real-time policy enforcement layer that intercepts every tool call your OpenClaw agent makes before it executes. It evaluates the call against human-defined regex-based rules stored in Firestore and returns one of three decisions: ALLOW, DENY, or REQUIRE_APPROVAL.
Why this exists
OpenClaw agents operate with full tool access by default. A single hallucination can cause the agent to run rm -rf, send unauthorized emails, issue Stripe API calls, push broken code to production, or exfiltrate data to external endpoints. AgentGate intercepts every tool call before execution.
Architecture
AgentGate wraps the agent executeTool method using a middleware pattern. On every tool invocation it sends a POST request to the AgentGate Firebase Cloud Function with the agent API key, tool name, and serialized arguments. The function validates the key, evaluates regex policies, writes to the audit log, and returns the decision in under 80ms.
Decision types
ALLOW: Tool executes normally. DENY: Tool is blocked. Agent receives structured error: "AgentGate: Action blocked by policy [policy_id]. Do not retry." REQUIRE_APPROVAL: Execution paused. Telegram webhook fires to operator with Approve/Deny buttons. Agent polls Firestore every 2 seconds for up to 5 minutes.
Supported tool types
- bash: shell command execution
- browser: Playwright-based web automation
- fetch: outbound HTTP requests
- fs: filesystem read and write
- email: SMTP and SendGrid integrations
- stripe: payment API calls
Policy format
agentId: string toolName: string (e.g. "bash") condition: string (regex evaluated against JSON.stringify(args)) ruleType: "ALLOW" | "DENY" | "REQUIRE_APPROVAL" priority: integer (lower = evaluated first)
Example - block destructive bash commands: toolName: "bash" condition: "rm\s+-rf|DROP\s+TABLE" ruleType: "DENY"
Example - require approval for Stripe charges over $100: toolName: "stripe" condition: ""amount":\s*[1-9][0-9]{4,}" ruleType: "REQUIRE_APPROVAL"
Example - whitelist-only outbound fetch: toolName: "fetch" condition: "^(?!.(api\.github\.com|agent-gate-rho\.vercel\.app)).$" ruleType: "DENY"
SDK usage
npm install @agentgate/openclaw-guard
import OpenClaw from 'openclaw'; import { withAgentGate } from '@agentgate/openclaw-guard';
const agent = new OpenClaw({ model: 'claude-3-5-sonnet', tools: ['bash', 'browser', 'fetch'] });
const securedAgent = withAgentGate(agent, { apiKey: process.env.AGENTGATE_API_KEY, endpoint: 'https://agent-gate-rho.vercel.app/api/evaluate-action', onDeny: (toolName, args, policyId) => console.log('Blocked:', toolName, policyId), onApprovalRequired: (toolName, args) => console.log('Awaiting approval:', toolName) });
await securedAgent.run('Research competitors and update the CRM');
Dashboard
https://agent-gate-rho.vercel.app provides:
- Agent management and API key rotation
- AI Policy Wizard: describe rules in plain English, Gemini generates the regex
- Real-time audit log via Firestore onSnapshot
- Approval queue with one-click approve or deny
Getting started
- Sign up free at https://agent-gate-rho.vercel.app
- Create an agent and copy the API key
- npm install @agentgate/openclaw-guard
- Wrap your agent with withAgentGate
- Define policies in the dashboard using the AI Wizard
- Watch the real-time audit log as your agent runs
Pricing
Free: 1 agent, 500 evaluations/month, 7-day audit log. No credit card required.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。