---
title: Claude Managed Agents 概覽
url: https://platform.claude.com/docs/zh-TW/managed-agents/overview
description: 預先建置、可設定的代理框架，在受管理的基礎設施中執行。最適合長時間執行的任務和非同步工作。
featureMetadata:
  topic:
    title: Managed Agents
    url: https://platform.claude.com/docs/en/managed-agents/overview
  status: beta
  betaHeader: managed-agents-2026-04-01
  zdr:
    eligibility: not-eligible
    note: 不具 ZDR 適用資格，自行託管的 Managed Agents 除外。工作階段是具狀態的資源；對話記錄會保留至您將其刪除為止。
  supportedModels:
    - claude-fable-5-2
    - claude-mythos-5-2
    - claude-fable-5-1
    - claude-mythos-5-1
    - claude-fable-5
    - claude-mythos-5
    - claude-mythos-preview
    - claude-opus-5-5
    - claude-opus-5
    - claude-sonnet-5-5
    - claude-sonnet-5
    - claude-haiku-5-5
    - claude-haiku-4-5-20251001
    - claude-opus-4-8
    - claude-opus-4-7
    - claude-opus-4-6
    - claude-sonnet-4-6
    - claude-opus-4-5-20251101
    - claude-sonnet-4-5-20250929
  supportedPlatforms:
    Claude API: beta
    Claude Platform on AWS: beta
    Claude Models on Google Cloud (Anthropic managed): beta
---

Anthropic 提供兩種使用 Claude 進行建構的方式，各自適用於不同的使用情境：

|  | Messages API | Claude Managed Agents |
| ----- | ----- | ----- |
| **這是什麼** | 直接的模型提示存取 | 預先建構、可設定的代理框架（agent harness），在受管理的基礎設施中執行 |
| **最適合** | 自訂代理迴圈與細粒度控制 | 長時間執行的任務與非同步工作 |

Claude Managed Agents 提供將 Claude 作為自主代理執行所需的框架（harness）與基礎設施。您無需自行建置代理迴圈、工具執行與執行環境，即可獲得一個完全受管理的環境，讓 Claude 能夠安全地讀取檔案、執行指令、瀏覽網頁以及執行程式碼。此框架支援內建的「prompt caching」（提示快取）、壓縮（compaction）以及其他效能最佳化，以產出高品質、高效率的代理輸出。若您想改為透過直接存取模型來建置自己的代理迴圈，請參閱[使用 Messages API](https://platform.claude.com/docs/zh-TW/build-with-claude/working-with-messages)。

<Note>
  Claude Managed Agents 也可在 Claude Models on Google Cloud (Anthropic managed) 和 Claude Platform on AWS 上使用，但在功能可用性和工作階段行為方面存在一些差異。請參閱 [Claude Models on Google Cloud (Anthropic managed)](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/anthropic-managed#claude-managed-agents) 指南，或 Claude Platform on AWS 指南中的 [Claude Managed Agents](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws#claude-managed-agents)。
</Note>

<CardGroup cols={3}>
  <Card title="快速入門" icon="play" href="https://platform.claude.com/docs/zh-TW/managed-agents/quickstart">
    建立您的第一個代理工作階段
  </Card>

  <Card title="啟動工作階段" icon="code-brackets" href="https://platform.claude.com/docs/zh-TW/managed-agents/sessions">
    建立工作階段並傳送您的第一個事件
  </Card>

  <Card title="參考資料" icon="book" href="https://platform.claude.com/docs/zh-TW/managed-agents/reference">
    事件類型、速率限制、CLI 旗標及其他查詢表
  </Card>
</CardGroup>

## 核心概念

Claude Managed Agents 圍繞四個概念建構：

| 概念 | 說明 |
| ----- | ----- |
| **Agent**（代理） | 模型、系統提示、工具、MCP 伺服器與技能 |
| **Environment**（環境） | 工作階段執行位置的設定：由 Anthropic 管理的雲端沙箱，或在您自己的基礎設施上自行託管的沙箱 |
| **Session**（工作階段） | 在環境中執行的代理實例，負責執行特定任務並產生輸出 |
| **Events**（事件） | 您的應用程式與代理之間交換的訊息（使用者輪次、工具結果、狀態更新） |

## 運作方式

<Steps>
  <Step title="建立代理">
    定義模型、「system prompt」（系統提示）、工具、MCP 伺服器與技能。只需建立代理一次，即可在各個工作階段中透過 ID 參照它。
  </Step>

  <Step title="建立環境">
    [設定代理的執行位置](https://platform.claude.com/docs/zh-TW/managed-agents/choosing-an-environment)：雲端沙箱，或在您自己的基礎設施上的[自行託管沙箱](https://platform.claude.com/docs/zh-TW/managed-agents/self-hosted-sandboxes)。
  </Step>

  <Step title="啟動工作階段">
    啟動一個參照您的代理與環境設定的工作階段。
  </Step>

  <Step title="傳送事件並串流回應">
    以事件形式傳送使用者訊息。Claude 會自主執行工具，並透過「server-sent events」（伺服器傳送事件），即 SSE，將結果串流回傳。Managed Agents 服務會保存事件歷史記錄，您可以完整擷取。
  </Step>

  <Step title="引導或中斷">
    在代理程式執行期間傳送額外的使用者事件來引導它，或中斷它以改變方向。
  </Step>
</Steps>

## 何時使用 Claude Managed Agents

Claude Managed Agents 最適合具有以下需求的工作負載：

* **長時間執行：** 執行數分鐘或數小時、包含多次工具呼叫的任務
* **雲端基礎設施：** 具備預先安裝套件與網路存取的安全沙箱
* **自行託管執行：** 在您所控制的基礎設施上執行沙箱，以滿足合規或資料落地要求
* **自行託管服務：** 透過[自行託管的 Claude Managed Agents](https://platform.claude.com/docs/zh-TW/managed-agents/self-hosted)，在您自己的基礎設施上執行整個 Managed Agents 服務
* **最少的基礎設施：** 無需自行建置代理迴圈、沙箱或工具執行層
* **具狀態的工作階段：** 跨多次互動持續保存的檔案系統與對話歷史記錄
* **排程執行：** 透過[排程部署](https://platform.claude.com/docs/zh-TW/managed-agents/scheduled-deployments)依 cron 排程定期執行代理

## 支援的工具

Claude Managed Agents 讓 Claude 能夠存取一組內建工具：

* **Bash：** 在沙箱中執行 shell 指令
* **檔案操作：** 在沙箱中讀取、寫入、編輯、glob 及 grep 檔案
* **網頁搜尋與擷取：** 搜尋網頁並從 URL 擷取內容，可選擇性地限制於網域允許清單或封鎖清單
* **MCP 伺服器：** 連接至外部工具提供者

完整清單與設定選項請參閱[工具](https://platform.claude.com/docs/zh-TW/managed-agents/tools)。

## Beta 存取

<Note>
  Claude Managed Agents 目前為 beta 版。所有 Managed Agents 端點皆需要 `managed-agents-2026-04-01` beta 標頭。SDK 會自動設定 beta 標頭。Anthropic 可能會在各版本之間調整行為以改善輸出。
</Note>

若要開始使用，您需要：

1. 一組從 Claude Console 取得的 [Claude API 金鑰](https://platform.claude.com/settings/keys)。
2. 在所有請求中加上 `managed-agents-2026-04-01` beta 標頭。
3. Claude Managed Agents 的存取權限（所有 API 帳戶預設皆已啟用）。

在 beta 版中，[MCP 通道](https://platform.claude.com/docs/zh-TW/agents-and-tools/mcp-tunnels/overview)與[夢境（dreaming）](https://platform.claude.com/docs/zh-TW/managed-agents/dreams)處於更為有限的研究預覽階段。若要啟用它們，請[申請研究預覽的存取權限](https://claude.com/form/claude-managed-agents)。

Claude Managed Agents 在設計上即為具狀態的：工作階段可長時間執行、在暫停後順利恢復，並將對話歷史記錄、沙箱狀態與輸出儲存於伺服器端。因此，Managed Agents 目前不符合[零資料保留](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention#zero-data-retention-zdr-scope)或 HIPAA 商業夥伴協議（BAA）的涵蓋資格。零資料保留的例外是自行託管的 Claude Managed Agents，在此情況下由您自行儲存這些資料，如[資料保留期限](https://platform.claude.com/docs/zh-TW/managed-agents/self-hosted-data-and-access#how-long-data-is-kept)所述。您仍保有對這些資料的控制權：您可以隨時透過 API [刪除工作階段](https://platform.claude.com/docs/zh-TW/managed-agents/session-operations#deleting-a-session)，並另行刪除您上傳的任何[檔案](https://platform.claude.com/docs/zh-TW/build-with-claude/files#delete-a-file)。關於所有功能的資格，請參閱 [API 與資料保留](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention#feature-eligibility)。

請參閱參考資料中的[速率限制](https://platform.claude.com/docs/zh-TW/managed-agents/reference#rate-limits)與[品牌指南](https://platform.claude.com/docs/zh-TW/managed-agents/reference#branding-guidelines)。

## 可用性

Managed Agents在所有模型上處於 Beta 階段。

### API 支援

| 狀態 | 雲端平台 | 模型 |
| ----- | ----- | ----- |
| Beta | Claude API, [Claude Platform on AWS](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws), [Claude Models on Google Cloud (Anthropic managed)](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/anthropic-managed) | [所有模型](https://platform.claude.com/docs/zh-TW/models/overview) |

### 必要的 Beta 標頭

[Beta 標頭概覽](https://platform.claude.com/docs/zh-TW/api/beta-headers)

Beta 標頭可讓您在實驗性功能與新模型能力成為標準 API 的一部分之前搶先存取。

* `managed-agents-2026-04-01`

### 資料處理

[資料處理概覽](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention#feature-eligibility)

| 項目 | 零資料保留 | HIPAA |
| ----- | ----- | ----- |
| 狀態 | 不符合資格 | 不符合資格 |
| 詳細資訊 | 不具 ZDR 適用資格，自行託管的 Managed Agents 除外。工作階段是具狀態的資源；對話記錄會保留至您將其刪除為止。 [深入了解](https://platform.claude.com/docs/zh-TW/managed-agents/self-hosted-data-and-access#how-long-data-is-kept) | 不具 HIPAA 適用資格。適用於所有 Managed Agents 子功能。 |

適用端點：

* `/v1/agents`
* `/v1/sessions`
* `/v1/environments`
