agentleFS
28672032962867203296/hermes-agent/skills/software-development/agent-harness-design/SKILL.md

agent-harness-design

Skill0 starsChanged 3 months agoMITView on GitHub

Agent Harness设计模式:工具验证、权限沙箱、审计日志、反馈循环.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Agent Harness 设计模式

借鉴 agents-best-practices (2.2k⭐) 的 provider-neutral 设计。

核心原则

"模型提出行动,harness 验证、授权、执行、记录、返回观察。"

Harness 的职责(不是模型的职责):
1. 验证:这个行动合法吗?
2. 授权:用户同意吗?
3. 执行:安全地执行
4. 记录:留下审计日志
5. 反馈:告诉模型执行结果

Harness 架构模式

┌─────────────────────────────────────┐
│            Harness 层                │
│  ┌─────────┐ ┌──────────┐          │
│  │ 验证器   │ │ 授权器    │          │
│  │ (合法?)  │ │ (同意?)   │          │
│  └─────────┘ └──────────┘          │
│  ┌─────────┐ ┌──────────┐          │
│  │ 执行器   │ │ 记录器    │          │
│  │ (安全执行)│ │ (审计日志) │          │
│  └─────────┘ └──────────┘          │
│  ┌──────────────────────┐          │
│  │     反馈循环          │          │
│  │  (结果→模型→学习)     │          │
│  └──────────────────────┘          │
└─────────────────────────────────────┘
         ↑              ↓
    ┌─────────┐    ┌─────────┐
    │  LLM    │    │  工具   │
    │ (思考)  │    │ (执行)  │
    └─────────┘    └─────────┘

四步工作流(Agents Best Practices)

1. 观察(Observe)
   模型分析当前状态和任务

2. 规划(Plan)
   模型提出行动计划(工具调用序列)

3. 执行(Execute)
   Harness 验证→授权→执行

4. 反思(Reflect)
   模型根据执行结果决定下一步

多 Agent Harness 模式

Orchestrator(编排者)
  ├── 拆解任务
  ├── 分配子 Agent
  ├── 监听进度
  └── 汇总结果

Worker(执行者)
  ├── 接收子任务
  ├── 在沙箱执行
  └── 返回结果

Evaluator(评估者)
  └── 独立验证 Worker 的输出

设计清单

□ 每个工具有权限级别
□ 高风险操作需确认
□ 所有操作有审计日志
□ 子 Agent 在沙箱执行
□ 模型不能绕过 Harness 直接操作
□ 错误优雅降级(不崩)
□ 超时自动熔断
□ 反馈循环闭合(结果回到模型)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.