Rethunk-AI/buckler

GitHub: Rethunk-AI/buckler

Buckler 是一个框架无关的声明式策略引擎,用于拦截和管控 AI 编码助手执行的危险 Git 与 GitHub 操作。

Stars: 1 | Forks: 0

# Buckler — Agent Gatehouse [![CI](https://static.pigsec.cn/wp-content/uploads/repos/cas/ad/ad5834178f7599af9fdda11629d49cae07f2997beec49821b2920eff5bfd50e7.svg)](https://github.com/Rethunk-AI/buckler/actions/workflows/ci.yml) [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://python.org) [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![使用 mypy 检查](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) ## 概述 Buckler 是一个**与框架无关**的 (harness-neutral) 策略引擎:声明式 YAML 规则评估来自任何 AI 编码助手的标准化信号,并决定是**允许** (allow)、**拒绝** (deny)、**询问** (ask) 还是**引导** (nudge)——这与哪个框架触发了 hook 无关。`agent-git` 和 `agent-gh` pack 默认启用,开箱即用地阻止不受控的 `git` 提交、强制推送 (force-push)、远程破坏以及破坏性的 `gh` 命令。 ## 功能亮点 - **与框架无关的核心 (Harness-neutral core)** — 评估器对 Cursor 的 `hooks.json` 一无所知;只有轻量级的 adapter 才了解 - **声明式 YAML pack** — 规则基于抽象的触发器类型进行匹配,而非特定于框架的字符串 - **`agent-git` + `agent-gh` pack** — 拒绝不受控的 git 提交 / 强制推送 / 远程破坏;拒绝破坏性的 `gh` 子命令;引导用户使用 MCP 工具 - **Cosign 签名的 release** — 每个发布版本的压缩包在安装前都会进行验证 - **跨平台** — Linux、macOS、Windows (Git Bash) ## 文档 | 受众 | 文件 | |----------|------| | **安装、配置、绕过、故障排除** | [HUMANS.md](HUMANS.md) | | **LLM / 开发内部机制、契约规则** | [AGENTS.md](AGENTS.md) | | **架构与 adapter 边界** | [ARCHITECTURE.md](ARCHITECTURE.md) | | **提交规范、CI、开发环境配置** | [CONTRIBUTING.md](CONTRIBUTING.md) | | **威胁模型、Cosign 验证、漏洞披露** | [SECURITY.md](SECURITY.md) | | **故障排除(hooks、策略、审计日志)** | [docs/troubleshooting.md](docs/troubleshooting.md) | | 规则 YAML schema | [docs/rule-schema.md](docs/rule-schema.md) | | 默认的 `agent-git` pack 矩阵 | [docs/agent-git.md](docs/agent-git.md) | | 默认的 `agent-gh` pack 矩阵 | [docs/agent-gh.md](docs/agent-gh.md) | | 路径解析(XDG、Windows、环境变量覆盖) | [docs/paths.md](docs/paths.md) |
标签:AI编程助手, Cosign签名, Git防护, 工具链安全, 策略引擎, 网络安全挑战, 逆向工具, 钩子拦截