Home › Agent Harness › Agent frameworks

AI · Agent Harness

When to use an agent SDK or framework, and when to write the loop yourself

The loop is small: build the messages, call the model, run the tool, repeat. A framework does not sell you the loop. It sells you what surrounds it: keeping the context under control on long runs, surviving a restart, waiting days for a person, and replaying a run. So the choice is one question: do you need the surroundings?

Written 20 November 2026. The method is from our own framework research notes. Product facts were checked against public reports on that date, several of them secondary, and these products change fast. The last section says what to verify.

The mind map: six questions

Work round it in order. Most teams answer the first two and stop; the last four are where choices go wrong a year later.

Which SDK orframework?Do you need the surroundings?context that shrinks over a long runsurviving a restartwaiting days for a personreplaying a past runnone of these: plain loopWhat kind of agent?conversational, minutes: OpenAI Agents SDKlong-horizon, days: LangGraphautonomous worker: Claude Agent SDKshort and simple: plain loopWho owns durability already?a workflow engine or queue: plain loopnobody: a graph runtimethe cloud: its managed runtimenever two owners of restartsWhich models and cloud?one vendor: its SDKmany models: LangGraph, Google ADK, MicrosoftAzure: Microsoft Agent FrameworkGoogle Cloud: ADKAWS: Strands, AgentCoreWhat does leaving cost?keep state, traces, tool contracts yoursmanaged runtimes lock deepestmodel family is a business lockwrite the revisit triggerWho runs and maintains it?team language: .NET, Python, TypeScripthow fast the product renameswho gets the 3 a.m. pagepilot the task that breaks it

Five positions, not two

"No framework" and "framework" hide five different things. Most simple agents belong in position 1 or 2 and never need more.

1 · Plain loopYou write about 200 lines: build the messages, call the model, run the tool, repeat to a cap.You still own: Everything: control flow, context, budget, errors.
2 · Provider tool-runnerThe model vendor's own SDK runs the loop over tools you define, with hooks for approval and errors. No built-in tools.You still own: Context policy, durability, delegation.
3 · Harness SDKLoop plus context management, permissions, built-in tools and a sandbox. Example: the Claude Agent SDK.You still own: Process shape, and survival past one session.
4 · Graph runtimeLoop as a graph, with saved state, waits for a person and replay. Examples: LangGraph, Google ADK 2.0 workflows, Microsoft Agent Framework workflows.You still own: Context policy, autonomy, your own limits.
5 · Managed runtimeA cloud runs the agent and its operations for you. Examples: Foundry hosted agents, Bedrock AgentCore, Google's agent runtime.You still own: Very little. The exit cost is the highest here.

The options side by side

One row per option, with a verdict. Scroll sideways on a small screen.

OptionPositionWhat it gives youWhat you still ownModelsCloudExit costChoose it whenAvoid it whenVerdict
Plain loop (your own code)1Nothing you did not writeAll of itAnyAnyNone: it is yoursShort stateless runs (3 to 8 tool calls, under a minute); you are learning; another system already owns durability; your control flow is unusual and you can name what a framework forbids.Runs that last hours, wait for people, or must be replayed. You will end up writing a framework with one maintainer.Default for short, simple agents. Also right when you must own the stop rules.
Provider tool-runner (for example Anthropic's tool runner, OpenAI's chat tools)2The loop over your tools, with hooksContext, durability, delegation, everything elseOne vendor's models (some adapters exist)AnyDays: it is thinA simple agent that only needs tools and a few hooks, and you are happy with one model family.You need long runs, saved state or several model vendors.Often overlooked and often enough. Try it before a framework.
Claude Agent SDK3Loop, context compaction, permissions, hooks, sessions, built-in file and shell tools, sandboxing, MCPDurability past a session, identity, evaluation, cost limitsClaude models only (also via Bedrock and Vertex)Any; Claude is reachable from the big three cloudsWeeks; the model family is a business decisionAn autonomous worker that needs a computer: code, data, document or operations work where the path is not known in advance.A plain conversational service, or a case where you need another vendor's model.Pick it for autonomous workers on Claude. Keep state and traces yours.
OpenAI Agents SDK2 to 3Agents, handoffs between them, guardrails, tools, tracing, newer sandbox and sub-agent supportDurable state, human approval flows, identity, cost limitsBuilt around OpenAI's API; other models through adapters, check firstAny; hosted agent products are separate and deeper1 to 3 weeks for the SDK; months if you adopt the hosted runtimeA conversational service that routes to specialists: handoffs match the problem.Long-running work that must survive restarts or wait days for a decision.Pick it for conversational routing on OpenAI models.
LangGraph4Graph control flow, checkpointed state, waits for a person, replay, model-agnosticContext policy, sandboxing, safety rules, identityAny modelAny4 to 8 weeks to re-platform; run history stays in your databaseLong-horizon processes: reconciliations, migrations, multi-day approvals, where durability and human steps are the point.A short stateless agent: you carry weight you do not use. Past a week of waiting, pair it with a workflow engine.Pick it for long-running, auditable, multi-model work.
Microsoft Agent Framework (Azure)4Agents, graph workflows, multi-agent patterns, .NET and Python, successor to Semantic Kernel and AutoGen (1.0 reported April 2026); hosting in FoundryContext policy, evaluation, identity mapping, cost limitsMany models; strongest with Azure'sAzure first, not Azure onlyWeeks; deeper if you use Foundry hosted agentsYou are an Azure and .NET shop, or you already run Semantic Kernel or AutoGen and are migrating.You are not on Azure and have no .NET code: a lighter choice may cost less.Pick it on Azure, especially for .NET teams.
Google ADK (GCP)4Agent building blocks, graph workflows in version 2, Python, Go, TypeScript and Java, runs locally or on Google's managed agent runtimeContext policy, evaluation, identity mapping, cost limitsMany models; strongest with GeminiGoogle Cloud first, runs anywhereWeeks; deeper with the managed runtimeYou are on Google Cloud or use Gemini and want Google's runtime and protocols (such as A2A).Another cloud is the home of your data and identity.Pick it on Google Cloud. Note the platform was renamed in 2026: check current names.
AWS: Strands Agents and Bedrock AgentCore3 to 5Open-source agent SDK; AgentCore adds a managed runtime, gateway, memory and identityContext policy, evaluation, the loop's stop rules if you want them yoursMany models; strongest with BedrockAWS firstWeeks; months if you adopt the managed runtime fullyYou are on AWS and want the platform's identity, gateway and runtime.You need to own the loop's stop rules, or must stay portable across clouds.Pick on AWS if you accept the runtime lock; otherwise use it only for gateway and identity.
Managed agent products (Foundry hosted agents, Bedrock agents, Google's runtime)5Hosting, scaling, tracing, sometimes memory and identityVery littlePer productThat cloudHighest of allA small team, one cloud, no wish to operate infrastructure, and a use case the product fits.You need your own stop rules, portability or full trace ownership.Use for speed; plan the exit on day one.

A decision path in four steps

1 · Do you need the surroundings?Write what your agent does in plain sentences first. If runs are short and a crash means an acceptable retry, stop here: write the loop, or use the model vendor's tool-runner.
2 · Does something else own durability?If a workflow engine, a job scheduler or a queue already handles retries and restarts, keep the inner loop plain. Two systems that both think they own restarts will disagree at the worst moment.
3 · What shape is the work?Conversational and routing: handoff-style SDKs. Long-horizon with waits for people: a graph runtime. Autonomous and needs a computer: a harness SDK. Then let your cloud and model choice break ties.
4 · Can you leave?Whatever you pick, state, traces and tool contracts stay yours. Write down the trigger that would make you revisit, for example "runs exceed an hour" or "approvals enter the flow".

Six situations where a plain loop wins

Where we landed, and why

Our own agents keep the loop in-house and adopt the rest. The loop is a small piece of code whose limits (steps, repeat detection, cost) must sit where the whole run is visible, so we write it. Around it we adopt: a model gateway, a database for state, a library for durable waits, OpenTelemetry for traces. Frameworks are a supported choice on our stacks, but the stack files for a Claude Agent SDK stack and a LangGraph stack are still placeholders: we have not built agents on them, so we do not claim a verdict from experience. Our scores for each framework are a dated starting hypothesis, not a measurement.

How to run the choice

Check before you rely on this

Where to go next