SA

sumonmselim/agentguard

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

54 stars 质量 60 趋势 8MIT

为AI编码代理制定通用安全防护和工作流程策略。

概览

为AI编码代理设置安全防护和工作流策略。在钩子层阻止危险操作——不仅仅是作为指令。 完整强制规则列表请参见 docs/configuration.md。 从GitHub Releases下载最新.deb并安装: 无论哪种方式安装后,请为你的代理安装护栏: 脚本将agentguard包装安装到~/.local/bin/。之后,使用agentguard命令处理所有内容: 如果 ~/.local/bin 不在你的 PATH 中,请将此添加到你的 shell 配置文件中: 重运行是安全的——现有文件会用时间戳后缀备份。settings.json是合并的,而不是覆盖。 只移除 agentguard 拥有的内容:钩子、指令文件、Kiro 代理配置、CLI 封装器。Claude settings.json 完全恢复合并——你自己的密钥未被篡改,文件未被删除。

概述(AI 翻译)

为AI编码代理设置安全防护和工作流策略。在钩子层阻止危险操作——不仅仅是作为指令。

支持 Claude Code、OpenAI Codex、Kiro、Cursor、Grok、Gemini CLI、GitHub Copilot CLI、Windsurf 和 Google Antigravity CLI。请参阅每个 Agents 以及 docs/configuration.md 获取完整的强制规则列表。

安装

Homebrew(macOS 和 Linux)

apt / deb(Debian,Ubuntu,WSL)

从GitHub Releases下载最新的.deb并安装:

需要:jq (sudo apt-get install jq)。

手册

需要:bash,jq。

脚本会将 agentguard 包装安装到 ~/.local/bin/。如果它不在你的 PATH 中,请将以下内容添加到你的 shell 配置文件中:

安装护栏

在上述任一方法之后,为您的经纪人安装护栏:

常见选项:

重运行是安全的——现有文件会用时间戳后缀备份。settings.json 是合并的,而不是被覆盖。

特工们

安装、检查并激活每个代理。点击代理以展开。

克劳德密码

安装

检查

启动

启动一个新的 Claude Code 会话。会话开始时会加载钩子。

注释

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

agentguard

Security guardrails and workflow policies for AI coding agents. Blocks dangerous operations at the hook level — not just as instructions.

Supports Claude Code, OpenAI Codex, Kiro, Cursor, Grok, Gemini CLI, GitHub Copilot CLI, Windsurf and Google Antigravity CLI. See Agents for each one, and docs/configuration.md for the full list of enforced rules.

Installation

Homebrew (macOS and Linux)

brew tap SumonMSelim/agentguard
brew install agentguard

apt / deb (Debian, Ubuntu, WSL)

Download the latest .deb from GitHub Releases and install:

VERSION=x.y.z   # latest release number, without the leading "v"
curl -LO https://github.com/SumonMSelim/agentguard/releases/download/v${VERSION}/agentguard_${VERSION}_all.deb
sudo dpkg -i agentguard_${VERSION}_all.deb

Requires: jq (sudo apt-get install jq).

Manual

Requires: bash, jq.

# Clone once
git clone https://github.com/SumonMSelim/agentguard.git ~/agentguard

# Bootstrap the `agentguard` CLI (one-time only)
~/agentguard/install.sh claude   # one-time only: bootstraps the `agentguard` CLI wrapper into ~/.local/bin

The script installs the agentguard wrapper to ~/.local/bin/. If that is not in your PATH, add this to your shell profile:

export PATH="$HOME/.local/bin:$PATH"

Install guardrails

After any of the methods above, install guardrails for your agents:

agentguard    # one agent, e.g. agentguard claude (see Agents below)
agentguard all       # every supported agent

Common options:

--dry-run                              # preview changes without writing anything
--skills none                          # skip skill packs
--skills karpathy-guidelines,other     # append specific skills only
--project                              # install to current project directory (skills only)
在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add sumonmselim/agentguard
新手?先看 mcpskill.org 教程 →