> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fetchhive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 智能体操作审批

> 什么会暂停运行、谁会收到通知，以及 API 调用方如何继续

有副作用的集成操作和破坏性操作会暂停运行，直到有人批准。只读操作不会暂停。规则在工作区的集成（Integrations）下的审批设置中。

## 谁会收到通知

工作区所有者和发起该操作的人会收到邮件。已连接 Telegram 时也会通过 Telegram 通知。同一请求会出现在控制台的审批页面。

## API 调用会看到什么

流式和非流式调用都会在第一轮审批时停止。

非流式响应包含 `status`、`run_id` 和 `thread_id`。`status` 为 `completed` 或 `awaiting_approval`。仅在运行等待审批时才包含 `pending_tool_approvals`。仅当策略拒绝了某次调用时才包含 `denied_tool_calls`，其 `reason` 为 `policy_deny`。响应文本包含 `[Waiting for approval: …]`。

流式调用会先发送 `tool_approval` 事件，然后在最终 `usage` 事件上带上相同字段。

`review_url` 在登录后打开 `https://app.fetchhive.com/{workspace_id}/approvals?approval={approval_id}`。邮件令牌不会出现在 API 响应中。看起来像密钥的参数值会替换为 `[redacted]`。

如果响应同时包含 `pending_delegations`，请先处理工具审批。

关闭工具审批时，`status` 为 `completed`，并且不会返回审批数组。

## 如何答复

打开控制台链接、使用邮件链接，或用 API 密钥决定：

`POST /v1/public/workspaces/{workspace_id}/tool_action_approvals/{id}/decide`

`decision` 为 `allow_once` 或 `deny`。`always_allow` 返回 `422` `always_allow_requires_dashboard`。再次决定返回 `409`。已过期的审批返回 `410`。

## 如何继续

使用相同的智能体和 `thread_id` 再次调用，并带上 `decided_tool_approvals: [{ "approval_id": "…" }]`。`message` 可以是空字符串或一条新消息。只会读取 `approval_id`。

如果省略 `decided_tool_approvals` 并复用该线程，Fetch Hive 会加载该线程上已结束且尚未恢复的审批。可以发送 id 时请显式发送。

Webhook 触发或带有 `async.callback_url` 的调用会在决定之后自行继续。回调会先收到 `agent.awaiting_approval`，然后收到带有 `resumed_from_run_id` 的 `agent.completed`。

## 过期与轮次上限

审批在创建 24 小时后过期，除非设置了 `TOOL_APPROVAL_TTL_HOURS`。一次运行链在五轮审批后停止，并附加 `[Approval limit reached]`。

## 始终允许

始终允许在控制台中设置。API 密钥不能创建该策略。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.