LEARNING AI PRODUCT MANAGEMENT

Claude Agent SDK and Managed Agents: What Every AI PM Needs to Know

By Institute of AI PM·14 min read·Aug 2, 2026

TL;DR

Anthropic shipped two ways to run production agents in 2026: the Claude Agent SDK (a Python and TypeScript library you run on your own infrastructure) and Managed Agents (a hosted REST API where Anthropic runs the harness for you). Product managers now face a genuine build-vs-host decision with real tradeoffs across data residency, engineering bandwidth, cost, and time-to-production. This guide explains what each option is, when to choose it, and what changes in your product architecture when you do.

The AI PM Minute

One tactic to make you a sharper AI PM, twice a week. 60 seconds to read. Free.

No fluff. Unsubscribe anytime.

What the Claude Agent SDK Is

The Claude Agent SDK is a Python and TypeScript library that lets you run the same agent loop that powers Claude Code inside your own application, on your own infrastructure. Think of it as the engine behind Claude Code extracted into a library you can embed in any product. You install it from PyPI or npm, configure your Claude API key, and control every aspect of how the agent executes.

This is meaningfully different from calling the Claude API directly. The SDK handles the agent loop: calling Claude, processing tool results, managing context across turns, spawning subagents, and maintaining session state. What used to require hundreds of lines of custom orchestration code now has an opinionated library backing it.

1

Self-hosted execution

You run the harness on your servers or cloud account. Your infrastructure, your operational responsibility, your control over where data lives and how much compute you allocate.

2

Subagent orchestration

The SDK supports multi-agent patterns where a parent agent spawns and coordinates child agents. You define the task decomposition graph; the SDK handles the execution bookkeeping across agents.

3

Session management

Agent sessions persist across turns with structured state. The SDK manages context continuity so you don't build a custom session layer from scratch.

4

MCP integration

Ships with Model Context Protocol support built in, so agents can connect to external tools and data sources using the same standard that has emerged across the industry in 2026.

5

Bundled CLI binary

A CLI for running agents from the command line. Useful for engineering workflows, internal tooling, and any use case that doesn't need a UI layer.

Pricing for the SDK is consumption-based: Claude API token rates for model calls, plus whatever your cloud provider charges for the compute running the SDK. Starting in June 2026, Anthropic began drawing Claude Agent SDK usage against a separate monthly credit pool on subscription plans, separate from regular API usage. Budget the two pools independently.

Claude Managed Agents: Anthropic Runs the Infrastructure

Managed Agents is a hosted REST API where Anthropic runs the agent harness, sandbox, and session log on its own infrastructure. Your application sends events and receives results. You do not manage compute, session state, or the sandboxing environment yourself.

Launched at Code with Claude 2026 in April, the product was framed by Anthropic's team around a specific argument: infrastructure, not intelligence, has become the bottleneck for shipping production agents. Stitching together a sandboxed execution environment, session state layer, tool execution harness, and orchestration logic takes most teams months. Managed Agents offloads that entirely.

Sandboxing

Each agent run executes in an isolated sandbox managed by Anthropic. You don't design or maintain the isolation boundary. Particularly valuable for agents that execute code or interact with external systems.

Session log

Full audit trail of agent execution stored by Anthropic. Useful for debugging and for compliance use cases that require a durable execution record without you building a storage layer.

State management

Session state persists across turns without a custom storage layer on your side. Anthropic handles context continuity at the infrastructure level.

Tool execution

Agents call your tools via webhooks. The managed infrastructure handles the calling, retry logic, and response handling inside the sandbox.

The Managed Agents pricing model adds an infrastructure margin on top of token costs to cover sandboxing, session state storage, and tool execution overhead. For most teams, that premium is cheaper than the engineering time required to build equivalent infrastructure in-house. The math is most favorable at teams smaller than five engineers or at early-stage products where time-to-production matters more than cost-per-agent-run.

The Build Decision: SDK vs Managed Agents

Anthropic's own published guidance is to prototype with the SDK and graduate to Managed Agents for production. That recommendation is sound for many teams. But the decision has enough nuance that product managers should work through it explicitly rather than deferring it entirely to engineering.

Choose the SDK when

  • Data residency requirements prevent sending session state to Anthropic's infrastructure
  • You need a custom tool authentication flow the managed API doesn't support out of the box
  • Your cost model requires tight per-agent compute control that the managed infrastructure margin doesn't allow
  • You're building on top of the SDK to offer agent infrastructure as a feature of your own product
  • Your compliance framework requires you to control the full execution environment

Choose Managed Agents when

  • You want to ship production agents in weeks rather than months
  • Your engineering team doesn't have experience managing sandboxed execution environments
  • You need a durable session log without building your own audit trail storage layer
  • You're at a startup where infrastructure team size limits what you can operate sustainably
  • The infrastructure margin is less expensive than the engineering cost to build equivalent capability

Compliance note for regulated industries

If your product operates in healthcare, financial services, or government with strict data handling requirements, validate Anthropic's data processing agreements and sub-processor list before committing to Managed Agents. Session content passes through Anthropic's infrastructure. The SDK keeps the full execution path on your own systems. Get legal sign-off early, not after you have shipped.

Ship AI Agents with Confidence

The AI PM Masterclass covers agent architecture decisions, infrastructure tradeoffs, and how to write specs for agentic products that engineering can actually build. Taught live by a Salesforce Sr. Director PM.

What This Changes in Your Product Architecture

Whether you use the SDK or Managed Agents, adopting either option forces product decisions that belong in your PRD, not buried in engineering implementation. Here are the five decisions that are now explicitly yours to make.

Session scope and lifetime

How long does an agent session persist? What triggers a new session vs continuing an existing one? This affects state design, cost per user, and what data accumulates over time. Define it in your spec before the first sprint.

Subagent boundaries

Which tasks does the orchestrating agent hand off to child agents? Each handoff boundary is a latency budget and a potential failure mode. Design the orchestration graph before engineering touches code.

Tool surface area

Every tool you expose to the agent is an attack surface and a cost driver. Define the minimum tool set required to accomplish the task, then require explicit justification for each addition.

Failure and escalation paths

What happens when an agent can't complete its task? Who or what does it escalate to? How does the user know something failed? This is a PM decision, not an engineering implementation detail.

Audit trail requirements

For compliance use cases, you need a durable record of what the agent did and why. Decide whether Anthropic's Managed Agents session log satisfies your requirements, or whether you need supplementary logging on top.

Pricing, Credits, and What to Do Next

Agentic tasks consume tokens non-linearly. A multi-step research agent running 20 tool calls can consume 40 to 50 times the tokens of a standard chat completion. Build cost visibility into your PRD from day one, not retroactively after you see the first production bill.

SDK token costs

Standard Claude API rates apply for model calls. Infrastructure costs (compute, memory, storage) are billed by your cloud provider separately. You control both levers.

Managed Agents cost structure

Token costs plus an infrastructure margin. The margin covers sandboxing, session state, and tool execution overhead. Higher per-run cost than self-hosting, but eliminates infrastructure engineering and operational burden.

Separate credit pools (June 2026)

From June 2026, Claude Agent SDK and Managed Agents usage draw from a dedicated credit pool on Anthropic subscription plans, separate from standard API usage. Monitor both pools. Overruns on one do not block the other.

Cost alerting is non-negotiable

One runaway agent in a test environment can consume a week's API budget in hours. Set hard spending limits on both the API side and your cloud account before the first production deploy.

Five things to do in the next two weeks if your team is evaluating or actively building with either option:

1

Audit existing custom agent infrastructure

If your team built their own session management or orchestration layer in the past 12 months, quantify the maintenance cost. That number is what Managed Agents' infrastructure margin competes against.

2

Run a data residency check

Before writing agent code against Managed Agents, confirm whether your compliance requirements allow Anthropic to process session content. Get legal sign-off before you commit to the stack.

3

Define your session lifecycle in the next sprint spec

Agent session scope is not an implementation detail. Draft the session lifecycle diagram yourself before handing the spec to engineering.

4

Set spend limits before the first production deploy

Configure hard API spend limits and cloud budget alerts. Agentic workloads spike unexpectedly. Find out in a staging environment, not in production.

5

Read the Managed Agents data processing addendum

If your product handles personal data, the DPA determines whether you can use Managed Agents at all in regulated jurisdictions. This is a discovery task for you, not just for legal.

Build Agent Products That Actually Ship

The AI PM Masterclass covers agentic product design, infrastructure decisions, and how to write specs that engineering can execute. Taught live by a Salesforce Sr. Director PM with real production agent experience.

Before you go: get the AI PM Minute

One tactic to make you a sharper AI PM, twice a week. 60 seconds to read. Free.

No fluff. Unsubscribe anytime.