Skip to content

Human-in-the-loop 表面

随着 Agent 执行能力增强,用户介入必须建模为结构化状态,而不是普通助手正文。

标准请求类型

Type适用场景必需 UI
approval用户必须批准或拒绝动作。Approve/reject 控件和 scope summary。
permissionRuntime 需要提升能力。Risk、target、duration、consequence。
plan_reviewAgent 执行前生成计划。Approve、reject、edit、request changes。
elicitationAgent 需要缺失用户输入。Form、options 或 free text,并有清晰 prompt。
credential_needed用户需要配置凭证。安全跳转设置,并保留当前任务。
cost_confirmation任务可能消耗显著费用、token 或时间。Estimate、limit 和 cancel path。
handoff_acceptance用户或另一 Agent 需要接受交接。Summary、artifacts、evidence、accept/decline。

请求契约

Human-in-the-loop request SHOULD 包含:

  • stable request id
  • task 或 turn id
  • request type
  • title 和简洁说明
  • risk 或 severity
  • available responses
  • expiration 或 stale policy
  • response 后的 audit summary
  • replay 或 evidence reference

客户端 MUST NOT 把 Markdown 句子当成高风险动作的充分权限。

Plan UI

计划审批应是有状态对象:

  • proposed steps
  • scope 和 expected outputs
  • risk/cost summary
  • approve/reject/edit controls
  • saved plan 或 artifact reference
  • rejection reason 或 change request
  • decision 后的 audit summary

如果 plan 被拒绝,应保留 plan 和原因,让 Agent 能带上下文修订。

完成行为

请求 resolved 后:

  • 从 pending attention surfaces 移除
  • 保留紧凑 audit summary
  • 链接到 process 和 evidence surfaces
  • 避免 stale sticky cards 留在主 conversation

验收场景

  1. 高风险动作渲染为 approval UI,并包含 scope 和 consequence。
  2. Approve/reject 通过 controlled runtime action 写入。
  3. resolved request 折叠为摘要,不再显示为 pending。
  4. rejected plan 保留 reason,并可修订。
  5. credentials-needed 状态保留用户草稿和 task context。

Draft runtime-first standard for agent interaction surfaces.