Claude Managed Agents Practical Guide: How to Deploy AI Agents to Production Without Infrastructure
Developers who have built AI agents firsthand will find that they spend far more time on the surrounding infrastructure than on the agent logic itself. Designing agent loops, building sandbox containers, managing sessions, and orchestration—it is common for weeks to pass before an idea can even be validated in code. This high barrier of infrastructure costs is precisely why $2.8 billion in VC investment poured into agentic AI startups in the first half of 2025 alone.
On April 8, 2026, Anthropic launched a service in public beta that directly addresses this problem. Claude Managed Agents is a "managed service for agents" where Anthropic directly operates all the backend infrastructure required for agent execution, allowing developers to focus solely on agent logic.
This article covers the Brain/Hands/Harness architecture principles, practical code including error handling, the actual differences from the OpenAI Agents SDK and Google ADK, and essential precautions to take when deploying to production, focusing on criteria for determining if this service is suitable for your project.
1. Is this service right for me?
Before looking at the code, it is recommended to first determine which category applies to your situation.
| Situation | Recommended Selection |
|---|---|
| Rapid Prototyping, Startups Without Infrastructure Teams | ✅ Managed Agents |
| Standard Agent Workflow (bash, File, Web Search) | ✅ Managed Agents |
| Compliance with self-hosting regulations such as HIPAA and FedRAMP required | ❌ Agent SDK (Self-hosted) |
| Requires multi-model orchestration or GPU | ❌ Agent SDK (self-hosted) |
| If sensitive data cannot be sent to external infrastructure | ❌ Agent SDK (Self-hosted) |
If you check which side of this table your situation is closest to and then proceed, you can reach a decision more quickly.
2. Core Concept: Brain·Hands·Harness Architecture
Separation of Brain and Hands — Why It Was Designed This Way
The core design principle of Claude Managed Agents is the "separation of the Brain and the Hands". Once you understand this distinction, you will naturally understand why the service operates reliably.
| Layer | Role | Description |
|---|---|---|
| Brain | Claude Model | Reasons and decides which tool to call and when |
| Hands | Sandbox Container | Perform actual tasks such as running bash, reading/writing files, web searching, etc. |
| Harness | Orchestrator | Connects the Brain and Hands, and is responsible for context management, retries, and checkpointing |
Thanks to this separation, the entire system does not stop even if a container (Hands) fails. The error handling flow is as follows:
tool-call 실행 실패
→ Harness가 에러를 감지하여 Claude에 전달
→ Claude가 다른 전략으로 재시도 (최대 3회)
→ 최종 실패 시 AgentError 예외 발생Core Philosophy: "Treat containers as cattle, not pets." This is a cloud-native mindset of not becoming attached to individual containers and replacing them immediately if they fail.
Built-in toolset (agent_toolset_20260401)
Tools that can be used immediately without separate settings are provided by default.
bash— Execute shell commandfile_operations— File Reading/Writingweb_search— Real-time Web Searchhttp_request— External API call- MCP (Model Context Protocol) Server Integration
The version string agent_toolset_20260401 is a date-based fixed version. Specifying this version in your code guarantees the same tool behavior even if a new version is released. Since failing to specify a version may result in an automatic upgrade to the latest version, leading to unexpected behavioral changes, it is always recommended to explicitly fix it in production code.
MCP (Model Context Protocol): An open standard led by Anthropic, designed to connect external tools and data sources to LLMs. It is utilized when integrating with various ecosystems such as Slack, Notion, and Vector DB.
Checkpointing: A technique where an agent saves intermediate states during long-term operations. It saves costs and time by allowing operations to resume from the last checkpoint instead of restarting from the beginning, even if an error occurs during the process.
Context Compaction: A technique for efficiently managing context windows as long work histories accumulate. It automatically summarizes and compresses old history, allowing for continuous operation without exceeding context limits. In Managed Agents, this process is handled automatically.
Managed Agents vs. Agent SDK — How They Differ
The Agent SDK is a client library that runs the same engine as Managed Agents on the developer's own infrastructure. It supports Python (v0.1.48+) and TypeScript (v0.2.71+).
| Category | Managed Agents | Agent SDK (Self-hosted) |
|---|---|---|
| Execution Location | Anthropic Cloud | Developer Infrastructure |
| Infrastructure Management | Dedicated by Anthropic | Operated directly by developers |
| Data Path | Pass through Anthropic Server | Process within internal environment |
| Customization | Limited | Freely configure GPU, specific OS, etc. |
| Suitable for | Rapid deployment, startups | Compliance requirements, leveraging existing infrastructure |
3. Comparison with Competitor Services
Currently, both Big Tech and AI specialist companies are actively entering the managed agent platform market. To help you make an informed technology selection, we summarize the practical differences between major services.
| Item | Claude Managed Agents | OpenAI Agents SDK | Google ADK |
|---|---|---|---|
| Supported Models | Claude Only | GPT Family Only | Gemini Family Focus |
| How it works | Fully managed cloud | Self-hosted | Vertex AI integration |
| Built-in Sandbox | ✅ (Brain/Hands Separation) | Requires Separate Configuration | ✅ (Cloud Run Based) |
| Multi-model | ❌ (Claude only) | ❌ (GPT only) | Limited support |
| Error Recovery | Automatic Retry + Checkpointing | Requires Manual Implementation | Limited Automation |
| MCP Support | ✅ Native | Limited | Not Supported |
| Cost Model | Token + Runtime ($0.08/hour) | Token-based | Token + Infrastructure Costs |
To summarize the key difference in one line, Claude Managed Agents is optimized for a "fully managed experience within the Claude ecosystem". If you need to orchestrate multiple models or integrate tightly with existing cloud infrastructure (GCP, AWS), Google ADK or AWS Bedrock AgentCore might be a more suitable choice.
4. Practical Code Examples
Now that you have identified the architecture and competing services, it is time to verify your development experience through actual code. The examples are arranged from simple to complex.
Asynchronous Programming Note: All examples below use the async/await pattern. In Python, the function defined by async def must be executed in the event loop, and asyncio.run() serves as its entry point. This pattern allows the agent to handle other tasks without blocking while calling external tools.
Example 1: Running the Basic Agent (Introduction)
This is the simplest form of agent execution. It is good for understanding the flow of receiving an answer to a single question via a web search.
import asyncio
from claude_agent_sdk import AgentSession, AgentError
async def run_simple_agent() -> str:
try:
async with AgentSession(
model="claude-opus-4-6",
tools=["web_search"]
) as session:
result = await session.run(
"2026년 4월 기준 Python 최신 LTS 버전은 무엇인가요?"
)
return result.output
except AgentError as e:
print(f"에이전트 실행 실패: {e}")
raise
asyncio.run(run_simple_agent())Sample Output:
Python 최신 LTS 버전은 3.12.x입니다. 2026년 4월 기준으로 3.12 시리즈가
장기 지원(LTS) 버전으로 유지되고 있으며, 보안 패치와 버그 수정이 계속
제공됩니다. Python 3.13은 현재 활성 개발 버전입니다.| Code Element | Description |
|---|---|
AgentSession |
Context manager that creates agent sessions. async with Automatically cleans up session resources when exiting the block. |
AgentError |
Exception class indicating an error that occurred during agent execution |
result.output |
Text result finally returned by the agent |
Example 2: Local Git Repository Code Analysis Agent (Intermediate)
This is a scenario for generating a performance report by analyzing the codebase of a mounted local directory. It accesses the actual file system by combining file_operations and bash. repo_path specifies the local directory path (e.g., /workspace/my-project) that the agent will access.
import asyncio
from pathlib import Path
from claude_agent_sdk import AgentSession, AgentError
async def analyze_codebase(repo_path: str) -> str:
if not Path(repo_path).exists():
raise ValueError(f"경로를 찾을 수 없습니다: {repo_path}")
try:
async with AgentSession(
model="claude-opus-4-6",
tools=["bash", "file_operations"]
) as session:
result = await session.run(
f"""
{repo_path} 디렉토리의 코드베이스를 분석해줘.
다음 항목을 포함한 성능 리포트를 작성해:
1. 파일 구조 및 규모 (파일 수, 총 라인 수)
2. 잠재적 성능 병목 지점 (N+1 쿼리, 불필요한 루프 등)
3. 개선 우선순위 TOP 3
결과는 마크다운 형식으로 정리해줘.
"""
)
return result.output
except AgentError as e:
print(f"코드 분석 실패: {e}")
raise
asyncio.run(analyze_codebase("/workspace/my-project"))Example 3: Building a Multistep Data Pipeline with TypeScript (Advanced)
This is an example of handling a chain of tasks—web crawling, data cleaning, and report generation—with a single agent call in a TypeScript environment. It integrates seamlessly with Next.js Server Actions.
Unlike the Python example, TypeScript does not natively support context managers, so we use the pattern try/finally to safely release session resources. Please be careful, as placing session.close() outside the finally block may result in resource leaks because the session will not be closed in the event of an exception.
import { AgentSession, AgentError } from "@anthropic-ai/claude-agent-sdk";
async function runResearchPipeline(topic: string): Promise<string> {
const session = new AgentSession({
model: "claude-opus-4-6",
tools: ["web_search", "http_request", "file_operations", "bash"],
});
try {
const result = await session.run(`
다음 순서로 작업해줘:
1. '${topic}'에 관한 최신 기술 동향을 웹에서 검색
2. 수집된 정보를 구조화하여 data/raw.json에 저장
3. 핵심 인사이트를 추출하여 report.md 형식으로 요약 생성
4. 최종 리포트를 output/report.md에 저장
`);
return result.output;
} catch (e) {
if (e instanceof AgentError) {
console.error(`에이전트 실행 실패: ${e.message}`);
}
throw e;
} finally {
// 예외 발생 여부와 관계없이 세션 리소스를 반드시 해제합니다
await session.close();
}
}
// Next.js Server Action에서 활용
export async function generateMarketReport(topic: string) {
"use server";
return await runResearchPipeline(topic);
}5. Analysis of Pros and Cons
Once you have verified the development experience through the code, summarize the pros and cons to decide whether to implement it in actual production.
Advantages
| Item | Content |
|---|---|
| Development Speed | Infrastructure build (weeks) → Focus solely on agent logic (hours to days) |
| Automatic Scaling | Automatically scales during traffic spikes, no separate DevOps required |
| Built-in Reliability | Ensures long-term operational stability with error recovery, checkpointing, and automatic retries |
| Performance Optimization | Prompt caching, context compaction automatically applied |
| Accessibility | Non-technical teams can also configure agents via the Anthropic console |
| Security Sandbox | Blocks the risk of malicious code execution in an isolated execution environment |
Disadvantages and Precautions
| Item | Content | Response Plan |
|---|---|---|
| Data Privacy | All tool calls and data pass through Anthropic infrastructure | Sensitive data is delivered after masking or self-hosted with Agent SDK |
| Vendor Lock-in | Claude model exclusive, complete orchestration rebuild required when switching to another LLM | Minimizes replacement costs by abstracting the interface layer |
| Beta Limitations | Multiagent·Memory is for research preview and is not suitable for production | Available only in pilot test environments after separate application |
| Always-on Cost | Runtime $0.08/hour, ~$58/month + token costs for 24/7 operation | Minimizes inactivity with event-driven execution |
| Compliance | Not compliant with self-hosting requirements such as HIPAA and FedRAMP | Choose Agent SDK + on-site infrastructure if regulatory requirements are met |
| Special Environments | Cannot configure custom execution environments such as GPUs or specific OS versions | If special requirements exist, a custom container environment must be built |
The Most Common Mistakes in Practice
- Passing sensitive data directly to agents — It is easy to overlook the fact that legal documents, patient data, financial records, etc., pass through Anthropic infrastructure. We recommend reviewing data classification policies before production deployment.
- When using Research Preview features in production — Multiagent and Memory are still in the Research Preview stage. Connecting features with unguaranteed stability to core service flows may lead to unexpected failures.
- When calculating the cost model based solely on token costs — runtime ($0.08/hour) is charged separately. When designing agents that run for a long time, it is necessary to calculate the total cost including runtime costs. Implementing sessions to terminate immediately after the task is completed is effective for cost optimization.
In Conclusion
Much of the perception that "agents are difficult" stems from the surrounding infrastructure rather than the agent logic itself. Claude Managed Agents is a service that externalizes those infrastructure costs, allowing developers to focus on what they actually want to build.
However, this is not the right answer for every agent project. Self-hosting via the Agent SDK is more suitable for domains with strict data regulations, multi-model orchestration, and tasks requiring GPUs. Checking regulatory requirements and cost structures before selecting a technology is the fastest way to minimize trial and error.
Recommended order before starting:
- Determine Method After Reviewing Cost and Data Policies — First, verify the sensitivity of the data to be processed and compliance requirements. It is also recommended to estimate the monthly budget at this stage, combining runtime costs ($0.08/hour) and token costs. This assessment determines whether to choose Managed Agents or the Agent SDK.
- SDK Installation and Basic Example Run — After installing with
pip install claude-agent-sdk(Python) orpnpm add @anthropic-ai/claude-agent-sdk(TypeScript), it is recommended to run the Hello World example from the official Quickstart documentation. - Agentize a single repetitive task performed in actual work — Automating code reviews or generating weekly reports is suitable for the first experiment. At this stage, you can directly verify actual cost patterns and agent execution times.
Next Post: The Complete Guide to MCP (Model Context Protocol) — Practical Integration Methods for Connecting Slack, Notion, and Vector DB to the Claude Agent
Reference Materials
Official Document
- Claude Managed Agents Overview | Anthropic API Docs
- Get started with Claude Managed Agents — Quickstart | Anthropic
- Agent SDK Overview | Anthropic API Docs
Advanced Learning
- Scaling Managed Agents: Decoupling the Brain from the Hands | Anthropic Engineering Blog
- Claude Managed Agents: get to production 10x faster | Anthropic Blog
- Claude Managed Agents Deep Dive | DEV Community
- Claude Managed Agents: Hosted Infrastructure for Production AI Agents | Better Stack
Comparative Analysis
- Claude Agents SDK vs. OpenAI Agents SDK vs. Google ADK | Composition
- Claude Managed Agents: What It Actually Offers | Medium
News & Community Reactions
- Anthropic launches Claude Managed Agents | SiliconANGLE
- With Claude Managed Agents, Anthropic wants to run your AI agents for you | The New Stack