# Four Ways to Build an AI Agent in 2026

Source: https://www.omnara.com/guides/agent-framework-vs-harness-vs-runtime
Author: Kartik Sarangmath
Published: 2026-10-06

Vendors use the same words for different things. LangChain calls LangGraph a runtime. Microsoft calls Copilot Studio's agent loop a harness. OpenAI's Agents SDK is a framework, but Anthropic's Claude Agent SDK is a harness.

I group the options into four ways to build an agent. They differ in how much of the agent you write yourself and how much someone else runs for you. This guide covers what each one is, when to use it, where it stops working, and the main options as of October 2026.

## The Short Version

| If you want | Use | Like |
| --- | --- | --- |
| A mostly fixed business process with a few AI decisions, owned by non-engineers | A [workflow builder](#workflow-builders) | n8n, Zapier, Make |
| Full control over every step of an agent inside your own app | A [framework](#agent-frameworks), with [durable execution](#runtimes-and-managed-agent-platforms) if runs have to survive crashes | LangGraph, OpenAI Agents SDK, Vercel AI SDK, Mastra, with Temporal or Inngest |
| An agent that works with files, code, and a shell, without building the loop | A [harness](#agent-harnesses) | Claude Agent SDK, Codex, OpenCode, Pi |
| Agents in production for many users, with sessions, sandboxes, and permissions handled | A [managed agent platform](#runtimes-and-managed-agent-platforms) | Claude Managed Agents, OpenAI's Agents API, AgentCore, Omnara |

Most production systems end up using more than one. That's covered [at the end](#how-they-fit-together).

## Workflow Builders

A workflow builder is a canvas where you wire steps together: a trigger, some API calls, an AI step, an email. In most builders, that AI step is now a real agent loop. n8n's [AI Agent node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/) lets the model decide which tools to call, and so does [AI by Zapier](https://zapier.com/blog/zapier-agents-is-now-ai-by-zapier/), which replaced Zapier Agents this month.

Use one when the process is mostly fixed and the model makes a few decisions inside it, like routing a support ticket or summarizing a lead before it goes into the CRM. They're also the right call when the people who own the process aren't engineers, or when you need hundreds of app integrations on day one.

They get harder as the agent gets bigger. Large flows get hard to follow and review, and [Git sync in n8n](https://docs.n8n.io/source-control-environments/) is only on the Business and Enterprise plans. Pricing per task, like Zapier's, adds up when an agent loops through dozens of tool calls. If agents run for hours or wait on approvals, check how many runs can be active at once and what happens to a waiting run after a crash.

Check that a builder will be around before you commit to it. Flowise [shut down in August](https://github.com/FlowiseAI/Flowise/discussions/6727), and its team said developers were moving to coding agents. OpenAI is [shutting down Agent Builder](https://developers.openai.com/api/docs/deprecations) on November 30, 2026, and pointing people to its Agents SDK. The bigger builders are turning their workflows into tools that agents can call over MCP.

The main options:

- **[n8n](https://n8n.io).** Self-hostable under its own fair-code license, with an agent node built on LangChain.
- **[Zapier](https://zapier.com).** Thousands of app integrations, cloud only. Agents now live inside a single AI step in a Zap.
- **[Make](https://www.make.com).** A visual scenario builder. Its new agents app is still in open beta.
- **[Microsoft Copilot Studio](https://learn.microsoft.com/en-us/microsoft-copilot-studio/).** Microsoft's low-code agent builder, built into Microsoft 365.
- **[Dify](https://github.com/langgenius/dify).** Self-hostable under a [modified Apache license](https://github.com/langgenius/dify/blob/main/LICENSE) that limits multi-tenant use, with an agent node and its own sandboxed agent.

## Agent Frameworks

A framework is a library you write the agent with. You define the tools and the logic around them, and it gives you model calls, memory, multi-agent patterns, and usually a basic loop you can change or replace.

Use one when the agent is part of your product and you need control: which tools and context the model sees on each step, mixing fixed steps with agent steps, low latency, or any model you want.

The common complaint is that frameworks hide the prompts and make agents harder to debug. Anthropic's [advice](https://www.anthropic.com/engineering/building-effective-agents) is still to start with the model API directly and add a framework only when you need one. Before you adopt one, check that you can see the exact prompts it sends, swap out its defaults, and upgrade it without rewriting your app.

Frameworks are also turning into harnesses. LangChain describes its `create_agent` as ["a minimal, highly configurable agent harness"](https://docs.langchain.com/oss/python/langchain/overview). [Pydantic AI 2.0](https://github.com/pydantic/pydantic-ai/releases/tag/v2.0.0) and [AWS Strands](https://strandsagents.com/blog/introducing-strands-harness/) now lead with a ready-made agent. [Vercel's AI SDK 7](https://vercel.com/blog/ai-sdk-7) can run Claude Code, Codex, OpenCode, or Pi directly inside your app.

The main options:

- **[LangChain and LangGraph](https://docs.langchain.com/oss/python/langgraph/overview).** Python and TypeScript. LangGraph handles state and resuming.
- **[OpenAI Agents SDK](https://openai.github.io/openai-agents-python/).** Python and TypeScript. Built around OpenAI's models, but works with others.
- **[Vercel AI SDK](https://ai-sdk.dev).** A TypeScript toolkit for model calls and agents. Works with any model provider.
- **[Mastra](https://mastra.ai).** TypeScript, with workflows, memory, and evals built in.
- **[Pydantic AI](https://github.com/pydantic/pydantic-ai).** Typed Python, and works with several durable execution engines.
- **[Google ADK](https://adk.dev).** Works best with Gemini, with versions for Python, TypeScript, Go, Java, and Kotlin.
- **[Microsoft Agent Framework](https://learn.microsoft.com/en-us/agent-framework/overview/agent-framework-overview).** The successor to Semantic Kernel and AutoGen, for Python and .NET.
- **[CrewAI](https://github.com/crewAIInc/crewAI).** Python, built around teams of agents with roles, plus event-driven flows.

## Agent Harnesses

A harness is a ready-made agent loop. It calls the model, runs tools like the shell and file edits, compacts the conversation when it gets long, and keeps going until the task is done. You customize it mainly through the system prompt and the tools. Claude Code without the terminal UI is a harness. I wrote more about [what a harness is and why it matters less than people think](https://www.omnara.com/blog/the-harness-doesnt-matter).

Use one when the task looks like using a computer: writing code, researching, editing files, running commands. You get a working agent without writing the loop, compaction, or subagents yourself.

Harnesses start out built for one person on one machine. To serve many users, you add session storage, isolation, and recovery around them. The [Claude Agent SDK](https://code.claude.com/docs/en/agent-sdk/hosting), for example, starts a separate CLI process for every session and saves sessions as local files by default. You can mirror them to external storage, but files on the machine need their own backup, a permission prompt isn't a sandbox, and a turn interrupted by a crash needs recovery logic. Open harnesses can run on a durable execution engine step by step, the way Deep Agents runs on LangGraph. The Claude Agent SDK is closed, so it resumes from its saved session instead, and a step cut off by a crash may run again. Model support varies too. The Claude Agent SDK only runs Claude, while Codex, OpenCode, and Pi can use other providers.

The main options:

- **[Claude Code and the Claude Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview).** Anthropic's harness, as a CLI and as a library. Claude models only.
- **[Codex](https://github.com/openai/codex).** OpenAI's open-source harness, with strong compaction on long tasks. Built for OpenAI's API, and also runs local models through Ollama or LM Studio.
- **[OpenCode](https://opencode.ai).** Open source and works with any model. Runs as a server that different interfaces connect to.
- **[Pi](https://pi.dev).** Small and open source, with a short system prompt and few built-in tools. Works with any model.
- **[Deep Agents](https://github.com/langchain-ai/deepagents).** LangChain's harness, built to be used as a Python or TypeScript library with any model.
- **[Hermes Agent](https://github.com/NousResearch/hermes-agent).** Nous Research's open-source personal agent, with a gateway for messaging apps.
- **[GitHub Copilot SDK](https://docs.github.com/en/copilot/how-tos/copilot-sdk/features/agent-loop).** Lets your app drive the Copilot CLI's agent loop.
- **[Gemini CLI](https://github.com/google-gemini/gemini-cli).** Google's open-source harness, now for paid API and enterprise users. Google [moved its consumer users](https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/) to the closed-source Antigravity CLI in June.

## Runtimes and Managed Agent Platforms

"Runtime" means two different things, and it helps to separate them.

The first is a **durable execution engine**: [LangGraph](https://docs.langchain.com/oss/python/langgraph/durable-execution), [Temporal](https://temporal.io), [Inngest](https://www.inngest.com), [Restate](https://restate.dev), or [DBOS](https://www.dbos.dev). It saves progress at the steps you define, so a run can pick up where it left off after a crash. This is what LangChain means by ["agent runtimes"](https://docs.langchain.com/oss/python/concepts/products). You still bring the agent and the machines it runs on.

The second is a **managed agent platform**. It runs agents for you behind an API, with sessions, sandboxes, tools, and access control. Some supply the agent loop, so you send a config and a message. Others host agent code you bring, built with any framework.

They solve different problems. A hosted session doesn't make your own loop resumable, and Temporal doesn't give you a sandbox.

Use a managed platform when agents serve many users, run for a long time, wait on people, or run untrusted code, and you'd rather a vendor ran those pieces. Self-hosting still makes sense when you already have the infrastructure or need more control.

The hardest piece to build yourself is usually the session history. Anthropic [keeps a log of everything that happened](https://www.anthropic.com/engineering/managed-agents) outside the harness, so the harness and the sandbox can fail and get replaced without losing the agent. Omnara works the same way. If you run a harness yourself, you'll need something like that log.

Whichever you pick, test two things before launch. First, kill the worker right after a tool changes something outside the agent, like sending an email or opening a pull request. A retry can run that action again, so tools that change things need to be [safe to repeat](https://docs.langchain.com/oss/python/langgraph/functional-api#idempotency). With a durable engine, give each of those actions its own step, so a retry doesn't redo the ones that already succeeded. Second, check what survives a restart: the conversation, the files on the machine, and any running processes are saved separately, and a platform that keeps the conversation can still lose the machine.

The main options:

- **[Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview).** Anthropic's, in beta. Claude models only.
- **[OpenAI's Agents API](https://developers.openai.com/api/docs/guides/agents-api/overview).** The Codex harness run by OpenAI, in beta. OpenAI models only.
- **[Managed Agents in the Gemini API](https://ai.google.dev/gemini-api/docs/antigravity-agent).** Google's Antigravity harness, in preview. Gemini models only.
- **[LangChain Managed Deep Agents](https://docs.langchain.com/langsmith/python/managed-deep-agents-overview).** Deep Agents hosted on LangSmith, in beta.
- **[DigitalOcean Managed Agents](https://docs.digitalocean.com/products/managed-agents/).** Lets you pick the harness, including Claude Code, Codex, and OpenCode. In preview, for non-production workloads only.
- **[Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/).** Hosts agent code from any framework with any model, or [runs a loop for you](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-vs-runtime.html) built on Strands. Generally available.
- **[Microsoft Foundry Agent Service](https://learn.microsoft.com/en-us/azure/foundry/agents/overview).** Runs prompt agents and your own containers on Azure. Generally available.
- **[Google Agent Runtime](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime).** Hosts agents built with ADK, LangGraph, CrewAI, or anything you can put in a container, on Google Cloud.
- **[Omnara](https://github.com/omnara-ai/omnara).** Open source, with [its own agent loop](https://docs.omnara.com/concepts) that works with any model and any machine, hosted or self-hosted.

I compared these platforms in more detail in [Claude Managed Agents alternatives](https://www.omnara.com/guides/claude-managed-agents-alternatives).

## How They Fit Together

Most real systems use two or three of these:

- **A workflow around an agent.** The process stays fixed, and the model only decides at specific steps. This is a common production setup, and it's what Anthropic means by [workflows versus agents](https://www.anthropic.com/engineering/building-effective-agents). Stripe's coding agents [work this way](https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents-part-2): a customized fork of the Goose harness implements the change on an isolated dev machine, and fixed steps in code run the linters and push the result.
- **Workflows as tools for agents.** n8n, Zapier, and Make can expose workflows over MCP, so an agent can call "create the invoice" without knowing the steps inside it.
- **A framework agent on a platform.** [AgentCore](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html) and [Foundry](https://learn.microsoft.com/en-us/azure/foundry/agents/overview) run agents built with LangGraph, the OpenAI Agents SDK, Strands, and others.
- **A framework agent inside a durable engine.** With [Temporal and the OpenAI Agents SDK](https://temporal.io/blog/announcing-openai-agents-sdk-integration), each model and tool call is a recorded step that survives a crash.
- **A harness on a platform.** OpenAI's Agents API runs Codex, and DigitalOcean's Managed Agents lets you pick Claude Code, Codex, or OpenCode.

## FAQ

### What's the difference between an agent framework and an agent harness?

A framework gives you building blocks, and you decide how the agent works. A harness is a complete agent someone already built, with tools, compaction, and subagents included, and you customize it with a system prompt and tools. The line is blurring, since most frameworks now ship a ready-made agent too.

### Is LangGraph a framework or a runtime?

Both. LangChain describes it as a framework and a runtime. The runtime part handles state, checkpoints, and resuming after a crash, and most people use the framework part to write their own agent as a graph. Deep Agents, LangChain's harness, is built on top of it.

### Claude Agent SDK vs Claude Managed Agents: which should I use?

With the Claude Agent SDK, you run the harness yourself, on your own machines, along with its sessions, sandboxes, and scaling. With Claude Managed Agents, Anthropic runs the harness and stores the sessions, and you can run the sandboxes on your own infrastructure. Use the SDK when you need to run the agent loop yourself, or need Zero Data Retention, which Managed Agents doesn't support. Use Managed Agents when you'd rather not operate it. Both only run Claude.

### Should I use n8n or LangGraph?

Use n8n when the process is mostly fixed, non-engineers need to change it, or you need its integrations. Use LangGraph when the agent is part of your product and you need code review, tests, and control over each step. Plenty of teams use both, with LangGraph agents calling n8n workflows as tools or n8n calling an agent for one step.

### How do I build an AI agent?

Start with one task and a few examples of a good result. Give the agent only the tools it needs, test what happens when a tool fails or someone rejects an approval, and then decide where it runs and how it saves progress. That last decision is where the four options above come in.

### Do I need a framework to build an AI agent?

No. An agent is a loop that calls a model and runs the tools it asks for, and you can write that against a model API directly. Use a harness if you want a working agent without writing the loop, and a framework if you want help with state, resuming, and multi-agent patterns.
