interrupt_on parameter 配置哪些 tools 需要 approval。
Basic configuration
interrupt_on parameter 接受一个 dictionary,将 tool names 映射到 interrupt configurations。每个 tool 都可配置为:
True:使用默认 behavior 启用 interrupts(允许 approve、edit、reject、respond)False:为该 tool 禁用 interrupts{"allowed_decisions": [...]}:使用指定 allowed decisions 的 custom configuration
Decision types
allowed_decisions list 控制 human 在 review tool call 时可以采取哪些 actions:
"approve":使用 agent 提议的 original arguments 执行 tool"edit":在 execution 前修改 tool arguments"reject":完全跳过该 tool call 的 execution,并向 agent 返回 rejection feedback"respond":将 human message 直接作为 tool result 返回,跳过 execution,适用于 “ask user” 风格的 tools
reject。只有当 human 扮演 tool 本身时才使用 respond,例如回答 ask_user prompt。不要用 respond 拒绝有 side effects 的 tools,因为它的 message 可能会被 model 当作 successful tool result。
你可以自定义每个 tool 可用的 decisions:
Handle interrupts
触发 interrupt 时,agent 会暂停 execution 并返回 control。检查 result 中是否有 interrupts,并相应处理。如果 user rejects an action,请包含清晰的message,告诉 agent tool 未执行,以及下一步应该怎么做。
Multiple tool calls
当 agent 调用多个需要 approval 的 tools 时,所有 interrupts 都会 batch 到一个 interrupt 中。你必须按顺序为每个 action 提供 decisions。Rejection messages
当 reviewer 返回reject decision 时,Deep Agents 会跳过 tool call,并将 rejection feedback 发送回 agent。如果你省略 message,default feedback 会告诉 model tool 未执行,且除非 user 要求,否则不要 retry 相同 tool call。
对于 sensitive 或 side-effecting tools,请随 decision 传入 domain-specific message。明确说明 agent 应该 abandon action、ask a follow-up question,还是尝试 safer alternative。
Edit tool arguments
当 allowed decisions 中包含"edit" 时,你可以在 execution 前修改 tool arguments:
Subagent interrupts
使用 subagents 时,你可以在 tool calls 上 和 tool calls 内 使用 interrupts。Interrupts on tool calls
每个 subagent 都可以拥有自己的interrupt_on configuration,用来 override main agent 的 settings:
interrupts,并使用 Command resume。
Interrupts within tool calls
Subagent tools 可以直接调用interrupt() 来 pause execution 并等待 approval:
Best practices
Always use a checkpointer
Human-in-the-loop 需要 checkpointer 在 interrupt 和 resume 之间持久化 agent state:Use the same thread ID
Resuming 时,必须使用相同 config 和相同thread_id:
Match decision order to actions
Decisions list 必须与action_requests 的顺序匹配:
Tailor configurations by risk
根据 tools 的 risk level 配置不同策略:Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

