<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc" -->

---
title: The Agent Harness: What It Is and Two Ways to Build One
description: An in-depth architectural comparison of two ways to build a production-ready AI agent harness: AWS AgentCore Harness (a fully managed Harness-as-a-Service)...
canonical: https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Agent Harness: What It Is and Two Ways to Build One | daily.dev
og:description: An in-depth architectural comparison of two ways to build a production-ready AI agent harness: AWS AgentCore Harness (a fully managed Harness-as-a-Service)...
og:url: https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc
og:image: https://api.daily.dev/og/posts/ZvQV3oDCc.png
og:image:alt: The Agent Harness: What It Is and Two Ways to Build One
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Agent Harness: What It Is and Two Ways to Build One

**[InfoQ](https://daily.dev/sources/infoq)** · 19 min read · 1 upvotes · 0 comments

## Summary

An in-depth architectural comparison of two ways to build a production-ready AI agent harness: AWS AgentCore Harness (a fully managed Harness-as-a-Service) versus a self-managed stack using LangChain with Agent Router (formerly Envoy AI Gateway) on Kubernetes. The piece defines the agent harness as everything built around a model to make it production-ready, split into a development half (memory, tools/MCP, retrieval, prompts) and an operations half (observability, cost control, model routing, guardrails, deployment). It builds the same finance assistant, FinBot, on both stacks, walking through model access, cost control, and observability implementations side by side, showing config-driven AgentCore calls against Kubernetes CRDs and OpenTelemetry instrumentation for the self-managed route. The conclusion frames the choice as a trade-off between control/portability and speed/simplicity, not a difference in underlying capability.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.infoq.com/articles/agent-harness-build-one>

## Questions this post answers

### What is the difference between AWS AgentCore Harness and a self-managed LangChain agent with Envoy AI Gateway for production AI agents?

Both provide the same underlying harness capabilities (model access, tools, memory, cost control, observability) but package them differently. AgentCore exposes these as managed config fields via CreateHarness/InvokeHarness calls with automatic tracing to CloudWatch, while the self-managed stack assembles LangChain, a Postgres checkpointer, MCP clients, and Envoy AI Gateway on Kubernetes, trading a vendor bill for infrastructure ownership and cloud portability.

_Teams weighing managed versus self-managed agent infrastructure can track real-world comparisons like this on daily.dev._

### How does AWS AgentCore Harness prevent runaway token costs in an AI agent?

AgentCore enforces per-invocation hard caps directly on the agent, including maxIterations (75 by default), maxTokens, and timeoutSeconds, configurable via the update-harness CLI command. It also tags invocations for cost allocation and reports token metrics to CloudWatch, stopping a runaway loop mid-invocation rather than just rejecting future requests.

_Engineers setting cost guardrails for AI agents can follow ongoing coverage of these controls on daily.dev._

### How do you get unified observability across model calls and tool calls in a self-managed LangChain agent behind Envoy AI Gateway?

Point both the gateway's ext_proc and the LangChain application (via OpenLIT or OpenTelemetry's LangChain instrumentation) at the same OTLP collector endpoint. The gateway emits gen_ai.* semantic-convention metrics like token usage and time-to-first-token for model calls on the request path, while app-level instrumentation captures tool calls and control flow that never leave the process, together forming one prompt-tool-response trace.

_Developers wiring up agent observability pipelines can keep up with these patterns on daily.dev._

## Similar posts on daily.dev

- [AWS AgentCore Harness: Building Agents on AWS Just Got Easier](https://daily.dev/posts/aws-agentcore-harness-building-agents-on-aws-just-got-easier-a1rsnys2u) · AWS Fundamentals · 0 upvotes · 0 comments
- [What the Heck Is an Agent Harness?](https://daily.dev/posts/what-the-heck-is-an-agent-harness--dyy0wl9dv) · Medium · 1 upvotes · 0 comments
- [A no-nonsense explainer to Agentic AI](https://daily.dev/posts/a-no-nonsense-explainer-to-agentic-ai-zu62mz1ox) · Tailscale · 3 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#langchain](https://daily.dev/tags/langchain), [#mcp](https://daily.dev/tags/mcp), [#observability](https://daily.dev/tags/observability)

[View this post on daily.dev](https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Agent Harness: What It Is and Two Ways to Build One","url":"https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc"},"datePublished":"2026-09-25T09:03:34.711Z","dateModified":"2026-10-15T02:25:13.193Z","description":"An in-depth architectural comparison of two ways to build a production-ready AI agent harness: AWS AgentCore Harness (a fully managed Harness-as-a-Service)...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b67282eebb7ca08fdaaadc7fd5b3fe11?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b67282eebb7ca08fdaaadc7fd5b3fe11?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"InfoQ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"InfoQ","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/afc3bced3e1e4b188dd9127017a60e0c","url":"https://daily.dev/sources/infoq"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,langchain,mcp,observability","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"InfoQ","item":"https://daily.dev/sources/infoq"},{"@type":"ListItem","position":3,"name":"The Agent Harness: What It Is and Two Ways to Build One"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-agent-harness-what-it-is-and-two-ways-to-build-one-zvqv3odcc#faq","mainEntity":[{"@type":"Question","name":"What is the difference between AWS AgentCore Harness and a self-managed LangChain agent with Envoy AI Gateway for production AI agents?","acceptedAnswer":{"@type":"Answer","text":"Both provide the same underlying harness capabilities (model access, tools, memory, cost control, observability) but package them differently. AgentCore exposes these as managed config fields via CreateHarness/InvokeHarness calls with automatic tracing to CloudWatch, while the self-managed stack assembles LangChain, a Postgres checkpointer, MCP clients, and Envoy AI Gateway on Kubernetes, trading a vendor bill for infrastructure ownership and cloud portability. Teams weighing managed versus self-managed agent infrastructure can track real-world comparisons like this on daily.dev."}},{"@type":"Question","name":"How does AWS AgentCore Harness prevent runaway token costs in an AI agent?","acceptedAnswer":{"@type":"Answer","text":"AgentCore enforces per-invocation hard caps directly on the agent, including maxIterations (75 by default), maxTokens, and timeoutSeconds, configurable via the update-harness CLI command. It also tags invocations for cost allocation and reports token metrics to CloudWatch, stopping a runaway loop mid-invocation rather than just rejecting future requests. Engineers setting cost guardrails for AI agents can follow ongoing coverage of these controls on daily.dev."}},{"@type":"Question","name":"How do you get unified observability across model calls and tool calls in a self-managed LangChain agent behind Envoy AI Gateway?","acceptedAnswer":{"@type":"Answer","text":"Point both the gateway's ext_proc and the LangChain application (via OpenLIT or OpenTelemetry's LangChain instrumentation) at the same OTLP collector endpoint. The gateway emits gen_ai.* semantic-convention metrics like token usage and time-to-first-token for model calls on the request path, while app-level instrumentation captures tool calls and control flow that never leave the process, together forming one prompt-tool-response trace. Developers wiring up agent observability pipelines can keep up with these patterns on daily.dev."}}]}
```

