Managed Agents vs LangGraph vs Rolling Your Own: Who Should Run Your Agent Loop in 2026

The Fable 5 Moment
31 parts- 1Claude Mythos 5 Explained: What It Is, Who Can Access It, and Why It's Gated
- 2Migrating to Claude Fable 5: The Practical Guide
- 3Claude Fable 5 Access After the June 22 Deadline: Where Things Stand
- 4Claude Fable 5 vs GPT-5.6 Sol: Benchmarks, Pricing, and When Each Wins
- 5Fable 5 vs Opus 4.8: A Data-Driven Decision Guide for Engineering Teams
- 6How to Model Fable 5 Costs Before They Blow Up Your Budget
- 7Claude Fable 5 API: Production Integration Patterns, Rate Limits, and Migration Gotchas
- 8Handling Fable 5 Refusals: A Working Guide to the Fallback API
- 9Why Fable 5 Refuses Your Cybersecurity Queries (And How the Fallback Works)
- 10Fable 5's Hidden Guardrails: What Developers Need to Know About Silent Degradation
- 11Fable 5 Broke Enterprise ZDR Agreements: What Dev Teams Must Do Now
- 12Claude Managed Agents: Dreaming, Outcomes, and Multi-Agent Orchestration Explained
- 13Claude Managed Agents Public Beta: What's Actually Available vs What's Gated
- 14Dario Amodei Wants FAA-Style AI Regulation: Open Questions for Developers
- 15The Exponential and the Working Developer: Sitting With Amodei's Hardest Questions
- 16The Dario Paradox: Warning About the Exponential While Shipping It
- 17The Pushback on Amodei's Exponential Essay: Too Slow, Too Convenient, or About Right?
- 18Fable 5 Before June 22: The Decision Checklist for Every Plan Tier
- 19Fable 5 on AWS Bedrock: When Your Data Leaves the AWS Boundary
- 20Why Claude Desktop Installs a 1.8 GB Hyper-V VM on Windows
- 21Anthropic Model Names Explained: Fable, Mythos, Opus, Sonnet
- 22Managed Agents vs LangGraph vs Rolling Your Own: Who Should Run Your Agent Loop in 2026Current
- 23Claude Usage Limits With Fable 5: Windows and Burn Rates
- 24Fable 5 for Government and Regulated Teams: The GovCloud Question
- 25Fable 5 vs DeepSeek V4: The Cost-Quality Gap Measured in Real Tasks
- 26Fable 5 Orchestrator Playbook: Smart Model, Cheap Workers
- 27Prompt Caching Economics on Fable 5: When the 5-Minute TTL Pays
- 28Fable 5 with 1M Context: What Actually Works in Practice
- 29Claude Effort Levels Explained: Fable 5, Opus 5.5, Haiku 5.5
- 30Fable 5 Effort Levels vs Switching Models: When to Dial and When to Change
- 31Recursive Self-Improvement: What Fable 5, Dario's Essay, and Anthropic's Own Data Actually Tell Us
TL;DR
Managed agents vs LangGraph vs a DIY while-loop - compare state, sandboxing, cost, lock-in and compliance to decide who should run your agent loop in 2026.
The framework comparison era is not over, but the question has shifted. A year ago developers were asking "should I use CrewAI or LangGraph?" - a question our agent frameworks comparison covers in depth. Today the more important question is: who owns the loop? Your code, a managed runtime on the provider's servers, or a self-hosted graph engine on your own infrastructure?
This post skips the framework beauty contest and focuses on the architectural choice that determines your operational costs, data residency posture, debugging surface area, and long-term portability. We have looked at what the three dominant paths actually offer in mid-2026: provider-managed agent runtimes (Anthropic's Claude agents API and OpenAI's Agents SDK with hosted tools), LangGraph with LangSmith deployment, and plain API calls in a loop you own completely.
Last updated: July 27, 2026
The three paths, plainly stated#
Path 1: Provider-managed runtime. You describe an agent - its system prompt, tool set, and behavior - and the provider runs the execution loop on their infrastructure. Anthropic's Claude agents API lets you create a persistent agent configuration and reference it by ID. OpenAI's Agents SDK (the successor to Assistants) provides a similar model: define an agent with tools, and the SDK's Runner handles the while-loop, tool dispatch, and state accumulation across turns. In both cases, some or all of the execution graph lives server-side.
Path 2: LangGraph, self-hosted. You define your agent as a directed graph of nodes and edges in Python or JavaScript. LangGraph compiles it into a runtime that handles persistence, interrupts, and streaming. You run the graph on your own infrastructure or via LangSmith Deployment (LangChain's managed deployment layer). The execution model is explicit: a StateGraph with typed state, add nodes for each step, define edges (including conditional ones), compile, invoke. Checkpointing against a database backend means runs survive process restarts.
Path 3: Plain API + a while-loop. No SDK orchestration. You call the model API, inspect the response for tool calls, execute the tools yourself, append results to the message list, and loop until the model stops requesting tools. This is structurally what every framework above does internally. The question is whether the framework earns its abstraction cost.
State and persistence#
Provider-managed runtimes handle conversation state server-side. OpenAI's Responses API maintains a thread context; you pass a previous_response_id and the server reconstructs context. Anthropic's agents API (where supported) persists session state between calls. The upside: you do not manage state in your application. The downside: the state lives somewhere you cannot directly inspect, migrate, or replay.
LangGraph's checkpointing is explicit and yours. You wire in a MemorySaver, a Postgres backend, or a custom store. Every graph node's state snapshot is persisted after execution. If a run fails at node 7 of 12, you can resume from node 6's checkpoint. You can inspect the state as JSON at any point. For workflows that run for minutes or hours - code review pipelines, research agents, deployment orchestrators - this is not optional infrastructure, it is the whole point.
The DIY path forces you to implement persistence yourself. For simple request-response agents (the user asks, the agent uses a tool or two, returns an answer), this is trivial: keep the message list in memory or serialize it to Redis. For long-horizon agents, you will rebuild a worse version of LangGraph's checkpointing.
Verdict: if you need durable multi-step execution that survives failures, use LangGraph. If you need simple session continuity across API calls, provider-managed works. If your agent is stateless per-request, DIY is fine.
Sandboxing and tool execution#
This is where the managed path has a real advantage that is underappreciated. OpenAI's Agents SDK includes sandboxed execution environments for code interpreter and shell tools - the model's tool calls run inside an isolated container that OpenAI provisions and tears down. You do not need to worry about credential isolation, process isolation, or resource limits for those specific tools.
Anthropic's MCP support means tool servers can be external - you define MCP endpoints and the agent calls them, but the actual tool execution happens on your MCP server, not inside Anthropic's infrastructure. This is a notable distinction: it gives you control over what runs where, but you take on the sandboxing responsibility.
LangGraph is agnostic. Tools are Python functions you define. You handle sandboxing by wrapping tool calls in whatever isolation layer you choose - Docker, subprocess, a remote HTTP service, a cloud function. This is maximally flexible and maximally your responsibility.
DIY is identical to LangGraph here: tools are your code, running in your process or wherever you dispatch them.
Cost model#
The costs look different depending on how you account for them.
Provider-managed runtimes bill you for tokens. You pay model rates. But state storage, context management, and session threading may have additional costs depending on the provider's pricing tier. The more important hidden cost is context: managed runtimes that reconstruct full conversation history on every turn can accumulate large context windows fast, and you pay for every input token on every call. Prompt caching helps but does not eliminate this.
LangGraph itself is open source and free. LangSmith Deployment (the hosted version) has a paid tier. The bigger cost is operational: you need to run the graph somewhere. A container service or serverless function running LangGraph is an infrastructure cost you own. Against that, you have full control over context trimming, so you can aggressively prune state and reduce token costs.
DIY is cheapest if your use case is simple. No framework overhead, no hosting cost beyond the API calls. But simple agent tasks rarely stay simple, and the cost you avoid paying LangSmith you often pay in engineering time.
Vendor lock-in#
This is the uncomfortable part of the managed runtime pitch. An agent config stored server-side at Anthropic is not portable. If Anthropic changes pricing, deprecates the API surface, or you need to run the same agent against a different model, you are migrating. Notably, Anthropic's managed agent features are not available via AWS Bedrock or Google Vertex AI - so if your compliance requirements mandate that inference runs in your cloud account, provider-managed is not an option today.
OpenAI's Agents SDK is an open-source library (MIT licensed), but the hosted tools - file search, code interpreter, web search - depend on OpenAI's infrastructure. You can use the SDK's orchestration with any OpenAI-compatible model endpoint, but to use the hosted sandboxed tools, you need OpenAI's platform specifically.
LangGraph is Apache 2.0 licensed. The graph definition, checkpointing code, and execution runtime are yours. You can run against any LLM, swap backends, and deploy anywhere. Lock-in is limited to the LangGraph API surface itself, which is stable and widely understood.
DIY has zero lock-in by definition. Your while-loop calls whatever model API you point it at.
Debugging and observability#
Managed runtimes offer varying levels of visibility. OpenAI's platform has a dashboard for viewing thread history and tool call results. But the internal execution state at each step - what the model saw, exactly what it decided, how context was trimmed - is opaque. When something goes wrong at step 8 of a 12-step reasoning chain, you have limited tools to replay and inspect.
LangGraph paired with LangSmith gives you trace-level visibility into every node transition, state snapshot, and LLM call. LangSmith's execution graph viewer shows the step-by-step path through your graph, including which edges were taken on conditional branches. This is the strongest debugging story in the space right now.
DIY debugging is whatever you build. Console logging, OpenTelemetry, a custom trace format. It is not zero effort, and it is rarely as good as a purpose-built tool, but it is also not dependent on a vendor's dashboard working correctly.
Compliance and data residency#
If your data must stay within a specific geographic region or cloud provider account, provider-managed runtimes require careful evaluation. As of mid-2026, Anthropic's managed agent features run in Anthropic's infrastructure and are not accessible through Bedrock or Vertex integrations. If you need Claude on Bedrock for data residency reasons, you need to run your own orchestration loop.
LangGraph and DIY give you full control: run inference in whatever cloud region your compliance requires, using the model endpoint that meets your data processing agreements.
The decision in prose#
Start by asking three questions:
Are you prototyping or shipping something with compliance requirements? If you are prototyping and speed matters, the managed path gets you running fastest. For anything with real data, work through the residency question first.
Does your agent run for longer than one API call's context window? If yes, you need durable checkpointing. The managed runtimes handle some of this server-side, but with limited inspectability. LangGraph's explicit checkpointing is better for workflows that span minutes or need to survive failures. DIY checkpointing works but you are writing it from scratch.
Do you have more than three conditional branching points in your execution logic? If yes, LangGraph's graph model makes the logic legible and maintainable. A Python file with five nested if/else blocks calling the model API is not maintainable past a certain complexity threshold.
If none of those concerns apply - your agent is simple, stateless, request-response, no compliance constraints, no branching - then a while-loop with the Anthropic SDK or the OpenAI Responses API is the right answer. Add LangSmith tracing as a library call if you want observability without committing to the full graph model.
Comparison table#
| Dimension | Provider-managed | LangGraph (self-hosted) | DIY while-loop |
|---|---|---|---|
| State persistence | Server-side, opaque | Explicit, yours, inspectable | Build it yourself |
| Tool sandboxing | Platform-provided (OpenAI) or your MCP server (Anthropic) | Your responsibility | Your responsibility |
| Cost model | Token billing + potential storage fees | OSS free + infra you run | Token billing only |
| Vendor lock-in | High (especially for hosted tools) | Low (Apache 2.0) | None |
| Debugging | Dashboard, limited replay | LangSmith traces, full state history | Whatever you build |
| Data residency | Provider cloud only (no Bedrock/Vertex for Anthropic managed) | Any cloud or on-prem | Any cloud or on-prem |
| Setup time | Minutes | Hours to days | Minutes to hours |
| Maintenance burden | Low | Medium | Low to high (scales with complexity) |
| Best for | Rapid prototypes, simple tools, low compliance requirements | Complex branching, long-running workflows, regulated environments | Stateless agents, cost-sensitive workloads, full control |
FAQ#
What is a managed agent runtime and how is it different from an API call?#
A managed agent runtime runs the loop that drives your agent - the sequence of model call, tool execution, state update, and next model call - on the provider's servers. You define the agent configuration; the platform handles the iteration. A plain API call is a single turn: you send a prompt, get a response. With a managed runtime, you hand off control of the loop. With a plain API call, your code is the loop.
Can I use LangGraph with Claude or GPT-5?#
Yes. LangGraph is model-agnostic. It orchestrates your graph and delegates actual LLM calls to whatever client you configure. You can use LangChain's Anthropic integration, the anthropic SDK directly, or any OpenAI-compatible endpoint. The graph runtime does not care which model runs inside it.
Do I need LangSmith to use LangGraph?#
No. LangGraph runs without LangSmith. LangSmith adds tracing, evaluation, and the deployment layer. For local development and small-scale production without tracing requirements, LangGraph standalone works fine. LangSmith becomes valuable when you need to debug production failures or evaluate agent quality at scale.
What happens to Anthropic managed agents on AWS Bedrock?#
As of mid-2026, Anthropic's managed agent features (server-side sessions, persistent agent configs) are not available through the Bedrock integration. Bedrock gives you access to Claude model inference, but you manage the orchestration loop yourself. If your organization routes all Anthropic API calls through Bedrock for compliance, you are effectively using the DIY path regardless of what framework you layer on top.
When is a plain while-loop genuinely the right answer?#
When your agent does one thing: receives a user request, optionally calls a tool or two, and returns a response. Customer support classifiers, code explanation tools, document Q&A systems with retrieval - most of these do not need durable checkpointing, complex branching, or sandboxed execution. A 40-line Python function using the Anthropic or OpenAI SDK directly is faster to build, easier to test, and cheaper to run than spinning up LangGraph with a checkpointing backend. Do not add framework complexity before you need it.
Official Sources#
All links verified July 27, 2026.
| Source | Link | What it covers |
|---|---|---|
| LangGraph documentation | https://docs.langchain.com/oss/python/langgraph/overview | Graph runtime, checkpointing, StateGraph API |
| LangSmith deployment guide | https://docs.langchain.com/langsmith/deployment | Managed deployment layer, tracing, evaluation |
| OpenAI Agents SDK guide | https://developers.openai.com/api/docs/guides/agents | Agent definition, Runner, tool dispatch |
| OpenAI Agents SDK sandboxes | https://developers.openai.com/api/docs/guides/agents/sandboxes | Sandboxed execution for code interpreter and shell tools |
| Anthropic agents and tools docs | https://docs.anthropic.com/en/docs/agents-and-tools/ | Claude agents API, MCP support, session management |
| LangChain products overview | https://docs.langchain.com/oss/python/concepts/products | Framework vs runtime vs harness distinctions |
Continue Reading#
- Claude Managed Agents in a Chrome Extension: ai-newtab Teardown - a client-side Managed Agents session, its cost claim and its security gaps
- Claude Agent SDK vs Claude Code: When to Build and When to Drive
- Claude Agent SDK vs LangGraph: Choosing Your Agent Stack in 2026
- Anthropic Claude Tag Turns Slack Into a Shared Agent Workspace
Get the next comparison like this in your inbox
One email a week on ai-agents and the rest of the AI dev stack. Free.
Read next on Claude Code
Migrating to Claude Fable 5: The Practical Guide
Migrating to Claude Fable 5 from Opus 4.8 or older models - every breaking change, what to delete from your code, and the prompt audit to run before switching.
9 min readClaude Fable 5 API: Production Integration Patterns, Rate Limits, and Migration Gotchas
Claude Fable 5 API production guide - adaptive thinking, rate limit strategy, streaming latency, fallback chains and a migration checklist from Opus 4.8.
9 min readFable 5 vs Opus 4.8: A Data-Driven Decision Guide for Engineering Teams
Fable 5 posts an 80.3% SWE-Bench Pro score and costs 2x Opus 4.8 - here is the task-profile scoring guide that tells you when the premium pays off.
7 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.








