
Agent Guard
io.github.mdfifty50-boop由 GitHub 账号 mdfifty50-boop 发布v0.1.3更新于 Oct 24, 2026
Constitutional guardrails and loop detection for AI agents
概览
一个本地 MCP 服务器,用于监控 AI 代理是否陷入重复循环,提供熔断器、卡死分析与恢复建议。
- 可以做什么
- 注册代理并设置迭代上限与进度阈值,记录每次工具调用的参数和简短结果预览,用于滚动窗口的循环检测。检测代理是否卡死,返回置信度、模式类型、重复动作和恢复建议。配置熔断器,在重复相同动作后警告、阻止或建议替代方案,并在工具调用前做预检。生成详细的卡死报告,包含动作历史、token 浪费估算和建议,并提供按风险排序的所有受监控代理健康看板。以资源形式列出受监控的代理。
- 适用场景
- 适用于构建或运行可能反复调用同一工具而卡住的代理系统,希望在流程内检测循环、阻止重复动作并给出恢复建议的场景。最适合能在每次工具调用前后接入记录与预检工具的代理。
- 运行要求
- 作为本地 stdio 进程运行,通常用 npx agent-guard-mcp 启动,或从源码用 Node.js 和 npm install 运行。未声明账号、API 密钥或环境变量。仅限桌面客户端,无网页可执行版本。
安装
在 SourceWeft 中
- 打开 控制台中的 Agent Guard,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agent-guard-mcp
MCP server that detects and prevents infinite agent loops — the #1 reliability problem in agentic systems.
Provides circuit breakers, pattern detection, stuck-agent analysis, and recovery recommendations via the Model Context Protocol.
Install
Claude Desktop
Add to claude_desktop_config.json:
From source
Tools
register_agent
Register an agent for monitoring.
log_action
Log an agent action for loop detection. Maintains a rolling window of the last 50 actions.
Returns early warnings when repeated patterns are detected.
detect_loop
Check if an agent is stuck in an infinite loop.
Returns:
is_stuck— booleanconfidence— 0.0 to 1.0pattern—healthy,exact_repeat,low_diversity, orexact_repeat_and_low_diversitysuggestion— human-readable recovery advicerepeated_actions— list of repeated signatures with counts
set_circuit_breaker
Configure automatic intervention when action patterns repeat.
check_circuit_breaker
Pre-flight check before executing a tool. Call this BEFORE the actual tool call.
Returns proceed: false when the circuit breaker fires (block mode only).
get_stuck_report
Detailed analysis of why an agent is stuck.
Returns: action history, pattern analysis, token waste estimate, diversity ratio, top repeated patterns, and recovery recommendations.
get_health_dashboard
Overview of all monitored agents. No parameters.
Returns all agents sorted by risk score with their status (STUCK/HEALTHY), action counts, and circuit breaker config.
Resources
Usage Pattern
Tests
License
MIT
来源:README.md,提交 ebeb97e
工具
0版本历史
1- v0.1.3最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。