凡自治之物 · LGD 治理学 · 创造术家族 | 评测协议:skill-quality-gate(外部公开评测门禁文档)
English
When to use
- The user says the agent "froze", "ran away" or "burned through tokens".
- The system detects repeated calls of the same action with no real progress.
- The user asks how to set a "step limit" or suspects the flow is out of control.
- Internal monitoring accumulates "no gate" risk (LGD state).
Usage
- Core script:
loop_guard.py(root of the skill dir). - Key flags:
--check_loopfor loop detection;--enable_firewallfor circuit-breaking. - Config: env vars
LGD_MAX_STEPS=10andTOKEN_BUDGET_LIMITactivate automated monitoring.
Flow
- Trigger watch: scan conversation/log streams for "stuck" signals.
- State capture: current step count, token burn rate, action-sequence fingerprint.
- Rule match: run loop-detection; test circuit-break conditions.
- Intervention: on confirmed infinite loop or stall, fire a system-level circuit break.
- Diagnosis: structured report with root cause, remaining-token estimate, fix suggestions.
- Recovery: on user instruction, lift the limit and enter a new controlled monitoring cycle.
Evidence & safety
- Evidence: TBD. Version: 1.0.1. Security: no independent scan (TBD).
中文
何时用
- 当用户明确提及 Agent"卡死"、"跑飞"或"烧光 token"等异常状态时。
- 当系统检测到 Agent 处于重复调用同一动作的循环,且任务执行无实质性进展时。
- 当用户询问如何设置"步数上限"或质疑当前流程失控时。
- 当内部监控算法识别到"无门禁"状态持续累积风险时。
用法
- 核心脚本:直接执行
loop_guard.py(位于根目录)。 - 关键命令:
--check_loop循环检测;--enable_firewall开启熔断保护。 - 配置说明:设定环境变量
LGD_MAX_STEPS=10与TOKEN_BUDGET_LIMIT激活自动化监控。
流程
- 触发监听:在对话流或 Agent 日志中实时扫描"卡死"及异常行为信号。
- 状态采集:收集当前执行步骤、Token 消耗速率及动作序列指纹数据。
- 规则比对:运行检测算法,验证是否满足熔断条件。
- 干预决策:确认无限循环或状态停滞,立即触发系统级熔断。
- 诊断生成:输出根因分析、Token 剩余量评估及修复建议的结构化报告。
- 执行恢复:等待用户指令后解除限制,进入新一轮受控监控周期。
证据与安全声明
- 证据:TBD(暂无评测/徽章链接;产生后在此更新实际链接)
- 版本:1.0.1
- 安全:未做独立安全扫描(TBD),结论待补;补全前不作推荐背书。
Ecosystem / 生态入口
This skill is one door of the LGD ecosystem — every entry below is publicly reachable. 本技能是 LGD 生态 的一个入口,下列地址均对公网可达。
- Ecosystem hub / 生态总入口: https://zhaoxinghua09-cell.github.io/lgd-hub/
- LGD theory (canonical) / 理论正本: https://github.com/zhaoxinghua09-cell/LGD
- Formal paper (DOI) / 形式化论文: https://doi.org/10.5281/zenodo.22456647
- Protocol & reference implementation / 协议与参考实现: https://github.com/zhaoxinghua09-cell/uibc-core
- Source of this skill / 本包源码: https://github.com/zhaoxinghua09-cell/agent-skills/tree/main/skills/agent-loop-guard
- All published skills / 全部已发布技能: https://github.com/zhaoxinghua09-cell/agent-skills
- AI-readable index / AI 说明书: https://github.com/zhaoxinghua09-cell/agent-skills/tree/main/skills/agent-loop-guard/llms.txt
Looking for something else? / 还想要别的?
Tell your AI assistant: "Find me an LGD skill that can " — the hub lists every published skill with a one-line purpose. 跟你的 AI 助手说一句「去 LGD 生态超市找能……的技能」,总入口按用途列全了所有已发布技能。
Data handling / 数据处理边界
- 默认不向任何外部地址发送数据:扫描结果、报告、命中明细一律只写本地或只打印到当前会话。
- 如需外发(告警、工单、邮件、IM),必须由人先明确指定接收方,并在每次发送前逐次确认;本技能不预设、也不硬编码任何接收端。
- 只处理调用者明确指定的目标路径,不遍历无关目录,不跟随符号链接,不读取目标之外的凭据文件。
- 命中内容在输出时按需脱敏,避免把敏感原值写进日志或对话记录。
