Show HN:Claw Patrol,一款用于智能体的安全防火墙
Show HN: Claw Patrol, a security firewall for agents

原始链接: https://github.com/denoland/clawpatrol

**Claw Patrol** 是一款安全防火墙,旨在部署于你的 AI 智能体(Agent)与生产环境之间。它通过在网络传输层拦截智能体流量,利用基于 HCL 定义的规则,实时监控并管控各项操作。例如,你可以自动拦截破坏性的 SQL 查询,或针对 `kubectl delete pod` 等敏感操作要求人工审批。 该系统通过 CEL 表达式提取协议特定的事实(如 SQL 动词、Kubernetes 资源或 HTTP 标头),从而执行精细化的安全策略。 **部署方式:** * **`clawpatrol gateway`**:一个单一的二进制代理,用于执行你的 HCL 配置。 * **`clawpatrol run`**:封装特定的进程树,仅对该命令的流量进行隧道传输。 * **`clawpatrol join`**:建立 WireGuard 隧道,实现主机范围的流量路由。 Claw Patrol 支持灵活的集成,并采用 MIT 许可证开源。如需了解更多信息,请访问 [clawpatrol.dev](https://clawpatrol.dev) 获取文档和安装指南。

Deno 已将其专为自治智能体设计的安全防火墙 **Claw Patrol** 开源。随着 Deno 日益依赖智能体来解决生产环境中的故障,他们面临着一项挑战:如何让这些智能体在获得对关键基础设施(如 Kubernetes、Postgres、GCP)的强大访问权限的同时,避免意外或恶意的破坏性操作。 与侧重于 HTTP/MCP 的现有 LLM 网关或沙箱不同,Claw Patrol 是一款在网络层运行的代理。通过终止 WireGuard 或 Tailscale 上的 TCP 连接,它可以解析 Postgres、SSH 和 HTTP 等底层协议,从而执行细粒度的“代码即策略”(policy-as-code)安全规则。 主要功能包括: * **协议感知过滤:** 通过理解特定的数据库和系统协议,防止危险命令(如 `DROP TABLE`)。 * **治理:** 支持人工介入审批以及针对敏感操作的自动化 LLM 验证。 * **可扩展性:** 使用 Go 语言编写并通过 HCL 配置,支持进程级的出口策略和集中式决策。 Claw Patrol 采用 MIT 许可证并在 GitHub 上开源,为希望在生产环境中安全集成自治智能体的组织提供了一层强大的安全保障。
相关文章

原文

The security firewall for agents.

Claw Patrol sits between your agents and prod, parses their traffic at the wire, and gates each action against rules you write in HCL. For example, you can block destructive SQL, or pause kubectl delete pod until a human approves it before the request reaches Kubernetes.

For the full overview see clawpatrol.dev.

curl -fsSL https://clawpatrol.dev/install.sh | sh

From source: make (requires Go and Node.js).

A real rule from our own production config:

rule "k8s-no-secrets" {
  endpoint  = k8s-prod
  condition = "k8s.resource == 'secrets'"
  verdict   = "deny"
  reason    = "Secret values must not leave the cluster via the agent"
}

Conditions are CEL expressions over wire-level facts the gateway extracts per protocol: SQL verbs and table names for Postgres / ClickHouse, resource / verb / namespace for Kubernetes, method / path / headers / body for HTTP. The full set of facts lives in the config reference.

Three deployment shapes; pick whichever fits.

clawpatrol gateway config.hcl   # run the proxy itself
clawpatrol join <gateway-url>   # join a gateway
clawpatrol run claude           # wrap one agent's process tree

clawpatrol run opens a per-process tunnel on Linux (via netns) or macOS (via NetworkExtension); only the wrapped command's traffic goes through the gateway. clawpatrol join brings up a WireGuard tunnel that routes the whole host. clawpatrol gateway is the proxy: a single binary that loads your HCL config and accepts clients tunneling in via WireGuard or Tailscale.

clawpatrol.dev/docs/getting-started walks through a first config end-to-end. clawpatrol.dev/docs/config-reference is the auto-generated field reference. See gateway.example.hcl for an annotated starting template.

MIT. See LICENSE.md.

联系我们 contact @ memedata.com