随着 Claude 模型能力的持续提升,越来越多的开发团队希望借助 AI 完成更复杂、耗时更长的自动化任务——例如在真实代码库中进行多文件重构、自主执行端到端的数据分析流水线、或者在云端持续运行的研究助手。然而,构建一个生产级的智能体系统并不简单:开发者需要设计 agent loop 、管理沙箱安全隔离、处理工具调用错误、维护会话状态,以及解决长时任务中上下文窗口被耗尽等难题。
Managed Agents 是 Anthropic 在 Claude Platform 上推出的解决方案——一个面向长时自主任务的 托管智能体服务 。它将智能体运行所需的基础设施(沙箱容器、工具执行层、会话持久化)统一托管,让开发者聚焦于定义智能体的行为和目标,而不是搭建和维护底层基础设施。
2.什么是Managed Agents
Claude Managed Agents 是 Anthropic 提供的 预构建、可配置的智能体运行框架 ,运行在托管的云基础设施之上。与直接调用 Messages API 相比,它提供了完整的智能体运行时,包括:
自动化的 agent loop :无需自行编写驱动 Claude 循环调用工具直到任务完成的代码
安全隔离的执行容器 :每个 Session 拥有独立的云容器, Claude 可以在其中执行 Bash 命令、读写文件、访问网络
I'll create a Python script that generates the first 20 Fibonacci numbers. [Using tool: write] [Using tool: bash] The script ran successfully. Let me verify the output file. [Using tool: bash] fibonacci.txt contains the first 20 Fibonacci numbers (0 through 4181). Agent finished.
7.3 执行过程说明
当用户发送消息后, Managed Agents 的内部流程如下:
User Event | v [1] Provision Container <-- based on Environment config | v [2] Run Agent Loop <-- Claude decides which tools to use | v [3] Execute Tools <-- bash, file ops, web search inside container | v [4] Stream Events <--real-time SSE events to client | v [5] session.status_idle <-- agent has nothing more to do