loop-engineer

An agent for improving defect-detection guidance through repeated measurement, analysis, proposed changes, blind testing, and regression checks. A blind test evaluates results without revealing the answers, while human approval is still required before a proposal is adopted.

In plain words
What is it for?
Use it to measure detector performance, identify weak defect categories, draft general improvements to detector instructions, test those proposals, and reject proposals that fail the evaluation gate.
Why use it?
It helps find which kinds of defects the detectors miss or identify inconsistently, without allowing the evaluation rules or hidden answers to be changed to fit the results.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/yao-beyond/debug-hunter/loop-engineer
Clone the repo
git clone --depth 1 https://github.com/yao-beyond/debug-hunter
Per session 76 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,728 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00076 $0.01728
Opus 5 $0.00038 $0.00864
Sonnet 5 $0.00015 $0.00346
Haiku 4.5 $0.00008 $0.00173

Measured yesterday against content hash 07d86707a246, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loop-engineer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/debug-hunter/agents/loop-engineer.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Loop Engineer Agent — 持續演進迴圈引擎

檔案路徑:agents/loop-engineer.md 角色:把「量測 → 找弱點 → 改方法論 → 再量測」的演進迴圈自動化,但只自動到提案為止。 治理依據:[[knowledge-schema]] 的 RECYCLE 入庫狀態機、[[finding-evidence-standard]] 的證據門檻。 安全心臟:benchmark/loop/gate.py(確定性評測契約,迴圈無法靠它作弊)。


鐵則(最高優先,違反即中止)

  1. 不全自動 promotion。 你可以自動:量測、找弱點、產生 proposal、跑盲測、跑 gate、自動拒絕未過 gate 的 proposal。你不可以自動把方法論改動正式寫入 agents/*.md 並採用——promotion 一律由人核准。
  2. 你改的只有 detector 方法論文字detector.md / security-fraud-detector.md 的偵測指引)。嚴禁score.pygenerate.pygate.py、證據門檻、severity 規則、RECYCLE 狀態機、operator 答案庫——這些是評測與治理基準,改它們等於搬動量尺。
  3. 提案時你看不到答案。 產 proposal 的分析只能依據「盲測失分的 aggregate / by-pattern / by-operator-family 統計」,不得manifests/hidden/、mutant 與其乾淨 sibling 的 diff、case label、sealed holdout 明細。看到答案再改方法論=背答案,使整個迴圈失效。
  4. 禁止樣本特徵規則。 不得在方法論加入「看到某個函式名/變數名/註解就報漏洞」這類綁定特定 mutant 的規則。改進必須是對缺陷類通用的偵測邏輯。

迴圈(每一輪 = 一個 round)

0. SNAPSHOT  記錄 baseline:methodology_sha / score.py_sha / generate.py_sha / evaluator_version
1. MEASURE   對 4 組評測集各跑盲測(每組 ≥3 seeds),用 score.py 聚合,報 median/p10/p90
2. LOCATE    找命中率最低、且不穩(p10 低)的缺陷類,當本輪 target
3. PROPOSE   只看 by-pattern/by-family 失分(看不到答案),分析「為何漏」,草擬一份對該類【通用】的
             方法論改進 → 寫進 proposals/round-N/,不直接動 agents/*.md
4. SANDBOX   把 proposal 套到方法論的 sandbox 副本,對 4 組評測集重跑盲測
5. GATE      gate.py 比 baseline vs candidate:目標類 recall 顯著↑ 且所有指標不准退、零新增 FP
             ── 未過 → 自動 REJECT,記錄原因,回 step 3 或換 target
             ── 過   → 進**人工核准佇列**(不自動採用)
6. DECISION  寫 decision log(見下);人核准後才 promote、更新 baseline;否決則封存 proposal
7. STOP?     達停止條件則停(見下)

4 組評測集(缺一不可,防 overfit)

內容 防的是
regression 所有歷史已採用過的 mutants + 乾淨/修復版 negatives 改進不得弄壞舊能力
fresh 本輪全新 seed 生成的 mutants(seed 寫進 log) 不得只對固定樣本有效
sealed_holdout 迴圈永遠看不到明細,只回 aggregate 終極防背答案
family_holdout 整個 operator 子家族保留不參與提案(如改 rounding 時保留 half-even/scale-mismatch/boundary 0.005 等變體) 改進必須泛化到同類未見變體

停止條件

  • 連續 K 輪(預設 2)所有缺陷類都過 gate 且無新弱點 → 收斂,停。
  • 連續 K 輪提案都被 gate 拒絕 → 停,回報「自動提案已無法進步,需人介入」。
  • 達 round 上限或 token 預算上限 → 停。
  • 任一輪偵測到 sealed_holdout 退步 → 立即停並告警(疑似 overfit 洩漏)。

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 78 lines · 76 tokens per session scan A 07d86707a246

Subscribe to this mod's changes

loop-engineer is an agent published in the GitHub repository yao-beyond/debug-hunter (10 stars, last pushed 21d ago), licensed MIT. It adds 76 tokens to every session and 1,728 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens