harness-engineering
它能做什么
这个技能说明如何为自主运行的 AI 智能体设定边界,例如它可以更改什么、如何记录进度,以及何时必须由人来批准。适合运行自主智能体循环的团队。
适用场景
- ✓当你希望 AI 智能体长时间进行研究或实验,而无需不断发出提示时。
- ✓当你需要阻止智能体修改它自己的评分规则或基准时。
- ✓当你在设置一个会准备拉取请求的智能体,并且需要审批步骤时。
技能链接
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/harness-engineering/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为一个通宵运行实验的智能体设计安全的设置:使用固定的评分检查,并在任何内容合并之前设置人工审批步骤。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能描述了锁定部分与可编辑部分、持久日志、新颖性检查、回滚和审批节点,使循环能够运行而不偏离方向。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Harness Engineering
Harness engineering designs the control system around an agent: what it may edit, how it receives feedback, where it writes state, how failures recover, and who can approve irreversible actions. The harness is the difference between a helpful agent session and an autonomous loop that can run for days without corrupting its objective.
When to Activate
Activate this skill when:
- Building autonomous research or experimentation loops
- Designing an agent environment with locked metrics and editable code or content
- Creating PR-producing or background agents
- Evaluating whether an agent can safely run without frequent human prompts
- Adding novelty, ablation, pruning, rollback, or durable logging to an agent workflow
- Preventing agents from gaming benchmarks, weakening rubrics, or losing state across compaction
Do not activate this skill for adjacent work owned by other skills:
- General quality gates, regression suites, or outcome metrics without autonomous control surfaces:
evaluation. - Tool schemas, response formats, and recovery errors for harness tools:
tool-design. - Project-level task-model fit, pipeline shape, and cost planning:
project-development. - Remote sandbox, warm-pool, and hosted session infrastructure:
hosted-agents.
Core Concepts
Harness Boundary
Separate the agent from the environment it operates inside. The agent proposes actions; the harness defines allowed surfaces, feedback, persistence, and promotion rules.
Use four surface classes:
| Surface | Examples | Rule |
|---|---|---|
| Locked | Eval metric, rubric, validation script, merge policy | Agent may read and propose changes, but cannot score itself with modified rules |
| Editable | Skill draft, experiment file, prompt, config under test | Agent may mutate during the loop |
| Append-only | Results log, research thread, rejected ideas | Agent may append, not rewrite |
| Human-controlled | Merge, production deploy, credentials, destructive operations | Requires explicit human approval |
Tight Feedback Loops
Autonomy works when feedback is fast, unambiguous, and hard to game. Karpathy's autoresearch is the minimal pattern: one editable file, one locked evaluation file, fixed wall-clock budget, one scalar metric, git rollback, and a durable results log. The lesson is not that every harness needs one metric; it is that ambiguous feedback creates ambiguous autonomy.
For open-ended research-to-skill work, replace the scalar metric with locked rubrics, deterministic structure checks, source traceability, and human review thresholds.
Durable State
Long-running agents must externalize state. Store plans, source queues, results, failures, and handoffs in files so future agents can resume without relying on chat history. Prime Intellect's autonomous nanoGPT work showed the value of durable scratchpads and THREAD.md-style logs for recovery, monitoring, and audit.
Use append-only logs for:
- What was tried
- What improved or failed
- Why a candidate was kept, discarded, or routed to review
- Which upstream sources were checked
- What the next agent should do
Search Discipline
Agents tend to exploit the nearest surface, stack complexity, and under-run pruning. Add explicit search rules:
- Refresh upstream sources on a schedule.
- Require novelty checks before spending large budgets.
- Preserve rejected attempts to avoid rediscovery.
- Run leave-one-out pruning when a stack has multiple additions.
- Reward simplification when quality is equal.
- Use separate verification before promotion.
Mechanism Registry
For research-to-skill systems, track accepted mechanisms separately from prose. A mechanism record should include a stable mechanism_id, owning_skill, status, activation scenario, behavior change, evidence, and failure modes. Novelty gates should compare against this registry before using broader corpus overlap, because keyword overlap catches stale phrasing while mechanism comparison catches real duplication.
Governance
Autonomous agents may prepare PRs, but governance must be explicit. They can draft changes, run checks, and write PR summaries. They should not merge, deploy, or push without human approval unless the user has explicitly granted that permission for the specific action.
Detailed Topics
Autoresearch-Style Loop
Use this pattern when optimizing an artifact against a stable evaluator:
read locked context -> choose hypot
常见问题
什么是锁定的部分?
它是设置中的一部分,例如评分方法,智能体不允许更改它。
为什么要保留日志?
持久日志让智能体和人都能看到尝试过什么,这有助于在失败后恢复。
人在什么时候介入?
该技能定义了在不可逆操作(例如合并更改)之前的人工审批节点。
详情
作者的原始描述
This skill should be used when designing autonomous agent harnesses: research loops, evaluation scaffolds, locked and editable surfaces, durable logs, novelty gates, pruning, rollback, PR preparation, and human approval boundaries.
热度
- GitHub 星标
- 18k
- 排名
- #10643
- 许可证
- MIT
- 更新时间
- 2026/10/11
评论
- …
同一仓库的更多技能
context-engineering-collection
18k帮你的智能体管理输入 AI 模型上下文窗口的内容,涵盖记忆、工具、多智能体配置以及评估。
advanced-evaluation
18k教你的智能体如何用另一个 AI 来评判 AI 的回答,包括打分、并排比较和偏差检查。
bdi-mental-states
18k教你的智能体用 BDI 方法对信念、目标和计划进行建模,使其决策可以被追溯和解释。
context-compression
18k帮你的智能体把很长的 AI 会话压缩成摘要,保留决策、文件、风险和下一步。