
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 分
請在儲存庫或註冊中心條目中宣告授權條款。