From 0 to 100 in Agent Harness: Start by Breaking Down These Five Layers
An engineering-focused Agent Harness learning path: the five-layer architecture, key projects, how to read source code, and a bucket of cold water from the comments.
Someone online has put together an Agent Harness learning tutorial, with the link at the end. It starts with a judgment: many people stuff concepts such as Durable Execution, control plane, and eval into an Agent system side by side, which easily makes the architecture complicated. When learning, it is best to first align your mental model, then break things down using a fixed set of layers.
First, Remember the Five Layers
Agent = LLM + Harness. The LLM handles understanding, reasoning, and decision-making; the Harness handles the Agent Loop, tool calls, context management, and behavioral constraints.
Runtime manages how the Agent runs reliably: lifecycle, state management, task scheduling, concurrency control, failure recovery, and resource management.
Execution Environment manages where the Agent executes: commands, files, and resource isolation.
Infrastructure manages where underlying resources come from: compute, network, storage, and GPU.
The original article recommends understanding the system through these five layers: Agent, Harness, Runtime, Execution Environment, and Infrastructure. First draw the boundaries clearly, then go read the code.
How to Choose Projects
The original article does not recommend immediately buying a pile of paid projects and AI documents. Prioritize learning from influential GitHub projects. Projects are divided into two categories: key projects for studying architecture, core source code, and execution flow; and recommended projects for filling in specific areas and making side-by-side comparisons.
Agent / Harness
Key projects:
- Pi: Minimal Agent Core. Suitable for understanding the minimal runtime mechanism and for implementing your own Agent Core that supports Tool Calling, Streaming, Session, and Context Compaction. The original article specifically notes that Pi's compaction mechanism and session mechanism are worth studying.
- Codex CLI: Production Coding Harness. Study the Harness design of a production-grade Coding Agent, including tool execution, permission management, Sandbox, and communication protocols.
Recommended projects:
- OpenCode: modular Harness, Session, Tool Registry, Provider, Permission, and Plugin.
- DeepSeek Harness: Cordis Plugin Architecture, Service, Event, Plugin Lifecycle, Profile / Bundle.
Agent Runtime
The original article marks this layer as very important. Focus on answering: how an Agent Run is created and destroyed, how multiple Runs are managed, how execution state is stored, how concurrency, cancellation, timeouts, and exceptions are handled, how to recover after a crash, how to observe the entire chain, and how multiple Runtimes and execution resources are managed.
Key projects:
- OpenHands: Agent Server / Event-driven Runtime. Study how the server side manages multiple Agents, Conversations, and execution tasks.
- OpenClaw: Study how an Agent expands from a single execution process into a platformized system, focusing on Gateway, Session Routing, multi-Agent management, and how the Control Plane manages Agents, Sessions, Tasks, and Runtimes.
- Temporal: Understand Durable Execution and how it addresses long-running processes, process crashes, task recovery, retries, and state consistency. The original article notes that Temporal is a general-purpose Durable Workflow Engine, not a dedicated Agent Runtime.
- OpenTelemetry: General Observability Infrastructure. The goal is to trace a complete Agent Run, from user input and model requests to tool calls, the execution environment, and the final result.
Recommended projects:
- Hermes Agent: Persistent Memory, Skills, Context Compression, Cron, Subagent, and Execution Backend.
- Langfuse: LLM Trace, Generation, Token Usage, Prompt Management, and Evaluation.
Execution Environment
The original article says this layer is closer to the low level, so you can spend less time on it. Focus on understanding the relationship between Runtime and the actual execution environment, and study how Process, Container, Sandbox, and MicroVM are implemented.
Key projects:
- E2B Runtime: Cloud Sandbox Infrastructure. Study how to build a Sandbox Service that provides independent, secure, and manageable execution environments for different Agent Runs.
Recommended projects:
- Firecracker: MicroVM architecture, virtualization, resource isolation, and VM Lifecycle.
- OpenSandbox: Sandbox Backend abstraction, unified API, adaptation to multiple execution environments, and resource lifecycle management. The original article calls it a shining example of Chinese open source.
Infrastructure
This layer is somewhat less important, but you will often encounter it in actual development. The original article recommends understanding how Kubernetes provides resource scheduling and container management for an Agent Platform; you do not need to dig into the source code right away. At minimum, you should be able to answer: where the Agent's execution resources come from, how Containers and VMs depend on underlying resources, how networking and storage support Sandbox, how GPUs are allocated, how multiple Agents share infrastructure, and how Runtime requests execution resources.
How to Read Source Code
The original article provides a fixed method: first draw the overall architecture diagram and identify the core modules, dependencies, and responsibility boundaries. Then trace the complete chain starting from user input: User Input → Agent → Harness → Agent Run → Runtime → Execution Environment → Infrastructure.
When reading, pin to a stable version and go deep into the source code. Most of these projects are still under active development. You can use AI for assistance, but do not treat AI-generated documentation as source code.
The Final Learning Mainline
Key projects: Pi → Codex CLI → OpenHands → OpenClaw → Temporal → E2B Runtime → OpenTelemetry.
Recommended projects: OpenCode, DeepSeek Harness, Hermes, Langfuse, Firecracker, OpenSandbox, Kubernetes.
The goal is to build a complete architectural understanding, not to pile up a large number of projects. Use a small number of key projects as a foundation, then use recommended projects to fill in specific areas.
A Bucket of Cold Water from the Comments
Some people in the comments are not convinced. One person said that learning Harness now is like learning assembly language back in the C era—basically joining the losing side at the last moment. Another said that after learning it, doing secondary development, and writing tens of millions of lines of code, two generations of model upgrades will make it all generic, and the skill will be worthless.
This concern has a real basis. Model capabilities are indeed swallowing up part of the engineering layer. But equating Harness directly with assembly may underestimate constraints such as permissions, sandboxing, state recovery, and observability. As long as Agents need to run in real environments, someone will still have to handle these engineering problems. The roadmap is more like a map of engineering constraints; the key is understanding how those constraints are put into practice.
Some also asked whether the author has actually studied all the multiple projects listed at each stage, and whether there is a learning method. The original article does not give a quick-fix answer; it gives drawing diagrams, tracing the chain, and reading stable-version source code.
The author also mentions that they will later open-source a harness project they developed. It currently has 200,000 lines of code, 1,500 commits, and is 80% complete; you can build on it for secondary development. Project link: OpenAgent.
Original article link: Learning Agent Harness from 0 to 100; original tweet: A Agent by CAT.
发布时间: 2026-12-07 05:28