404
- -I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..7eb7117 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "additionalDirectories": [ + "/Users/junjian/GitHub/wang-junjian/wikillm/raw/images" + ] + } +} diff --git a/raw/Externalization in LLM Agents A Unified Review of Memory, Skills, Protocols and Harness Engineering.md b/raw/Externalization in LLM Agents A Unified Review of Memory, Skills, Protocols and Harness Engineering.md new file mode 100644 index 0000000..f96e8ea --- /dev/null +++ b/raw/Externalization in LLM Agents A Unified Review of Memory, Skills, Protocols and Harness Engineering.md @@ -0,0 +1,1239 @@ +--- +title: "Externalization in LLM Agents: A Unified Review of Memory, Skills, Protocols and Harness Engineering" +source: "https://arxiv.org/html/2604.08224v1" +author: +published: 2026-04-09 +created: 2026-04-11 +description: +tags: + - "clippings" +--- +1\]Shanghai Jiao Tong University 2\]Sun Yat-Sen University 3\]Shanghai Innovation Institute 4\]Carnegie Mellon University 5\]OPPO \[\*\]Equal contribution \[†\]Corresponding authors, + +Chenyu Zhou Huacan Chai Wenteng Chen Zihan Guo Rong Shan Yuanyi Song Tianyi Xu Yingxuan Yang Aofan Yu Weiming Zhang Congming Zheng Jiachen Zhu Zeyu Zheng Zhuosheng Zhang Xingyu Lou Changwang Zhang Zhihui Fu Jun Wang Weiwen Liu Jianghao Lin Weinan Zhang \[ \[ \[ \[ \[ [{wwliu, linjianghao, wnzhang}@sjtu.edu.cn](https://arxiv.org/html/2604.08224v1/mailto:%7Bwwliu,%20linjianghao,%20wnzhang%7D@sjtu.edu.cn) [junwang.lu@gmail.com](https://arxiv.org/html/2604.08224v1/mailto:junwang.lu@gmail.com) + +###### Abstract + +Large language model (LLM) agents are increasingly built less by changing model weights than by reorganizing the runtime around them. Capabilities that earlier systems expected the model to recover internally are now externalized into memory stores, reusable skills, interaction protocols, and the surrounding harness that makes these modules reliable in practice. This paper reviews that shift through the lens of externalization. Drawing on the idea of cognitive artifacts, we argue that agent infrastructure matters not merely because it adds auxiliary components, but because it transforms hard cognitive burdens into forms that the model can solve more reliably. Under this view, memory externalizes state across time, skills externalize procedural expertise, protocols externalize interaction structure, and harness engineering serves as the unification layer that coordinates them into governed execution. We trace a historical progression from weights to context to harness, analyze memory, skills, and protocols as three distinct but coupled forms of externalization, and examine how they interact inside a larger agent system. We further discuss the trade-off between parametric and externalized capability, identify emerging directions such as self-evolving harnesses and shared agent infrastructure, and discuss open challenges in evaluation, governance, and the long-term co-evolution of models and external infrastructure. The result is a systems-level framework for explaining why practical agent progress increasingly depends not only on stronger models, but on better external cognitive infrastructure. + +## 1 Introduction + +![[x1.png|Refer to caption]] + +Figure 1: Externalization as the organizing principle of LLM agent design. Upper panel: The arc of human cognitive externalization from thought through language, writing, printing, to digital computation. Middle panel: The corresponding externalization arc for LLM agents, from weights through three externalization dimensions—Memory (externalized state), Skills (externalized expertise), and Protocols (externalized interaction)—to the Harness that unifies them. Lower panel: A literature landscape mapping representative works onto three capability layers—Weights, Context, and Harness—illustrating how research threads have progressively migrated outward. The parallel between the two arcs encodes a recursive claim: LLM agents achieve reliable agency by externalizing cognitive burdens along the same representational dimensions that have driven human cognitive history. + +The history of human civilization can also be read as a history of cognitive externalization. Spoken language transformed private thought into shareable symbolic form. Writing moved knowledge from fragile biological memory into persistent material records. Printing mechanized the reproduction of knowledge at social scale. Digital computation relocated arithmetic and symbolic manipulation from neural labor to programmable machines. Across these transitions, the critical change was not that humans became less capable without the artifact. Rather, the artifact reorganized the cognitive system by shifting selected burdens outward and freeing limited internal resources for planning, abstraction, and creativity [^104]. The same pattern of outward delegation now recurs at the frontier of machine intelligence, in the design of large language model agents. + +This perspective has a natural theoretical anchor in the idea of cognitive artifacts [^103] [^104]. The central insight is that external aids do not merely amplify an unchanged internal ability; they often transform the task itself. A shopping list does not expand biological memory capacity. It changes a difficult recall problem into a recognition problem. A map does not simply make navigation “stronger.” It converts hidden spatial relations into visible structure. The power of an artifact therefore lies in representational transformation: it restructures the problem so that the agent can solve it more reliably with the competencies it already has [^103]. + +We argue that the same logic now governs the most consequential design choices in LLM-based agents. Our central thesis is that externalization—the progressive relocation of cognitive burdens from the model’s internal computation into persistent, inspectable, and reusable external structures—is the transition logic—the mechanism that explains why each architectural shift has occurred and what forms of reliability it sought to preserve—that unifies recent advances in memory, skills, protocols, and harness engineering for language agents. This is not merely a claim about engineering convenience. It is a claim about where reliable agency comes from: not from ever-larger models alone, but from the systematic restructuring of task demands so that internal capabilities and external infrastructure jointly cover the full range of competencies required [^103] [^133]. + +Figure 1 summarizes the argument. The upper panel traces the familiar arc of human cognitive externalization; the middle panel presents the corresponding arc for LLM agents, from weights through three externalization dimensions—memory, skills, and protocols—to the harness that unifies them; the lower panel maps the resulting literature landscape onto three capability layers—Weights, Context, and Harness. Figure 3 complements this view with an architectural overview of the externalized agent, showing the harness at the center with the three externalization dimensions and their operational elements orbiting it. Memory externalizes state across time, skills externalize procedural expertise, and protocols externalize interaction structure. The parallel between the two arcs encodes a recursive claim: LLM agents are themselves artifacts operating inside the latest major human externalization, digital computation. The common mechanism is representational transformation in Norman’s sense [^103]: recall becomes recognition, improvised generation becomes composition, and ad hoc coordination becomes structured contract. + +This lens is especially clarifying for understanding current practice. Contemporary progress is often narrated as a race for larger models, better training procedures, or more sophisticated reasoning traces. Those factors matter, but they do not fully explain the pattern observed in practical systems. Many of the largest gains in reliability do not come from changing the base model at all. They come from changing the environment around the model: adding persistent memory, organizing reusable skills, standardizing tool interfaces, constraining execution, instrumenting behavior, and routing work through explicit control logic [^133] [^142] [^80] [^94]. In practice, the question is increasingly not only “how capable is the model?” but also “what burdens have been externalized so the model no longer has to solve them internally every time?” + +An unaided LLM still faces three recurrent mismatches that map directly onto the three harness dimensions. Its context window is finite and session memory is weak or absent, creating a continuity problem that memory externalization addresses. Long multi-step procedures are often rederived rather than executed consistently, creating a variance problem that skill externalization addresses. Interactions with external tools, services, and collaborators remain brittle when left to free-form prompting alone, creating a coordination problem that protocol externalization addresses [^133] [^113]. Externalization matters because it turns each of these burdens into a form the model can handle more reliably. + +A concrete example helps fix the intuition. Consider a software engineering agent asked to implement a feature in a large repository, run tests, and open a pull request. Without externalization, the model must keep repository structure, project conventions, workflow state, and tool interactions active inside a fragile prompt. With externalization, persistent project memory supplies context, reusable skill documents encode conventions and workflow, protocolized tool interfaces enforce correct schemas, and the harness sequences steps, validates outputs, and manages failures. The base model may remain unchanged; what changes is the representation of the task it is asked to solve. + +This broader perspective also aligns with the intuition behind distributed and extended cognition: once crucial parts of remembering, guiding action, and coordinating interaction are delegated to external structures, intelligence is no longer localized in the model alone [^26]. We draw on this tradition for its core engineering insight—that the boundary between “agent” and “environment” is a design choice with real performance consequences—rather than committing to its stronger ontological claims. Our focus is pragmatic: we treat externalization as a design principle whose value is measured by the reliability, composability, and governability of the resulting system. + +We now turn to the three dimensions of externalization that constitute the harness, each corresponding to one of the representational transformations highlighted in Figure 1 (middle panel): + +##### Memory systems externalize state across time. + +Rather than relying on the context window as the sole carrier of history, memory systems allow accumulated knowledge—user preferences, prior trajectories, resolved ambiguities, domain facts—to persist beyond any single session and be selectively retrieved when relevant. The core transformation is from recall to recognition: the agent no longer needs to regenerate past knowledge from latent weights; it retrieves it from a persistent, searchable store [^75] [^115] [^113] [^23] [^168]. + +##### Skill systems externalize procedural expertise. + +Rather than relying on the model’s weights to regenerate task-specific know-how on every invocation, skill systems package procedures, best practices, and operating guidance into reusable artifacts. The core transformation is from generation to composition: the agent assembles behavior from pre-validated components rather than improvising each step de novo [^107] [^129] [^140] [^5] [^6] [^63]. + +##### Protocols externalize interaction structure. + +Rather than relying on ad hoc prompt-level coordination with tools, services, and other agents, protocols define explicit machine-readable contracts for discovery, invocation, delegation, and permission management. The core transformation is from ad-hoc to structured: ambiguous, fragile communication becomes interoperable, governable exchange [^3] [^50] [^38]. + +The harness is the engineering layer that hosts all three dimensions and provides the orchestration logic, constraints, observability, and feedback loops that make externalized cognition cohere in practice. It is not a fourth kind of externalization alongside memory, skills, and protocols. It is the runtime environment within which these forms of externalization operate and interact. + +These dimensions do not evolve in isolation. Memory expansion can compete with skill loading for scarce context budget. Protocol standardization can improve interoperability while constraining how capabilities are packaged and invoked. Skill execution generates traces that later become memory, and memory retrieval can influence which skills and protocol paths are chosen next. The harness must mediate all of these interactions. We preview these system-level couplings here and analyze them in detail in Section 7. + +These directions have each developed substantial technical ecosystems. Memory research has progressed from simple retrieval augmentation to more selective and tiered memory architectures [^75] [^113] [^23] [^168]. Skill-related work has expanded from narrow function calling and tool learning toward reusable capability packages, registries, and progressive disclosure mechanisms [^107] [^129] [^140] [^5] [^6] [^63]. Protocol work has moved from custom tool schemas and framework-specific glue code toward more standardized interface layers for agent-tool and agent-agent interaction [^3] [^50] [^38]. Existing surveys illuminate important slices of this landscape, including retrieval-augmented generation [^43], deep search [^162], tool learning and use [^123], broad agent architectures [^142] [^80] [^94], and protocol interoperability [^38]. The closest conceptual bridge is CoALA [^133]. What remains underdeveloped is a common account of why these developments are converging as forms of externalization and how that convergence reshapes the definition of an agent. + +Our goal is therefore not to provide another component-level survey in isolation, nor to reduce agent progress to one specific framework. Instead, we offer a systems-level review organized around four claims: + +- Memory systems externalize an agent’s state across time and convert long-horizon continuity into selective retrieval. +- Skill systems externalize procedural expertise and convert implicit know-how into explicit reusable operating guidance. +- Protocols externalize interaction structure and convert ambiguous communication into interoperable, machine-readable contracts. +- Harness engineering unifies these externalized modules into a coherent runtime environment with constraints, observability, feedback loops, and control points. + +The remainder of the paper proceeds as follows. Section 2 traces the historical path from weights to context to harness. Sections 3 through 5 analyze memory, skills, and protocols as three distinct but complementary forms of externalization. Section 6 presents harness engineering as the integrative discipline of externalized agent design, and Section 7 examines the main cross-cutting interactions among the modules. Section 8 discusses future directions toward more adaptive and self-evolving forms of externalization, and Section 9 concludes with broader implications for agent research. + +## 2 Background: From Weights to Context to Harness + +![[timeline.png|Refer to caption]] + +Figure 2: Community theme evolution across three capability layers. The stacked layers—Weights, Context, and Harness—show how the center of gravity in the LLM agent community has shifted outward over time, from parametric knowledge and prompting toward harness-level infrastructure such as tool ecosystems, protocols, skills, and multi-agent orchestration. + +The recent history of LLM agents can be understood as a progressive movement outward from the model itself. Capabilities were first treated as properties of weights, then as properties of prompts and context windows, and are now increasingly treated as properties of the broader infrastructure in which the model operates. Figure 2 visualizes this trajectory as three stacked layers—Weights, Context, and Harness—unfolding across a timeline from 2022 to 2026, illustrating how research themes in the community have shifted over time. The lower panel of Figure 1 complements that view with a literature landscape, mapping representative works to the three layers. The stages are layered rather than mutually exclusive—weights remain important even in the most infrastructure-heavy systems—but each stage changes where developers place the system’s mutable intelligence and, consequently, where they invest most of their engineering effort. + +### 2.1 Capability in Weights + +The Weights layer in Figures 2 and 1 corresponds to the earliest wave of modern LLM deployment, in which capability was identified almost entirely with model parameters. Pretraining on large corpora compressed broad statistical regularities, world knowledge, and latent reasoning habits into the weights [^12] [^25] [^138]. Scaling laws revealed predictable relationships between parameter count, data volume, and loss, reinforcing the intuition that progress tracked directly with model size [^66] [^55]. By the time systems such as GPT-4 [^108], Gemini [^44], DeepSeek-V3 [^31], and Qwen2.5 [^124] demonstrated broad multi-task competence, the dominant narrative in much of the field equated better agents with bigger, better-trained models. Supervised fine-tuning and preference optimization then shaped these models into more useful assistants by teaching instruction following, conversational style, refusal behavior, and domain-specific conventions [^112] [^8]; direct preference optimization further simplified this alignment stage by eliminating the need for a separate reward model [^125]. From this viewpoint, improvement largely meant modifying or replacing the model itself. + +This paradigm remains foundational, and weight-space capability offers several advantages: fast inference without external lookups, compact deployment, and strong generalization across many tasks without task-specific plumbing. The same model that answers a medical question can write a poem, debug a program, or summarize a legal contract, all without any change to the surrounding system. For one-shot, context-contained tasks, the weight-centric view is often sufficient. + +However, weight-space encoding also couples knowledge, procedure, and policy too tightly to a static artifact. Updating a single fact—say, the current head of state of a country—requires retraining, knowledge editing [^97] [^99] [^178], or patching through additional alignment layers, all of which risk unintended side effects on other capabilities. Auditing why a model behaved a certain way is difficult because relevant knowledge is distributed across billions of parameters rather than encoded as inspectable modules [^192]. Personalization is also awkward: a single set of weights is asked to serve millions of users with different histories, preferences, and constraints, yet it has no mechanism to differentiate among them at the parameter level. + +A central limitation of parametric knowledge is that it is difficult to selectively update, compose, and govern. As long as agents were confined to single-turn question answering, these weaknesses were often manageable. As systems moved into long-horizon task execution—where state accumulates, procedures must be followed reliably, and multiple tools must be coordinated—the difficulty of modularly managing knowledge, skills, and interaction rules inside the weights became more operationally salient. This shift encouraged developers to relocate some of these burdens into the next layer rather than relying on the model parameters alone. + +![[circle.png|Refer to caption]] + +Figure 3: Externalization architecture of a harnessed LLM agent. The Harness sits at the center; three externalization dimensions— Memory (working context, semantic knowledge, episodic experience, personalized memory), Skills (operational procedures, decision heuristics, normative constraints), and Protocols (agent–user, agent–agent, agent–tools)—orbit around it. Operational elements such as sandboxing, observability, compression, evaluation, approval loops, and sub-agent orchestration mediate the interaction between the harness core and the externalized modules. + +### 2.2 Capability in Context + +The Context layer represents the stage at which attention shifted from model modification to input design. Prompt engineering demonstrated that model behavior could be substantially altered without touching the weights: few-shot examples, role descriptions, chain-of-thought decomposition, and self-consistency traces all changed how the same model performed on the same underlying task [^155] [^147] [^69]. Techniques for more structured reasoning soon followed. ReAct interleaved reasoning traces with tool actions in a single generation loop, showing that prompting alone could produce agent-like behavior without any architectural change [^176]. Tree of Thoughts generalized chain-of-thought into deliberate search over intermediate reasoning states [^177]. Self-Refine introduced iterative self-critique, demonstrating that models could improve their own outputs through multi-turn prompting loops [^95]. Automatic prompt optimization further reduced the manual burden by using the model itself to search over the prompt space [^200] [^120]. Retrieval-augmented generation (RAG) introduced a more systematic form of externalization by dynamically injecting external documents into the context at query time [^75] [^10] [^126] [^43]. Attention thus shifted from what the model had internalized to the information pipeline surrounding each invocation. + +This stage made agent design substantially more flexible. Developers could attach local instructions, domain knowledge, output schemas, and retrieved evidence at runtime without any gradient update. Context became the medium through which developers staged cognition for the model—a working surface on which the right information could be assembled just before the model needed it. In many practical systems, iterating on prompts and retrieval pipelines proved substantially cheaper and faster than fine-tuning. The model could remain frozen while the surrounding prompt template, retrieval logic, and tool specification evolved rapidly. + +The context-centric stage can also be interpreted through Norman’s notion of representational transformation. A difficult recall problem—“does the model know fact $X$?”—was converted into a recognition problem: “given that fact $X$ has been placed in context, can the model use it?” This resembles the recall-to-recognition shift associated with writing in the human externalization arc (Figure 1, upper panel). The model did not need to have memorized the answer; it needed only to recognize and apply the relevant passage once it was provided. In Figure 2, this transition corresponds to the emergence of prompting, RAG, chain-of-thought, and related techniques in the Context layer [^189] [^126]. + +Context-centric design also has important constraints. Context windows are finite, costly at scale, and often noisy when overloaded with marginally relevant material. Long prompts can degrade performance rather than improve it: the “lost in the middle” phenomenon shows that models attend unevenly across long inputs, with retrieval accuracy dropping sharply for information placed in the center of the context [^89]. Even as context lengths have expanded dramatically—from 2K tokens to over 100K and beyond [^18] [^118] —the fundamental tension persists: more capacity does not eliminate the need for selective curation. Context is also ephemeral: unless state is explicitly externalized elsewhere, every new session begins with partial amnesia. As systems become more complex, prompt assembly alone can become a brittle and ad hoc control mechanism. A model can be given more instructions, but that does not mean the system knows how to persist state across sessions, schedule multi-step workflows, coordinate among sub-agents, recover from partial failures, or enforce behavioral constraints over time. These limitations help explain the next outward step. + +### 2.3 Capability through Infrastructure + +The Harness layer—the topmost band in Figure 2 and the rightmost region in Figure 1 (lower panel)—represents the current stage, in which capability extends beyond prompt management into persistent infrastructure. As context windows became saturated and prompt templates more unwieldy, engineering attention increasingly shifted from “what should we tell the model?” to “what environment should the model operate in?” In mature agent systems, reliability increasingly depends on external memory stores, tool registries, protocol definitions, sandboxes, sub-agent orchestration, compression pipelines, evaluators, test harnesses, and approval loops [^142] [^80] [^94] [^163]. + +The earliest manifestations of this shift were simple but revealing. Projects such as Auto-GPT [^127] and BabyAGI [^100] wrapped an LLM in a loop with a task queue, persistent memory, and web access, showing that even a minimal harness could sustain behavior that no single prompt could. More principled frameworks quickly followed: AutoGen formalized multi-agent message exchange [^157], MetaGPT added role-based collaboration and explicit procedures [^56], CAMEL explored structured dialogue for task decomposition [^76], and Reflexion persisted feedback across episodes [^130]. Across these systems, the common move was to shift burden out of the model and into surrounding structure. + +The same move is now visible across deployment domains. Coding agents embed the model in development harnesses with files, shells, version control, tests, and reusable skill artifacts; SWE-agent and OpenHands are representative examples [^172] [^148]. Research and enterprise agents add retrieval, approvals, browsing, and long-horizon orchestration pipelines, as in Deep Research-style systems [^110] [^46]. Embodied and workflow systems such as Voyager, LangGraph, CrewAI, and OS-Copilot likewise make control flow, environment access, and reuse explicit [^140] [^71] [^29] [^159]. The recurring pattern is that reliability problems are increasingly solved by changing the environment rather than by prompting alone. + +As shown in Figure 3, the harness encompasses three major classes of externalization—memory, skills, and protocols—which correspond to the three major classes of burden that the harness absorbs. Memory systems externalize state across time, so that continuity no longer depends on ephemeral context. Skill systems externalize procedural expertise, so that complex workflows are loaded rather than reinvented. Protocols externalize interaction structure, so that tool and agent coordination follows governed contracts rather than ad hoc prompting. Together, these elements make up the harness: the persistent infrastructure that envelops the model and transforms the tasks it faces into forms that its internal competencies can handle more reliably. + +Under this framing, “agent engineering” increasingly takes the form of “harness engineering.” The model remains the core reasoning engine, but it is no longer the sole location of intelligence. Capability is distributed across the structures that shape what the model sees, remembers, calls, and is allowed to do. + +### 2.4 Externalization as the Transition Logic + +Taken together, the path from weights to context to harness is a story of externalization in Norman’s sense [^103]: burdens that are hard to manage inside the model are progressively moved into explicit artifacts outside it, and the task seen by the model is correspondingly transformed. Mutable knowledge moves from weights into retrieval systems and runtime context, converting recall into recognition. Reusable procedures move from implicit habits into explicit skills, converting improvised generation into structured composition. Interaction rules move from ad hoc prompting into protocols, converting ambiguous coordination into governed contracts. Runtime reliability, in turn, moves into harness logic, where constraints, observability, and feedback loops can be made explicit. + +This redistribution is best understood as a response to mismatch. LLMs are strong at flexible synthesis and reasoning over provided information; they are less reliable at stable long-term memory, procedural repeatability, and governed interaction with external systems. Externalization therefore constructs a larger cognitive system around the model rather than replacing it, a view consistent with cognitive-architecture accounts such as CoALA [^133]. The three harness dimensions follow directly from this framing: memory addresses continuity over time, skills address consistency of procedure, and protocols address structure of interaction. The following sections examine each in detail. + +## 3 Externalized State: Memory + +Memory externalization addresses the temporal burden of agency. A bare language model must carry continuity, prior experience, user-specific facts, and partially completed work inside an ephemeral prompt. Once tasks extend across sessions, branches, or interruptions, that burden becomes both unstable and expensive. Memory externalizes it into persistent state that can be written, updated, and retrieved outside the model. + +In harnessed agents, memory is more than an archive. It supplies checkpoints for resumable execution, traces from which skills can be distilled, statistics that influence protocol routing, and persistent state that governance mechanisms can inspect and constrain. To make that role precise, this section asks three linked questions: what burden memory externalizes, how the design space has evolved, and how memory couples to the broader harness. Section 3.1 clarifies which kinds of state are externalized; Section 3.2 surveys the main architectural choices; Section 3.3 turns to the demands imposed by harnessed agent systems; and Section 3.4 closes the chapter by interpreting memory through the lens of cognitive artifacts. + +![[memory_f.png|Refer to caption]] + +Figure 4: Memory as externalized state. Raw context from the ephemeral context window and environment feedback is converted into four persistent memory dimensions—working context, episodic experience, semantic knowledge, and personalized memory. These dimensions are organized through progressively more managed architectures: monolithic context, retrieval stores, hierarchical orchestration (with extraction, consolidation, forgetting, and OS-style hot/cold swapping), and adaptive memory systems (with dynamic modules and feedback-based strategy optimization via MOE, RL, etc.). On the harness side, execution traces from skills and protocols flow into externalized memory, which in turn supplies task-relevant content back to the agent core through direct recall and curated snapshots. + +### 3.1 What Is Externalized: The Content of State + +The essence of memory lies in decoupling the agent’s state across time from its transient context. The relevant contents are not every external artifact in the harness, but the records that preserve continuity: current task state, past execution experiences, abstracted knowledge, and persistent user or environment context. To maintain coherent behavior across long-horizon interactions, the memory system must categorize and manage these records according to their temporal properties and retrieval needs. Drawing inspiration from classical taxonomies of human memory and adapting them to LLM agents, we distinguish the following four dimensions of externalized state: + +##### Working context. + +Working context is the live intermediate state of the current task: open files, temporary variables, active hypotheses, partial plans, and execution checkpoints. It changes quickly and loses value if it is stale, but without externalization it disappears as soon as the context window resets or a process is interrupted. Coding agents illustrate the point well. By materializing drafts, terminal state, and workspace artifacts outside the prompt, systems such as OpenHands and SWE-style agents can resume from the current operating state rather than reconstructing it from scratch [^149] [^173]. + +##### Episodic experience. + +Episodic experience records what happened in prior runs: decision points, tool calls, failures, outcomes, and reflections. Its value is not merely archival. Retrieved episodes can serve as concrete precedents, help the agent avoid repeating known mistakes, and supply raw material for later abstraction. Reflexion made this pattern explicit by storing reflective summaries from failed attempts as reusable experience [^130]. AriGraph extends the idea further by treating local interaction trajectories in unfamiliar environments as episodic memory from which a broader world model can be built [^2]. + +##### Semantic knowledge. + +Semantic knowledge stores abstractions that outlive any single episode: domain facts, general heuristics, project conventions, and stable world knowledge. Unlike episodic memory, it is not organized around a specific time and place [^78] [^30]. The difference is not only granularity but function. Episodic memory says what happened in a case; semantic memory says what tends to hold across cases. In current systems, knowledge bases and Retrieval-Augmented Generation (RAG) corpora are the most common form of externalized semantic memory. The longer-term trend is more ambitious: agents increasingly try to distill semantic guidance from accumulated trajectories rather than relying only on static human-authored documents. + +##### Personalized memory. + +Personalized memory tracks stable information about particular users, teams, or environments: preferences, habits, recurring constraints, and prior interactions. This state should not be collapsed into the agent’s general self-improvement store, because user-specific traces obey different retention, retrieval, and privacy rules [^161] [^84]. Recent systems make this separation explicit. IFRAgent builds a repository of user habits from demonstrations in mobile environments [^160]; web agents use externalized profiles to infer implicit preferences [^13]; and conversational systems such as VARS store cross-session preference cards in isolated user memory spaces [^53]. Personalized memory is therefore the layer that lets an agent adapt over time without confusing long-term user modeling with general task knowledge. + +These four layers do not exhaust everything that may later become useful to the agent. Repeated procedural regularities may first appear as patterns in episodic traces, but they cease to be memory proper once the harness promotes them into explicit reusable guidance. At that point they belong to the skill layer rather than the memory layer. + +Taken together, these layers show that memory externalizes not a single homogeneous database but the temporal burden of continuity at multiple levels of abstraction. Working context supports immediate resumption, episodic records support reflection and recovery, semantic memory supports abstraction and transfer, and personalized memory supports cross-session adaptation to users and environments. A harness must treat these stores differently because each one changes a different part of what the model would otherwise have to recover internally. + +### 3.2 How It Is Externalized: Memory Architectures + +When these layers are externalized, the main design question becomes how aggressively active reasoning is separated from stored state. Following the taxonomy of [^33], current systems can be read as four broad architectural paradigms: Monolithic Context, Context with Retrieval Storage, Hierarchical Memory and Orchestration, and Adaptive Memory Systems. The progression is not just toward larger stores. It is toward more explicit policies for what gets written, promoted, retrieved, compressed, or forgotten. + +#### 3.2.1 Monolithic Context + +Early systems relied on monolithic context: all relevant history, or a summary of it, remained directly in the prompt. This design is transparent and easy to prototype because no separate memory service is required, and for short tasks it can work surprisingly well. Its limitations are structural. Capacity scales poorly, summaries drift, and the model must spend scarce tokens both carrying history and solving the present step. Most importantly, the state disappears with the session, so the agent does not accumulate durable experience. + +#### 3.2.2 Context with Retrieval Storage + +The dominant next step is to keep only near-term working state in context while storing longer-horizon traces externally and retrieving them on demand. This “context plus retrieval store” pattern underlies most practical memory systems in production copilots, assistants, and coding agents. It solves the raw capacity problem, but it turns memory quality into a retrieval problem. If the wrong records are surfaced, the model is distracted; if the right ones are missed, the system behaves as though it never remembered them at all. + +Recent work attacks this bottleneck from several directions. GraphRAG [^35] adds graph structure and community-level retrieval, ENGRAM [^22] compresses memory into latent state representations, and SYNAPSE [^197] uses spreading activation over a unified episodic-semantic graph to recover less local forms of relevance. These approaches differ in mechanism, but they share the same goal: replacing flat similarity search with a representation better matched to long-horizon reasoning. + +#### 3.2.3 Hierarchical Memory and Orchestration + +Once flat retrieval proves insufficient, systems move to hierarchical memory and orchestration. The key idea is that not every trace deserves the same retention policy or retrieval path. Frameworks such as Mem0 [^23], Memory-R1 [^171], and Mem- $\alpha$ [^152] introduce explicit operations for extraction, consolidation, and forgetting, turning memory into a managed lifecycle rather than a passive store. Two design tendencies dominate this space: + +- Resource decoupling in spatio-temporal dimensions. One branch borrows the logic of operating systems and treats memory as a constrained resource that must be actively managed. MemGPT [^113] and MemoryOS [^65] separate hot working state from colder long-tail storage and swap information across tiers as task demands change. The gain is higher effective capacity under fixed context budgets. +- Semantic decoupling in cognitive functional dimensions. A second branch organizes memory by function or content type so that heterogeneous records are not all routed through the same channel. MemoryBank [^198] and MIRIX [^151] separate events, user profiles, and world knowledge; MemOS [^82] distinguishes explicit and implicit memory; and xMemory [^59] builds a topic-event hierarchy. The goal is not simply neat taxonomy, but more precise retrieval under complex task conditions. + +#### 3.2.4 Adaptive Memory Systems + +The architectures above still rely heavily on human-designed heuristics. Adaptive memory systems go further by making modules, routing decisions, or retrieval strategies responsive to experience. Two directions are especially visible: + +- Dynamic modules. Some systems adapt the architecture itself at runtime. MemEvolve [^184] decomposes the memory lifecycle into separate encode, store, retrieve, and manage modules that can evolve independently during execution. MemVerse [^87] maintains a short-term cache and a multimodal knowledge graph while periodically distilling fragmented experience into more abstract knowledge and lightweight neural components. +- Feedback-based strategy optimization. Other systems keep the architecture relatively fixed but learn better control policies. MemRL [^188] updates retrieval behavior through non-parametric reinforcement learning. The adaptive framework proposed by [^190] uses mixture-of-experts gating to route queries dynamically, and GAM [^170] refines retrieval conditions over multiple rounds of interaction. + +Across these stages, the major transition is from storage to control. Monolithic context solves existence, retrieval stores solve capacity, hierarchical systems solve organization, and adaptive systems begin to solve policy. Memory therefore ceases to be a passive appendix to prompting. In mature agents it becomes part of the harness control surface that determines what past the model can effectively act on. + +### 3.3 Memory Demands of the Harness Eras + +As agents evolve into the Harness era, memory systems are no longer merely isolated storage modules; instead, they become the substrate through which the runtime coordinates continuity, procedural reuse, and governed interaction. The question is no longer only how to store more information, but how to make temporal state selectively legible to planning, execution, and recovery loops. + +The Harness environment therefore requires memory systems to explicitly separate state from context. In tasks with extremely long time horizons, the unrestricted accumulation of session history can cause the model to lose track of its attention mechanism. Frameworks such as InfiAgent [^181] propose a file-centric state abstraction, advocating for the file system as the sole authoritative record of task state, where everything—from high-level planning to intermediate variables and tool outputs—must be written in real time. At each decision step, the agent no longer reads lengthy history but instead reads a curated snapshot of the workspace and a small number of recent actions. This is the harness-level expression of memory’s core representational role: not preserving all history in prompt, but materializing the current state in a form the model can act on. + +Memory must also be integrated with the skill system, but the two layers play different roles. Memory stores the evidence of prior execution: traces, outcomes, failures, and user- or task-specific context. Skills begin only when some of that evidence is promoted into explicit reusable procedure. In the opposite direction, every skill execution produces new traces that must be written back into memory. Memory is therefore not itself procedural guidance; it is the evidence base from which such guidance can later be derived. + +Protocol coupling imposes a further requirement. Tool results, approvals, delegation events, and external state transitions may arrive through protocolized interfaces, but they become memory only once they are normalized and written into persistent state. Conversely, memory retrieval may influence which protocol path should be chosen next. In a mature harness, memory and protocol are linked by a governed read/write loop, but they remain conceptually distinct: protocol governs exchange, while memory governs persistence across time. + +Finally, sharing and governance mechanisms become mandatory once multiple agents rely on common externalized state. Establishing read/write permissions for memory, resolving conflicts among stored facts, and controlling each agent’s access quota to shared knowledge all require low-level control capabilities comparable to those of an operating system. Memory in the harness era is therefore best understood as managed state infrastructure: it externalizes temporal burden, reshapes what the model must remember internally, and provides the persistent substrate on which the rest of the harness operates. + +### 3.4 Memory as Cognitive Artifact + +The preceding sections surveyed the content, architecture, and harness integration of memory systems. This final section steps back to interpret what memory externalization achieves as a representational transformation, drawing on Norman’s theory of cognitive artifacts [^104] and Kirsh’s account of complementary strategies [^68]. + +Modern LLMs are stateless generators: each call begins with a fresh context, so continuity must be reconstructed rather than carried forward. In short interactions, that limitation can be hidden inside the prompt. In long-horizon work, it becomes structural. Past attempts, partially completed work, user-specific facts, and environmental state cannot all remain live in context without cost, drift, and eventual truncation. The original task facing a bounded model is therefore intractable in principle: keep an effectively unbounded history available while still reasoning clearly about the present. + +Memory externalization changes the structure of that task. In Norman’s terms, the representational transformation converts an internal recall problem into an external recognition-and-retrieval problem. The model no longer has to recover relevant history from its parameters; it has to recognize and use a curated slice of history that the memory system has already surfaced. This is closely analogous to Norman’s analysis of how an external list changes the nature of remembering: the crucial point is not that extra information has been added, but that the form of the cognitive task itself has been reorganized [^103]. The same shift was identified in Section 2.2 at the context level; memory extends it across sessions and time horizons that no single context window can span. + +This interpretation clarifies why retrieval quality matters more than raw storage capacity. A system with vast storage but weak retrieval still presents the model with the wrong problem representation: the history exists, but the task has not been transformed. By contrast, a modest store with strong indexing, summarization, and contextual selection can make downstream reasoning significantly easier. The success criterion for memory is therefore not “how much did we save?” but “did we make the current decision legible?” + +The same perspective also illuminates Kirsh’s notion of complementary strategies, according to which agents improve performance not only by thinking harder internally but also by reorganizing the external environment so that some cognitive work is offloaded into it [^68]. Memory systems implement exactly this strategy for the temporal dimension. Rather than forcing the model to carry all relevant state internally, the harness externalizes persistence, freshness management, and relevance filtering, while leaving interpretation and contextual judgment to the model. The division is complementary: each side handles the part of the task it does best. + +The cognitive-artifact view also explains common failure modes as failures of representational design rather than mere implementation bugs. Stale memories misrepresent the present by offering an outdated problem representation. Over-abstracted memories lose the operational details needed for the current decision. Under-abstracted memories flood the prompt with noise, degrading the very recognition task that externalization was supposed to simplify. Poisoned or conflicting memories contaminate future reasoning by embedding incorrect premises into the retrieved slice. In each case, the memory system has failed not because it stored too little or too much, but because it did not transform history into a usable present. + +Seen in this light, memory is not simply an engineering convenience for expanding effective context. It is a cognitive artifact that reshapes the temporal burden of agency. By converting unbounded recall into bounded, curated retrieval, it changes the task the model faces at every decision point. That transformation is what connects the architectural progression surveyed in this section—from monolithic context through adaptive systems—to a single underlying design goal: making the right history legible at the right moment, so that the model’s fixed inferential capacity is spent on reasoning rather than on remembering. + +## 4 Externalized Expertise: Skills + +Skill externalization addresses the procedural burden of agency. A language model may know, in principle, how to solve a task, yet reliable execution still requires reconstructing workflows, defaults, and constraints each time a task is attempted. That burden grows with task length, environmental specificity, and the number of branching decisions, and it manifests as variance: omitted steps, unstable tool use, and inconsistent stopping conditions. + +The representational shift introduced by skills is therefore from repeated synthesis to reusable procedure. Instead of asking the model to regenerate task-specific know-how from weights or ad hoc prompts on every run, a skill system packages that know-how into explicit artifacts that can be discovered, loaded, revised, and composed. This does not mainly expand the set of actions available to the agent; it changes the task the model faces at runtime from inventing a workflow to selecting and following one [^166] [^141]. + +In harnessed agents, skills sit between memory and action. They are often selected in light of retrieved state, bound to tools and subagents through protocolized interfaces, and updated from execution traces and post hoc reflection. As discussed in Section 3, memory externalizes what has been learned over time; skills externalize how that accumulated experience becomes a reusable operating structure [^133] [^158]. The chapter therefore focuses on three linked questions: what burden skills externalize, how skills reorganize task execution, and how they become actionable inside a larger harness. + +![[skill_f.png|Refer to caption]] + +Figure 5: Skills as externalized expertise. The figure traces the full lifecycle of a skill through three phases—invocation, selection, and procedure. Skill Acquisition shows four pathways by which procedural know-how enters the system: authored by experts, distilled from episodic memory and trajectories, discovered through environment exploration and self-induction, or composed from existing units. Skill Artifact packages that know-how into operational procedures, decision heuristics, and normative constraints, accompanied by a manifest declaring capabilities, preconditions, and scope. Activation Pipeline handles registry-based discovery via semantic abstraction, progressive disclosure from abstract summaries to full guides, and composition that binds skills to tools, APIs, files, agents, and protocols. Runtime shows how the active context and the LLM execute the selected skill, while boundary conditions—staleness, portability limits, context-dependent degradation, and unsafe composition—constrain reliability. + +### 4.1 What is Externalized: Procedural Expertise + +Skill externalization concerns procedural expertise rather than isolated action interfaces. Expertise here means a repeatable way of carrying out a task under recurring assumptions and constraints, not a vague claim that the model “can” do something. A useful boundary follows from that definition: tools expose operations, protocols govern how those operations are described and invoked, and skills encode how a class of tasks should be executed with them. In practice, that expertise has three coupled components: operational procedures, decision heuristics, and normative constraints. Together they define the reusable unit of know-how that a harness can externalize. + +#### 4.1.1 Operational Procedure + +Operational procedure is the task skeleton: the decomposition of a complex job into steps, phases, dependencies, and stopping conditions. It addresses a common failure mode in LLM agents. Many errors do not come from incapacity at the action level; they come from instability at the process level, such as skipped steps, misordered operations, or premature termination [^58] [^101]. Externalizing procedure turns that fragile process knowledge into an explicit operating path. + +This shift has deep roots in the broader evolution of LLM reasoning. Chain-of-Thought made intermediate reasoning explicit [^156]; ReAct coupled reasoning with action [^176]; later prompt-chaining and orchestration systems packaged recurring patterns into engineered workflows. What those approaches often lacked was persistence. The procedure existed in the current run, but not yet as a reusable artifact. Skill systems close that gap by turning workflow structure into something that can be stored, revised, and reapplied [^179]. + +Once procedures are externalized, execution becomes less improvisational. The agent can resume after interruption, hand work across contexts or collaborators, and recover state without reconstructing the entire workflow from memory. This matters most in long-horizon, multi-agent, and production settings, where process stability is often more important than momentary fluency. + +#### 4.1.2 Decision Heuristics + +If procedures define the skeleton of execution, decision heuristics govern what happens at branches. Real tasks rarely unfold as fixed pipelines. Tools fail, observations are noisy, and several locally plausible actions may compete. Under those conditions, good performance depends on practical rules of thumb derived from experience rather than on exhaustive search alone [^45]. + +Externalizing those heuristics changes the distribution of reasoning effort. Instead of forcing the model to rediscover local policy at every junction, the system can encode default choices, escalation rules, or preference orderings that have already proved useful. That reduces deliberation cost and also makes behavior more stable. Heuristics are therefore not a secondary convenience. They are one of the main ways a skill captures expert style: what to try first, when to back off, what evidence is sufficient, and which trade-offs are preferred when multiple paths remain viable. + +#### 4.1.3 Normative Constraints + +The third component is normative constraint: the conditions under which a procedure counts as acceptable. A workflow may be technically effective and still be noncompliant, unsafe, or operationally wrong. In real deployments, execution is bounded by testing requirements, scope limits, access restrictions, traceability expectations, and domain-specific operating rules [^17] [^9] [^156] [^129] [^95]. + +Once externalized, those constraints stop being merely post hoc evaluation criteria and become part of the skill itself. They can shape preconditions, block unsafe branches, require intermediate validation, or define evidence that must be produced before completion. This is what lets skills encode not only how to perform a task, but also how to perform it within organizational and safety boundaries. In mature systems, that makes skills carriers of governance as much as carriers of capability. + +Taken together, operational procedures provide structure, decision heuristics provide local policy, and normative constraints provide acceptable boundaries. A skill is reusable only when all three are specified well enough to survive across tasks, contexts, and runs. That is why skills sit above action interfaces and beside memory: they externalize not past state and not raw execution primitives, but repeatable task know-how. + +### 4.2 From Execution Primitives to Capability Packages + +Skill systems do not emerge in isolation, but they should also not be conflated with tool use. Historically, skills are downstream of two earlier developments: reliable action invocation and large-scale action selection. Those stages expanded what an agent could *do*, but not yet how a class of tasks should be carried out repeatedly. Skills appear only when procedural organization itself becomes an explicit reusable artifact. + +#### 4.2.1 Stage 1: Atomic Execution Primitives + +The first stage equips language models with reliable action execution, for example through structured tool invocation and function-calling interfaces. Toolformer is representative in showing that models can learn when to call tools, how to construct arguments, and how to incorporate results [^129]. The key achievement at this stage is stable access to atomic action units. What it does *not* provide is an explicit reusable procedure for completing a broader class of tasks. The unit is the action primitive, not the skill. + +#### 4.2.2 Stage 2: Large-scale Primitive Selection + +As the number of callable tools grows, the problem shifts from invocation to selection. Work such as Gorilla, ToolLLM, ToolNet, ToolScope, and AutoTool shows that models can retrieve, rank, and dynamically choose among large tool collections [^117] [^121] [^91] [^88] [^204]. This is a major step toward scalable action selection, but the unit remains the tool rather than the procedure. Even when multi-step behavior begins to emerge, the know-how for accomplishing a task class is still largely implicit in prompts or parameters rather than externalized as a bounded reusable artifact. + +#### 4.2.3 Stage 3: Skill as Packaged Expertise + +The third stage marks a further shift in abstraction. The central question is no longer whether a model can invoke a function or retrieve an appropriate API, but whether the know-how required to complete a class of tasks can be packaged into reusable capability units. In this stage, the fundamental unit of capability is no longer an isolated tool call, but a higher-level artifact centered on reusable procedural guidance and execution structure [^153] [^20]. Rather than merely specifying what can be done, a skill increasingly captures how a task should be carried out through reusable procedural organization [^81]. + +Recent work makes this transition increasingly explicit. Program-based skill induction compiles primitive actions into higher-level reusable skills, showing that agent capabilities can be represented as executable procedural abstractions rather than one-off invocations [^153]. In web environments, interaction trajectories can be distilled into reusable skill libraries or skill APIs, allowing agents to accumulate and refine transferable know-how across tasks [^195]. In computer-use settings, skills are further organized as parameterized execution and composition graphs, with retrieval, argument instantiation, and failure recovery operating at the skill level rather than the level of individual interface actions [^20]. Related work on SOP-guided agents likewise shows that domain expertise can be externalized as explicit procedural structures that guide execution according to domain-specific procedures [^179]. + +Compared with earlier stages, the key transformation here is representational rather than merely operational. Capability is no longer treated primarily as access to tools or APIs, but increasingly as packaged procedural knowledge that can be loaded, reused, and composed across tasks [^81] [^166]. In this sense, Stage 3 does not simply make tool use more complex, but it reflects a shift toward representing agent capability as externalized and reusable procedural know-how. + +### 4.3 How Skills Are Externalized + +Skill externalization is not exhausted by writing down instructions. In mature agent systems, the crucial issue is whether procedural expertise can be represented in a form that is discoverable, loadable, interpretable, bindable, and executable at runtime. Therefore, skill externalization involves both a representational layer and a runtime layer. The former determines how a skill is described and delimited, while the latter determines whether it can actually function as a reusable capability during task execution [^166]. In harness terms, a skill only becomes real when the runtime can decide when to load it, which memory to condition it on, and which tools, files, or subagents to bind it to. That binding requirement does not make skills identical to tools or protocols; it simply means that procedural expertise must eventually be grounded in executable interfaces. + +#### 4.3.1 Specification + +The externalization of a skill begins at the specification layer. Typical forms include SKILL.md, instruction files, manifests, or other declarative specification artifacts. These artifacts describe what a skill does, what scenarios it applies to, what dependencies it assumes, what constraints it must satisfy, and under what input-output conditions it should operate. A skill specification resembles API documentation more than API implementation. Its value lies in turning procedural expertise from an opaque internal state into an explicit object that can be inspected, discussed, revised, and governed [^86]. + +A well-formed skill specification should ideally cover at least five kinds of information, namely capability boundaries, scope of applicability, preconditions, execution constraints, and examples together with counterexamples. The first two clarify what kinds of problems the skill is intended to solve. The next two clarify when it can be used safely and under what operating assumptions. The final category helps anchor the intended usage pattern in concrete cases, thereby reducing underspecified interpretation by the model. Through such structured specification, a skill is elevated from an unstructured prompting trick to a bounded capability description, which in turn provides the foundation for discovery, loading, version control, and governance. + +#### 4.3.2 Discovery + +Once skills become explicit artifacts, they naturally introduce the problem of registration and discovery. In realistic settings, an agent cannot indiscriminately load every available skill for every task. It therefore requires some form of registry and discovery mechanism to support selective retrieval. A skill may be published to a local repository, an organizational registry, or a platform-level marketplace, while the agent searches for relevant candidates based on task goals, context state, and environmental conditions [^195]. + +This discovery process may rely on semantic retrieval, structured metadata, task decomposition, or combinations of these strategies, depending on the system design. The key point is that the system is not merely asking which tool can be called. It is asking which unit of procedural expertise is appropriate for the present problem. This makes skill discovery a higher-level matching problem. It must consider not only topic similarity, but also task complexity, environmental assumptions, operational constraints, and risk conditions. A skill should therefore be retrieved not simply because its keywords overlap with the task description, but because it is genuinely compatible with the semantic and operational structure of the current task [^128]. Skill externalization is incomplete if a skill is merely stored. It must also be retrievable under realistic task conditions. + +#### 4.3.3 Progressive Disclosure + +The discovery of a skill does not imply that its full contents should immediately be injected into the active context. Because long context does not reliably translate into better performance, detailed instructions can become a source of reasoning noise rather than a source of guidance. For this reason, current skill systems often benefit from a progressive disclosure strategy in which the existence of a skill is exposed first, and deeper detail is loaded only when needed [^166]. + +In current industrial implementations, this often takes a layered form. At a minimal level, the model sees only the name of the skill together with a brief description, which is sufficient to signal that the capability exists. A deeper level may expose manifest-like information such as applicability conditions, required prerequisites, and major constraints. Only at the deepest level does the system load the full guide, including detailed procedures, exception handling, examples, and supporting files. The purpose of such staged loading is not simply to compress documentation. More fundamentally, it turns the question of whether more skill detail is needed into a runtime decision in its own right. In this way, the informational density of the skill can be matched to the complexity of the current task rather than saturating the context with unnecessary detail from the outset. This design is especially visible in current industrial implementations of skills, such as Claude Code’s skill system [^5]. + +#### 4.3.4 Execution Binding + +A skill remains a cognitive-level description unless it is connected to executable action. Actual task completion therefore depends on a binding process that translates the natural-language or structured specification of a skill into concrete operations in the current environment. It is precisely at this point that the distinction between skills, tools, and protocols becomes clear. + +A skill is usually not itself an action executor. Instead, it must be bound to a lower-level runtime substrate, such as tools, files, APIs, sub-agents, protocol endpoints, or other execution interfaces. A skill may specify that the agent should search relevant code, run tests, and summarize the resulting diff, but the actions themselves are carried out by search tools, file operations, shell commands, and test runners. Tools therefore provide the executable operations; protocols govern how those operations are described and invoked; skills provide the higher-level strategy for combining them into repeatable task completion. + +This binding typically requires an intermediate interpretation layer that determines, in the current context, which skill steps should be activated, which primitives should be bound, which conditions should trigger branching, and which constraints should take priority. Without such an interpretation and binding process, a skill easily remains a static artifact that is readable in principle but unusable in practice. More generally, schema-based interfaces such as MCP [^3] support this runtime binding layer by making capabilities discoverable and invocable without collapsing skills into tools or protocols themselves. + +#### 4.3.5 Composition + +The value of a skill system is most fully realized when skills can be composed. Unlike atomic tools, skills can participate in higher-order structured coordination, allowing complex tasks to be decomposed into the cooperation of multiple capability packages. Common composition patterns include serial execution, parallel division of labor, conditional routing, and recursive invocation of sub-skills within a higher-level skill [^140]. + +This compositionality means that a skill is not merely a document intended for model consumption, but a schedulable runtime unit inside an agent architecture. More importantly, composition is not just the concatenation of multiple procedural fragments. It is a higher-level reuse of procedural expertise itself. For example, a skill for producing a data analysis report need not be implemented as a monolithic end-to-end procedure. It can instead be organized as a coordinated composition of smaller skills for data cleaning, statistical analysis, visualization, and narrative synthesis. In this way, the system gains not only stronger task performance, but also better maintainability, replaceability, and auditability. Composition therefore marks the point at which skills become a genuine capability layer rather than a collection of isolated recipes [^182]. + +Overall, skill externalization should not be understood as the mere publication of a static instruction file. It is a coordinated process in which procedural expertise is specified, made discoverable, selectively disclosed, bound to executable substrates, and composed into larger capability structures. What matters is not only whether a skill can be written down, but whether it can reliably enter the agent’s runtime as a usable unit of action that interoperates with retrieved state and protocolized interfaces. Hence, the externalization of skills marks a shift from informal prompting toward a more explicit capability layer for agent systems. + +### 4.4 Skill Acquisition and Evolution + +A skill system matters not only because it stores authored instructions, but because it provides a pathway for turning successful behavior into reusable expertise. Skill acquisition is therefore better understood as an evolutionary process in which procedural knowledge is written, extracted, discovered, and recomposed over time [^166]. + +##### Authored. + +Manual authoring remains the most common and stable route by which skills enter current systems. Whether in the form of SKILL.md, AGENTS.md, project-level instruction files, or organizational SOP templates, these artifacts are all instances of human-designed procedural capability packages. Their importance lies not only in providing initial capability, but also in supporting iterative revision. When an agent repeatedly exhibits a failure pattern in deployment, engineers can update the corresponding skill so that one observed failure becomes a clarified procedure or an added constraint. In this way, authored skill documentation is not merely descriptive. It also serves as a practical interface through which operational experience is gradually turned into reusable behavioral structure [^86]. + +##### Distilled. + +Skills may also be induced from historical trajectories, practice traces, or other stored experience. Episodic records preserve what the agent previously did and why a trajectory succeeded or failed. When certain successful structures recur across tasks, the system can abstract these patterns into more stable procedural units. In this sense, memory preserves experience, while skill induction extracts the reusable structure within it. Existing evidence supports this most directly when the process is framed as induction from interaction traces rather than as a broad claim that memory automatically becomes skill. Skill Set Optimization, for instance, extracts transferable skills from rewarding sub-trajectories [^105]. In memory-management settings, MemSkill further shows that some memory operations themselves can be reformulated as learnable and evolvable skills [^185]. + +##### Discovered. + +Beyond manual authoring and post hoc distillation, agents may also autonomously discover new skills through environmental interaction. Voyager provides an influential example in the Minecraft setting, where exploration, execution feedback, self-verification, and curriculum-driven task selection jointly produce an ever-growing skill library of executable code [^140]. More recent work suggests that this discovery process can also be oriented toward generalization. PolySkill, for example, improves skill reuse by separating abstract goals from concrete implementations [^182]. Once an agent can identify behavioral patterns that repeatedly succeed and elevate them into explicit skills, the skill library becomes not only a storage layer but also a mechanism for capability growth. + +##### Composed. + +Finally, skills can evolve through composition. Many higher-level capabilities are not invented from scratch, but assembled from existing lower-level or mid-level skills. A complex workflow such as report generation or code repair may emerge from the repeated coordination of smaller capabilities. Composition matters here not only as an execution strategy but also as an acquisition mechanism. Once a particular combination of existing skills is repeatedly validated as effective, that combination can itself be packaged as a new higher-level skill. In this way, composition generates new reusable units and gradually gives rise to hierarchical skill repertoires rather than flat lists of isolated capabilities [^153]. + +Overall, skill acquisition is not a one-time design step but a continuing process of writing, extracting, discovering, and recomposing procedural knowledge. A mature skill system is therefore defined less by how many instructions it stores than by how effectively it turns experience into reusable externalized expertise. In a harnessed agent, this evolutionary loop is itself systematized: memory provides the evidence, evaluators decide what merits promotion, and protocolized execution surfaces determine whether a candidate skill can actually be deployed. + +### 4.5 Boundary Conditions + +Skill externalization improves reuse and governance, but it does not guarantee reliability. Once procedural expertise is externalized as an explicit artifact, its effectiveness becomes conditional on how well the artifact matches the task, the environment, and the runtime in which it is used. In practice, the main boundary conditions concern semantic alignment, portability and staleness, unsafe composition, and context-dependent degradation. + +##### Semantic alignment. + +A skill specification expresses intent and guidance in natural language or lightweight structured form, while actual execution depends on concrete tools, APIs, and environmental constraints. As a result, a model may follow the literal wording of a skill while still missing the real objective of the task. Existing evidence suggests that the effectiveness of skills depends heavily on the alignment between task intent, skill description, and invocation decision. SkillProbe identifies semantic-behavioral inconsistency as a fundamental flaw in existing skill marketplaces [^52]. Related work on tool-use decision making likewise shows that the key difficulty is often not only whether an external capability can be called, but whether it should be called under the current interpretation of the task [^128]. This suggests that externalized skills remain sensitive to mismatches between description and use. + +##### Portability and staleness. + +Even when a skill is internally coherent, its validity across environments cannot be assumed. Changes in websites, APIs, dependencies, workflows, or runtime conventions can make a once-effective skill partially misleading or entirely obsolete. More broadly, heterogeneity across agent frameworks, tool substrates, and base models means that the same skill may not behave consistently across settings. Programmatic-skill work already shows that some induced skills transfer across websites while incompatible ones must be updated to accommodate environmental change [^153]. SkillsBench further indicates that skill utility varies substantially across domains and model-agent configurations [^81]. The broader implication is that skill portability is best treated as a conditional empirical property rather than an intrinsic feature of externalization. + +##### Unsafe composition. + +Composition makes skills more powerful, but it also creates new risks. Skills that appear harmless in isolation may interact unsafely when combined, especially when they bundle long-form instructions, executable scripts, and external dependencies. In such cases, the problem is not confined to a single skill artifact, but emerges from the interaction among multiple artifacts and the interfaces that connect them. This is one of the boundary conditions for which direct evidence is now available. Large-scale empirical studies of public skill ecosystems report substantial rates of vulnerabilities, including prompt injection, data exfiltration, privilege escalation, and supply-chain risk [^92]. Attack-oriented studies further show that skill files themselves can become realistic prompt-injection surfaces for current agents [^144]. Skill composition should therefore be treated as a security-sensitive process rather than a purely benign form of modular reuse. + +##### Context-dependent degradation. + +A further difficulty is that skill execution can degrade over extended interaction. Even when a skill file has been updated, the agent may continue to follow outdated operational logic because of residual session context, cached summaries, or previously reinforced action patterns. At the same time, detailed skill guides can interfere with global task tracking when too much local procedural detail is injected into the context. In such cases, the model may execute the instructions carefully while losing sight of the true success condition. Direct skill-specific evidence for these effects is still limited, but adjacent work on multi-turn drift, long-horizon reliability, and long-context reasoning strongly suggests that they are realistic boundary conditions [^74]. Skill loading should therefore be treated not only as a retrieval problem, but also as a problem of context allocation and execution stability. + +Taken together, these boundary conditions show that a skill is not a self-sufficient module that remains stable once written. Its effectiveness depends on continued alignment with tasks, environments, runtime conditions, and security constraints. Skills should therefore be treated not as isolated artifacts, but as components embedded in a broader engineering framework. This is precisely why skill design ultimately points beyond the artifact itself toward harness engineering. + +### 4.6 Skills in the Harness + +The boundary conditions above show that skills cannot be evaluated as standalone artifacts. Their reliability depends on how they are situated within a running system. This section examines how skills become operational once embedded in a harness, focusing on the couplings that connect them to memory, protocols, and runtime governance. + +##### Conditioning on memory. + +A skill is selected and parameterized in light of retrieved state. The harness queries memory for task history, prior outcomes, user-specific context, and environmental constraints, then uses that evidence to decide which skill to load, which parameters to instantiate, and which branches to prefer. Without this conditioning loop, skill selection degenerates into keyword matching against task descriptions. With it, the same skill can be applied differently depending on what the agent has previously learned. Memory therefore supplies the situational evidence that makes skill choice contextual rather than generic. + +##### Binding through protocols. + +Once selected, a skill must be grounded in executable action. That grounding passes through protocolized interfaces: tool schemas, subagent delegation contracts, file operations, and approval workflows. The harness mediates this binding by resolving which protocol endpoints are currently available, checking permissions, and routing skill steps to the appropriate execution substrates. Skills and protocols are therefore complementary: skills specify what should be done; protocols specify how the resulting actions are described, invoked, and governed. + +##### Runtime governance. + +In production settings, the harness also imposes governance over skill execution. This includes permission checks before sensitive operations, approval gates for high-risk steps, audit logging of which skill was loaded and what actions it produced, and rollback mechanisms when execution fails partway through a multi-step procedure. These controls are not part of the skill artifact itself; they are properties of the harness environment in which the skill runs. A skill that is safe and effective in a sandboxed development context may require additional constraints in a production deployment, and the harness is the layer that enforces those constraints. + +##### Lifecycle feedback. + +Finally, the harness closes the loop between skill execution and skill evolution. Execution traces, success rates, failure patterns, and user corrections are written back into memory. Over time, that evidence may trigger skill revision, deprecation, or the promotion of new candidate skills. The harness therefore does not merely host skills; it provides the feedback infrastructure through which skills improve. This loop connects skill acquisition (Section 4.4) to runtime operation: authored or discovered skills enter the harness, the harness governs their execution, and execution outcomes feed back into the evidence base from which future skills are derived. + +### 4.7 Skill as Cognitive Artifact + +The following interpretation is primarily theoretical rather than directly empirical. It draws on classic work on cognitive artifacts to help explain why externalized skills can improve the organization of procedural expertise, rather than to claim that these theories were originally developed for LLM agents. + +From the perspective of Norman’s theory of cognitive artifacts, a skill system can be understood as a representational transformation along the dimension of capability organization [^104]. Without externalized skills, a model must repeatedly reconstruct procedural knowledge from internal parameters during task execution. With skills, part of that procedural burden is moved into an explicit external representation that can be loaded, inspected, and followed. This shifts the task from unstable latent procedural recall toward a more stable process of recognizing applicable guidance and acting under it. In that respect, the role of a skill file is closely analogous to Norman’s analysis of how an external list changes the nature of remembering. The crucial point is not simply that extra information has been added. It is that the form of the cognitive task itself has been reorganized. + +This reorganization matters because it changes what the model must do at inference time. In the absence of a skill, the model must probabilistically recover an appropriate way of proceeding from its parameters under the pressure of the current context. Once the skill has been externalized, the procedural structure is already present as an object in the environment. The model’s burden shifts toward interpreting the current situation, recognizing whether the skill applies, following the relevant guidance, and handling local exceptions. Procedural knowledge is therefore no longer something that must be reconstructed from scratch on each run. It becomes an external object that can be operated on directly [^81] [^166]. + +This interpretation also aligns with Kirsh’s notion of complementary strategies, according to which agents improve performance not only by thinking harder internally, but also by reorganizing the external environment so that some cognitive work is offloaded into it [^68]. LLMs are often not especially reliable at reproducing long multi-step procedures in a stable and repeatable manner. The same prompt may yield different decompositions, branching decisions, or stopping conditions across runs. By contrast, they are comparatively better at reading explicit guidance, matching it to the current context, and adapting execution locally under stated constraints. A skill can therefore be understood as an engineered complementary strategy. It externalizes procedure definitions, constraints, and portions of best practice into an artifact, while leaving interpretation, contextual matching, and exception handling to the model itself. + +A skill does not simply add more information to the system. It changes how capability is organized. Procedural expertise is moved out of an opaque and difficult-to-audit parameter space into an inspectable, revisable, and composable external structure. That is why the significance of skills lies not merely in engineering convenience, but in a deeper reallocation of where know-how resides and how it becomes available for reuse. Seen in this light, skills are better understood not simply as prompts or tool wrappers, but as cognitive artifacts for organizing procedural competence in agent systems. At system scale, they externalize procedural burden by converting repeated workflow invention into selection, loading, and composition under runtime control. + +## 5 Externalized Interaction: Protocols + +Protocols externalize the interaction burden of agency. A bare model may infer that a tool should be called, a subagent should be delegated to, or a response should be shown to a user, but without explicit contracts it must also improvise message formats, argument structure, lifecycle semantics, permissions, and recovery behavior. That burden turns every external action into a fragile prompt-following exercise. + +Within a harness, this protocol layer is where interaction becomes governable. It mediates how tools are discovered, how subagents are contacted, how user-facing state is exposed, how session progress is represented, and how permissions and failures are enforced. A protocol is therefore not a memory store and not a skill description: it specifies the contract by which state, requests, and actions move across system boundaries. The present section therefore examines what interaction burdens protocols externalize, why that externalization matters, how the current protocol landscape is organized, how protocols become operational inside a harness, and how the resulting transformation can be understood through the lens of cognitive artifacts. Section 6 identifies the content of interaction that is externalized; Section 5.1 motivates the benefits; Section 5.2 surveys the protocol families; Section 5.3 examines harness-level integration; and Section 5.4 closes the chapter with a cognitive-artifact interpretation. + +![[protocol_f.png|Refer to caption]] + +Figure 6: Protocols as externalized interaction. Upper panel: The evolutionary trajectory of agent interaction—from isolated model calls with limited model-to-model communication, through hardcoded API connections, to standardized protocols that provide unified interaction, task allocation, tool integration, and secure access, and ultimately toward a decentralized and networked agentic web. Lower panel: The harness implements externalized interaction management through three functional surfaces: Interact (interfacing with external APIs, tools, and environments), Perceive (perception of environment, context, memory, and feedback), and Collaborate (collaboration with other LLMs, agents, and humans). + +If memory externalizes temporal state and skills externalize procedural expertise, protocols externalize the contracts that govern how an agent exchanges information and actions with entities outside itself. The representational shift is from free-form communicative inference to structured exchange. Instead of asking the model to invent the syntax and semantics of interaction at runtime, protocols provide typed surfaces, state transitions, and machine-readable constraints that the model can fill and follow. In that sense, protocols do not merely accelerate communication; they change the task from negotiating ad hoc interfaces to operating within explicit contracts. + +More concretely, what protocols externalize can be organized along four dimensions: + +##### Invocation grammar. + +Every tool call, API request, or delegation message requires a format: argument names, types, ordering, and return structure. Without protocols, the model must infer or reinvent this grammar on each call. Protocols externalize it into schemas and typed interfaces, so the model fills fields rather than guessing syntax. + +##### Lifecycle semantics. + +Multi-step interactions need coordination: who acts next, what state transitions are allowed, when a task is complete or has failed. Protocols externalize these sequencing rules into explicit state machines or event streams, removing them from the model’s inferential burden. + +##### Permission and trust boundaries. + +Real-world agent actions are bounded by who is authorized, what data may flow where, and what evidence must be produced. Protocols externalize these constraints into inspectable rules that a runtime can enforce, rather than relying on the model to self-police. + +##### Discovery metadata. + +Before an agent can interact with a tool or another agent, it must know what capabilities are available and how to reach them. Protocols externalize this discovery problem into registries, capability cards, and schema endpoints, replacing implicit prompt-embedded knowledge with queryable metadata. + +These four dimensions are not independent—a single protocol may address several at once—but they clarify the scope of what is being externalized. Tools expose operations; skills encode how classes of tasks should be carried out with those operations; protocols specify the interaction grammar, lifecycle, permissions, and discovery mechanisms through which operations and skills become executable across system boundaries. + +### 5.1 Why Protocols Matter + +The importance of Agent Protocols follows directly from the burden they externalize: without them, every interaction is partly an inference problem about format, legitimacy, and coordination. Their benefits are easiest to see along three dimensions. + +##### Unified interaction standards. + +Protocols give tools, agents, and frontends a shared grammar for discovery, invocation, handoff, and state exchange. Without that layer, the ecosystem fractures into local prompt-plus-parser integrations that do not travel well across runtimes [^174]. Standardized interaction makes interoperability a designed property rather than a fortunate accident [^36]. It is also the precondition for stable multi-agent collaboration, because delegation and context transfer need common representations before they can be automated. + +##### Improved security, governance, and auditability. + +Once agents operate in real environments, the question is not only whether they can act, but whether those actions remain bounded, inspectable, and recoverable [^119]. Protocols help by making permissions, identity, execution traces, failure states, and responsibility boundaries explicit. That turns previously implicit glue logic into something a runtime can validate and an operator can audit. + +##### Reduced vendor dependence. + +Open interaction contracts also preserve architectural flexibility. If the system accumulates capability at the protocol layer rather than inside provider-specific interfaces, models, vendors, and runtime components can be swapped with less rewiring. Protocols are therefore not only engineering conveniences; they are part of the mechanism by which an agent ecosystem remains portable and evolvable over time [^174]. + +### 5.2 Agent Protocol Survey + +In this section, we classify popular Agent Protocols in the community into agent-tool, agent-agent, agent-user, and other protocol families according to the different entities they are designed to interact with, and briefly introduce several representative and commonly used protocols in each category. The purpose of this survey is not to catalogue every emerging standard, but to show that contemporary protocols externalize different slices of interaction burden: some stabilize tool invocation, some stabilize delegation among agents, some stabilize the agent-user boundary, and some govern high-risk vertical workflows. + +#### 5.2.1 Agent-Tool Protocols + +Agent-Tool Protocols were among the earliest protocol families to mature because tool access is where interface fragmentation appears first. MCP [^4] is the clearest representative. It provides a standardized way for agents to discover tools, inspect their schemas, and invoke them across heterogeneous services. The problem it addresses is straightforward: without a shared contract, every new tool requires bespoke integration logic, duplicated schema definitions, and provider-specific adaptation. + +The boundary with neighboring layers is important. MCP and related protocols specify how tools are described and invoked; they do not specify which multi-step procedure should be followed with those tools, and they do not themselves preserve cross-session cognition once results have been produced. Those roles belong to skills and memory respectively. + +Architecturally, MCP turns tool access into protocol-based integration rather than interface-by-interface engineering. Servers expose tools and context resources through a common structure, typically over JSON-RPC 2.0, while clients perform discovery and invocation against that shared specification. This decouples tool ecosystems from model-provider-specific function-calling formats and lowers the cost of adding new capabilities. The practical gains are straightforward: dynamic capability discovery, standardized access to complex external systems, structured request/response exchange, and modular extensibility. + +The same separation also improves governance. Because invocation is mediated by a protocol layer rather than emitted as an unconstrained model-generated call, sensitive data handling, permission checks, and audit boundaries can be managed more explicitly. ToolUniverse and related systems extend this logic with more specialized tool schemas and interaction conventions [^42] [^41]. The broad point is that agent-tool protocols externalize invocation grammar so that tool use becomes portable, inspectable, and scalable rather than an accumulation of bespoke adapters. + +#### 5.2.2 Agent-Agent Protocols + +As soon as multiple agents collaborate, interaction itself becomes a systems problem. Agent-Agent protocols define how capabilities are discovered, how tasks are delegated, how progress and partial state are exchanged, and how results return to the caller. They externalize coordination that would otherwise be buried in prompt conventions or framework-specific glue. + +A2A [^47] is the most visible current example. It standardizes capability discovery through artifacts such as Agent Cards and supports task-oriented communication, state updates, negotiation, and streaming progress between heterogeneous agents. Its importance is not only that agents can message one another, but that delegation becomes structured: the caller can discover what another agent offers, hand off work under a known contract, and track execution without relying on hard-coded assumptions. + +Other protocols make different trade-offs. ACP [^61] emphasizes lightweight adoption through familiar REST/HTTP patterns and fits settings where compatibility with existing services matters more than rich negotiation. ANP [^15] pushes in the opposite direction, aiming at open, Internet-scale interoperability with decentralized identity, cross-domain discovery, and secure end-to-end communication. + +Taken together, these protocols show that multi-agent systems need more than message transport. They need standardized semantics for delegation, identity, status, and handoff. That is what lets coordination scale from local orchestration to open agent ecosystems [^174] [^37]. + +#### 5.2.3 Agent-User Protocols + +Agent-User Protocols formalize the boundary between agent runtimes and user-facing systems. They address a different problem from tool or agent-agent protocols: not how an action is executed elsewhere, but how execution state, outputs, and interface structure are exposed to humans in a form that frontends can render and users can understand [^48] [^27]. + +A2UI [^48] represents the interface-generation branch. It lets an agent describe UI structure in a constrained declarative format that host applications can render safely across platforms. The protocol matters because it treats interface construction itself as governed output rather than arbitrary HTML-like text. + +AG-UI [^27] represents the streaming-state branch. It standardizes typed execution events such as run start, text emission, tool call arguments, tool call results, completion, and error. Frontends can subscribe to that event stream and render runtime status without learning each framework’s private event format. + +These two directions are complementary. A2UI externalizes interface composition; AG-UI externalizes the live state transitions behind that interface. Together they show how protocolization makes human-agent interaction more observable, reusable, and portable across hosts. + +#### 5.2.4 Other Protocols + +Beyond general interaction families, some protocols target high-risk vertical workflows where generic interfaces are not enough. UCP [^49] does this for agentic commerce by standardizing catalogs, requests, and checkout flows so that agents, merchants, and payment providers can interoperate without bespoke integration for every store. AP2 [^51] does the same for payments, emphasizing authorization, signatures, auditability, and proof-bearing transaction objects such as IntentMandate, PaymentMandate, and PaymentReceipt. + +These domain protocols matter because they externalize workflow-specific governance, not just generic communication. In vertical settings such as shopping, payments, identity, or compliance, the protocol must encode who is authorized, what evidence must be produced, and how responsibility is tracked across the flow [^139]. Across all families, the common pattern is that protocols make a coordination problem explicit. Tool protocols externalize invocation grammar, agent-agent protocols externalize delegation, agent-user protocols externalize presentation and state streaming, and domain protocols externalize specialized governance. + +### 5.3 Agent Protocol in Harness Engineering + +If the survey above shows which interaction burdens are being externalized in the ecosystem, Harness Engineering shows how those protocol surfaces become part of a running agent. The question is no longer only how an agent ought to communicate with other entities, but how those communication contracts govern execution, persistence, delegation, and recovery once the agent is embedded in a runtime. + +Traditional LLM pipelines rely on the model to infer formats, remember recent interaction state, and guess how external actions should be formed. That can be adequate for short, loosely coupled requests, but it breaks down when work spans many steps, tools, agents, or approval boundaries. Harness Engineering externalizes that burden into protocol surfaces. Model outputs are captured as structured intents, validated against permissions and lifecycle state, routed through typed interfaces, and reflected back into the runtime as governed events rather than free-form guesses. + +#### 5.3.1 Intent Capture and Normalization + +Intent capture and normalization is the first of those surfaces. The job of this layer is to translate model-produced language into explicit commands or events that the runtime can validate and act on. Without it, execution semantics remain implicit: the system guesses what the model meant, and small linguistic variations can produce large operational differences. + +A mature harness therefore normalizes intent before execution. Free-text proposals are mapped into protocol objects, checked against current context and permission boundaries, and rejected or revised if they do not satisfy the contract. This does not remove model judgment; it relocates the fragile part of the interaction from latent inference to an inspectable interface. The result is higher reliability in long-horizon execution, stronger governance, and cleaner handoffs across tools, agents, and users. + +#### 5.3.2 Capability Discovery and Tool Description + +Capability discovery and tool description form the second surface. In older systems, knowledge of available tools often lives partly in prompts and partly in developer assumptions. Protocolized discovery replaces that with explicit metadata. At session start or phase transitions, the runtime exposes the currently available tools, their schemas, and their input/output structure through standardized messages. + +That shift has two effects. It reduces context inflation because the model does not need to carry every tool contract in prompt, and it makes capability boundaries governable because permissions, versioning, and auditing can be enforced against structured metadata rather than inferred from model behavior. In other words, the agent stops guessing what can be called and starts reading a declared capability surface. + +#### 5.3.3 Session and Lifecycle Management + +Harness protocols also need explicit session and lifecycle management because long-horizon agents do not operate as isolated single calls [^14]. The runtime must preserve interaction state across multiple turns, context windows, and execution phases. What is preserved here is not durable memory in the full sense, but protocol state: identifiers, roles, pending actions, phase transitions, and allowed next moves. + +Most long-running systems therefore treat an execution as a lifecycle object with named states and transition rules. The protocol layer advances that object, emits status changes, and coordinates checkpoint or recovery events. When outputs or checkpoints are written to persistent storage, they become memory. The distinction matters: protocol maintains continuity of interaction; memory maintains continuity across time. + +### 5.4 Protocol as Cognitive Artifact + +The preceding sections surveyed the content, landscape, and harness integration of agent protocols. This final section interprets what protocol externalization achieves as a representational transformation, using the same cognitive-artifact framework applied to memory and skills in earlier chapters. + +In Norman’s terms, a cognitive artifact transforms a task by changing its representational structure [^104]. Protocols do this for interaction. Without them, every external action is partly a natural-language inference problem: the model must infer the intended operation, guess the right format, reconstruct acceptable constraints, and hope the receiving system interprets the result correctly. Protocols replace that open-ended inference with a bounded, structured task: fill typed fields, follow a declared state transition, and receive structured feedback. The model still needs judgment about whether and when to act, but it no longer needs to reinvent the syntax and semantics of interaction on each step. + +This is one of the strongest forms of externalization in agent systems, because it removes entire classes of reasoning from the critical path. The transformation is analogous to the shift that memory introduces for temporal state (Section 3.4) and that skills introduce for procedural expertise (Section 4.7), but it operates on a different dimension: not what to remember or how to proceed, but how to communicate and coordinate. Standardized protocols reduce the number of decisions that must be made inside the model. They make correct interaction easier and incorrect interaction harder—which is precisely what Norman’s framework predicts when an external representation is well matched to the task. + +Kirsh’s account of complementary strategies provides additional clarity [^68]. LLMs are strong at interpreting intent, selecting among options, and adapting to context, but they are unreliable at consistently producing well-formed structured output under varying interface requirements. Protocols implement a complementary division of labor: the model contributes judgment and intent, while the protocol surface contributes format, validation, and lifecycle control. Neither side alone is sufficient; together, they produce interaction that is both flexible and disciplined. + +This interpretation also explains why protocols serve a distinctive role that cannot be reduced to memory or skills. Memory externalizes what has been learned over time; skills externalize how tasks should be carried out; protocols externalize the discipline by which both memory and skills enter the world as governed action. Memory needs governed read and write paths; skills need bindable interfaces; both depend on protocols to cross system boundaries in a form that is inspectable, auditable, and recoverable. Protocols are therefore not secondary plumbing around a “real” intelligent core. They are cognitive artifacts for interaction—the representational infrastructure that makes other forms of externalized intelligence operational. + +## 6 Unified Externalization: Harness Engineering + +![[x2.png|Refer to caption]] + +Figure 7: The harness as cognitive environment. The Foundation Model (Agent Core) sits at the center; six harness dimensions form a coordinated ring around it. Three externalization modules— Memory (state persistence, failure recording, cross-session context), Skills (reusable routines, staged loading, failure-driven revision), and Protocols (deterministic interfaces, structured invocation, schema contracts)—supply the externalized cognitive content. Three operational surfaces— Permission (sandboxing, filesystem isolation, network restrictions), Control (recursion bounds, cost ceilings, timeout), and Observability (structured logging, execution traces, aggregate metrics)—govern how that content is accessed, constrained, and monitored at runtime. Arrows indicate the continuous flow among dimensions within the harness loop. + +Figure 7 provides an overview: the foundation model sits at the center, surrounded by six harness dimensions that coordinate externalized cognition into coherent agency. Three of those dimensions—Memory, Skills, and Protocols—are the externalization modules analyzed in the preceding chapters (Sections 3–5). The remaining three—Permission, Control, and Observability—are the operational surfaces that govern how those modules are accessed, constrained, and monitored at runtime. This chapter unpacks these three surfaces into six finer-grained analytical dimensions that together characterize harness design. Each earlier chapter closed by noting that its module becomes fully operational only when embedded in a broader runtime. Sections 3.3, 4.6, and 5.3 identified specific harness demands from each module’s perspective. The present chapter unifies those threads. It asks what kind of system is needed to compose externalized memory, skills, and protocols into coherent agency, and how that system should be understood analytically. + +The central claim is that a harness is not merely an implementation convenience layered on top of a capable model. It is the designed cognitive environment within which externalized modules become jointly effective. That framing motivates the structure of this chapter. Section 6.1 defines the harness concept and situates it relative to the module-level analyses of earlier chapters. Section 6.2 identifies the recurring analytical dimensions along which harness designs vary. Section 6.3 examines how these dimensions manifest in contemporary agent systems. Section 6.4 closes the chapter by interpreting the harness as a cognitive environment through the lens of distributed cognition and cognitive artifact theory. + +### 6.1 What is a Harness? + +Externalization, pursued module by module, improves local capability, but agenthood demands global coordination. Memory accumulates experience without specifying which traces are salient to the present task. Skills encapsulate effective routines without automatically incorporating lessons from past interactions. Protocols regularize invocation formats without determining when, or under what policy, a tool should be called. The modules are present, yet the cognitive loop that would render them jointly effective remains under-specified. What is missing is a principled structure that coordinates their interaction over time—aligning perception, memory access, action selection, execution, monitoring, and revision within a single operational envelope. + +The term “harness” names that structure. It has recently entered practice as a descriptor for the scaffolding that converts raw model capability into reliable agent behavior. OpenAI’s engineering discussions around Codex, for instance, use the term explicitly to describe the agent loop, execution logic, feedback pathways, and surrounding operational machinery that make the system usable [^109]. Because the concept is still consolidating, the characterization we offer here is best understood as a synthesis of recurring patterns in current systems rather than a closed definition. + +A practical agent, on this account, is better understood as a model operating inside a harness than as a model with peripheral capabilities attached. A foundation model alone retains general-purpose inference ability, but lacks the operational structure that determines what it can access, how it may act, how its actions are constrained, and how its behavior is observed and revised across time. The harness supplies that structure. It governs the pathways by which the model encounters context, invokes tools, preserves state, and responds to feedback. Agency is therefore not located in the model alone; it emerges from the coupling of the model with the environment that organizes its cognition into action. + +Described functionally, the harness comprises the external systems that make such coupling possible: persistent memory and project-level context, reusable skills and executable routines, protocolized interfaces for deterministic interaction with tools and services, and the broader runtime infrastructure within which these elements become operational. The crucial point is not the exact inventory of components—which varies across implementations and will continue to evolve—but their collective role: they create the conditions under which model reasoning can be made stable enough to support sustained work. This shifts the locus of analytical attention from model capability alone to the representational, procedural, and operational conditions under which the model perceives, decides, and acts. Improvements in agency may therefore come not only from better base models, but also from better organization of memory, sharper constraint regimes, more legible feedback channels, and more carefully designed execution environments. + +### 6.2 Analytical Dimensions of Harness Design + +The modules discussed in earlier chapters—memory stores, skill artifacts, and protocol interfaces—supply the raw materials of externalized cognition, but they do not by themselves specify how the runtime coordinates perception, action, constraint, and feedback over time. That coordination is the province of the harness. The three operational surfaces highlighted in Figure 7—Permission, Control, and Observability—can be decomposed into six recurring dimensions of design variation. Each dimension addresses a distinct aspect of how externalized modules are composed into a functioning agent; together, they provide an analytical framework for comparing harness architectures rather than an implementation checklist. + +#### 6.2.1 Agent Loop and Control Flow + +The agent loop is the temporal backbone of the harness. At its simplest, it implements a perceive–retrieve–plan–act–observe cycle in which the model receives a structured view of the current state, decides on an action, executes it through a tool or protocol interface, observes the result, and updates its internal plan accordingly [^176] [^130]. Practical systems vary the loop structure considerably. Single-loop designs interleave reasoning and action within one generation pass; hierarchical designs separate a planning agent that decomposes goals from executor agents that carry out individual steps; and multi-agent designs route subtasks across specialized agents with distinct tool sets and permission scopes [^157] [^56] [^71]. + +What the harness adds beyond a bare loop is governance over termination, recursion, and resource consumption. Without explicit control, an agent loop can cycle indefinitely, escalate costs through unbounded tool calls, or recurse into sub-agent spawns that exhaust context or compute budgets. Production harnesses therefore enforce maximum step counts, recursion depth limits, per-step cost ceilings, and timeout constraints. These controls are not secondary safety measures; they define the operational envelope within which the agent’s reasoning unfolds. A well-tuned loop makes the agent more reliable not by making the model smarter, but by bounding the space of possible execution paths. + +#### 6.2.2 Sandboxing and Execution Isolation + +Whenever an agent acts on the world—writing files, executing shell commands, calling external APIs—the harness must decide how much of the environment to expose and how to contain unintended side effects. Sandboxing is the engineering response to that requirement. It creates a controlled execution boundary that limits what the agent can read, write, and modify, and it provides the reproducibility guarantees that make failures diagnosable and rollbacks feasible. + +Contemporary systems implement isolation at different granularities. Codex-style agents run each task inside a dedicated cloud sandbox with its own filesystem snapshot, network restrictions, and resource quotas, so that one execution cannot contaminate another [^149] [^172]. Claude Code takes a complementary approach by exposing graduated permission modes—from fully autonomous execution to mandatory user approval for every tool call—so that the same agent can operate at different trust levels depending on the task and the operator’s risk tolerance [^6]. In both cases, the sandbox is not merely a security fence. It is a cognitive boundary that simplifies the agent’s operating environment by removing irrelevant state, restricting dangerous actions, and making the workspace inspectable. Isolation thereby serves the same representational function as other forms of externalization: it changes what the model must reason about. + +#### 6.2.3 Human Oversight and Approval Gates + +Full autonomy is rarely appropriate for deployed agents. Most production systems therefore insert intervention points into the agent loop where a human operator can inspect proposed actions, approve or reject them, supply corrections, or redirect execution. The design question is where those gates should be placed and how much autonomy to grant between them. + +Three patterns are common. Pre-execution approval pauses the agent before every potentially consequential action and asks for explicit confirmation. Post-execution review lets the agent act but surfaces results for inspection before committing or continuing. Escalation triggers allow the agent to run autonomously under normal conditions but halt and request human input when specific risk signals are detected—such as actions involving sensitive data, irreversible operations, or confidence below a threshold. Hook systems generalize this pattern by allowing operators to attach arbitrary logic—shell scripts, validation checks, notification dispatches—to specific lifecycle events in the agent loop, such as tool invocation, file write, or subagent spawn [^72] [^40]. The level of autonomy is therefore not a binary property of the agent but a configurable parameter of the harness, adjustable per task, per tool, and per organizational policy. + +#### 6.2.4 Observability and Structured Feedback + +An agent that acts without leaving inspectable traces is an agent that cannot be debugged, audited, or improved. Observability is the harness surface that makes the agent’s internal trajectory visible to developers, operators, and the agent itself [^203] [^196]. + +At the implementation level, observability typically involves structured logging of every model invocation, tool call, memory read/write, and decision branch; execution traces that link each action to its causal antecedents; and aggregate metrics such as step counts, token consumption, error rates, and latency distributions. These records serve two distinct purposes. Externally, they support debugging, compliance auditing, and post-incident analysis [^119]. Internally, they close the feedback loop that connects execution outcomes back to the modules that produced them. A failed tool call can trigger a memory write that records the failure context; a pattern of repeated failures can flag a skill for revision; a latency spike can cause the harness to switch protocol paths. Without structured observability, these feedback loops cannot operate, and the harness remains a static scaffold rather than an adaptive system. Observability is therefore not an auxiliary convenience; it is the mechanism by which the harness learns from its own operation. + +#### 6.2.5 Configuration, Permissions, and Policy Encoding + +A harness must encode not only what an agent can do, but what it is allowed to do under what conditions. This requires a configuration layer that separates policy from execution logic and makes governance rules explicit, versionable, and auditable. + +In practice, configuration is typically stratified across multiple scopes. User-level settings encode personal preferences and trust boundaries. Project-level settings specify which tools are available, which file paths are accessible, and which commands require approval. Organization-level settings impose compliance constraints, cost ceilings, and data-handling rules that individual projects cannot override. This layered model means that the same base agent can operate under different policy regimes depending on its deployment context, without any change to the model or the skill artifacts it loads [^6] [^73]. Permissions and policies are therefore best understood as externalized governance: constraints that would otherwise have to be embedded in prompts or enforced through post-hoc filtering are instead encoded as declarative rules that the harness enforces at runtime. + +#### 6.2.6 Context Budget Management + +The context window remains the scarcest shared resource in any agent system. Memory retrieval, skill loading, protocol schemas, tool descriptions, and the model’s own reasoning traces all compete for the same finite token budget. How that budget is allocated is a harness-level coordination problem that no single module can solve on its own. + +Effective context management typically combines several strategies. Summarization compresses older conversation turns and execution history into shorter representations that preserve decision-relevant information while freeing tokens for the current step [^113]. Priority-based eviction removes or demotes context entries whose relevance to the active subtask has decayed. Staged loading—already discussed for skills in Section 4—ensures that detailed procedural guidance enters the context only when a matching task pattern is detected, rather than occupying budget from session start. The harness orchestrates these strategies jointly, because the optimal allocation depends on the current phase of execution: an early planning phase may need more memory and less skill detail, while a late execution phase may need the reverse. Context budget management is therefore not a compression problem in isolation. It is a dynamic resource-allocation problem whose solution must be informed by the agent’s current goals, the modules it is drawing on, and the constraints under which it operates. + +Taken together, these six dimensions—loop control, sandboxing, human oversight, observability, configuration, and context management—provide an analytical framework for characterizing harness architectures. None of them is a form of externalization in its own right; each is part of the coordinative infrastructure that makes memory, skills, and protocols function as a coherent system. The next subsection uses this framework to examine how contemporary agent systems instantiate these dimensions in practice. + +### 6.3 Harness in Practice: Contemporary Agent Systems + +The analytical dimensions identified above are not abstract desiderata; they correspond to concrete design choices observable across deployed agent systems. Contemporary production agents—such as OpenAI Codex [^109] and Anthropic Claude Code [^6] —differ substantially in product surface, implementation lineage, and target workflow, yet they converge on a strikingly similar set of harness structures. That convergence is analytically significant: it suggests that the six dimensions are not incidental implementation choices but structural requirements of externalized agency. The following discussion examines these recurring patterns without tracking any single system in detail. + +##### Loop and control flow. + +Mature agent systems uniformly organize execution around an explicit loop that interleaves model reasoning with tool invocation and environmental observation. The harness is distinguished from the underlying model and characterized as providing the core agent loop, execution logic, and feedback pathways. Crucially, the loop includes explicit termination control—step limits, recursion depth bounds, and resource ceilings—that define the operational envelope within which the model’s reasoning unfolds. + +##### Sandboxing. + +Current systems implement execution isolation at different granularities. Some run each task inside a dedicated cloud sandbox with its own filesystem snapshot, network restrictions, and resource quotas; others expose graduated permission modes so that the same agent can operate at different trust levels depending on the context. These designs occupy different points in the isolation design space, but they share a common principle: sandboxing functions as a cognitive boundary that simplifies the agent’s operating environment by removing irrelevant state and restricting dangerous actions, not merely as a security perimeter. + +##### Human oversight. + +Rather than treating autonomy as a binary property, deployed harnesses implement configurable approval gates—hook systems that attach validation logic to specific lifecycle events such as tool invocation, file write, or subagent spawn, and application layers that route high-risk actions through approval workflows [^72] [^40]. The level of autonomy becomes a parameter of the harness, adjustable per task, per tool, and per organizational policy. + +##### Observability. + +Production systems produce structured execution traces—logs of every model invocation, tool call, memory read/write, and decision branch—that support debugging, compliance auditing, and post-incident analysis [^119] [^203]. These traces also close internal feedback loops: failed tool calls can trigger memory writes, and patterns of repeated failures can flag skills for revision. Observability is therefore the mechanism by which the harness learns from its own operation. + +##### Configuration and governance. + +Deployed harnesses typically stratify configuration across multiple scopes—user, project, and organization—so that the same base agent operates under different policy regimes without changes to the model or its skill artifacts. Permissions and policies function as externalized governance: constraints that would otherwise have to be embedded in prompts are instead encoded as declarative rules enforced at runtime [^73]. + +##### Context budget. + +The context window remains the scarcest shared resource in any agent system. Current harnesses actively manage it through summarization of older history, staged loading that defers detailed skill guidance until a matching task is detected, and priority-based eviction of entries whose relevance has decayed. The harness orchestrates these strategies jointly because the optimal allocation depends on the current execution phase. + +The fact that independently developed systems converge on the same set of harness dimensions is itself instructive. It indicates that the primary design challenge of externalized agency is not eliciting better completions from a model, but arranging the operational conditions under which completions become effective interventions. Harness engineering is therefore neither a synonym for memory systems nor a rebranding of tool calling. It is the broader discipline concerned with constructing the cognitive and operational environment in which externalized modules compose into coherent agency. + +### 6.4 Harness as Cognitive Environment + +The preceding sections analyzed the harness in terms of its definition, its recurring design dimensions, and its manifestation in current systems. This final section steps back to interpret the harness at a theoretical level, asking what kind of object it is rather than how it is built. + +The significance of the harness extends beyond infrastructure in the ordinary software-engineering sense. A harness does not merely support an already-formed intelligence; it shapes the effective cognition of the agent by determining the environment within which reasoning unfolds. It regulates what enters the agent’s perceptual field, what is retained across turns and sessions, which operations are callable, which actions require approval, which intermediate states are exposed for revision, and which forms of failure are detectable and recoverable. The harness therefore sets the agent’s practical cognitive boundary. What the agent can know, remember, and do is not fixed by model weights alone, but by the conditions of access, persistence, and action supplied by the surrounding system. + +This claim can be situated within Norman’s account of cognitive artifacts [^104]. Norman characterizes cognitive artifacts as artificial devices designed to maintain, display, or operate upon information in ways that transform cognitive performance—not merely by accelerating inner computation but by changing the structure of the task itself. A harness fits this description at system scale. It does not simply augment a model with more context or more tools; it reorganizes the representational problem the model faces. By externalizing memory, formalizing procedures, introducing explicit control points, and constraining execution, the harness converts an unbounded task into a structured environment of guided action. The model’s apparent intelligence is thereby altered not only because it has more resources, but because the cognitive workload has been redistributed across artifacts, representations, and procedures outside the model. In earlier chapters, we analyzed this redistribution dimension by dimension: memory transforms recall into retrieval (Section 3.4), skills transform procedural reconstruction into guided execution (Section 4.7), and protocols transform ad hoc interaction into structured exchange (Section 5.4). The harness is the system-level artifact that composes these individual transformations into a single cognitive environment. + +Kirsh’s account of the intelligent use of space sharpens this interpretation [^68]. His central observation is that cognition is shaped by how environments are arranged: spatial and representational organization can offload search, simplify choice, and reduce internal computational burden. The harness plays an analogous role for agents. It is a cognitive niche in which information, tools, permissions, and procedures are arranged so that desirable behavior becomes easier to execute and undesirable behavior becomes harder to produce. Defaults, hooks, file boundaries, skill invocation patterns, and review gates all serve as structured regularities that narrow the space of plausible action. The agent’s competence is therefore partly an ecological achievement: it arises from being embedded in an environment whose organization channels cognition productively. + +The framework of distributed cognition generalizes the point. Hutchins’s formulation rejects the view that cognition resides exclusively within an individual mind, locating cognitive processes instead across people, artifacts, representations, and coordinated practices [^60]. An agent system equipped with a harness is intelligible in precisely these terms. The operative intelligence is distributed across model parameters, external memory stores, executable skills, protocol definitions, tool surfaces, monitoring systems, and the runtime constraints that govern their interaction. The harness is the medium through which this distributed system is coordinated. It is thus more accurate to describe the harness as a cognitive environment than as a mere infrastructure layer. Infrastructure is one of its manifestations; environmental structuring—the design of the conditions under which cognition unfolds—is its deeper function. + +## 7 Cross-Cutting Analysis + +The three externalization modules are analytically distinct, but real systems derive their power from interaction among them. Sections 3–5 treated memory, skills, and protocols largely in isolation; Section 6 argued that the harness unifies them. This section examines the system-level couplings that arise once the modules are placed inside a harness, asks how they manifest at the model boundary, and considers where the boundary between parametric and externalized capability should be drawn. + +### 7.1 Module Interaction Map + +![[x3.png|Refer to caption]] + +Figure 8: Couplings among memory, skills, and protocols. The six arrows summarize how the three externalization modules reinforce one another inside a harness. Memory supplies evidence for skill formation and protocol routing; skills turn stored experience into reusable procedures and invoke protocolized actions; protocols constrain execution and write normalized outcomes back into memory. + +##### Memory to skill: experience distillation. + +Repeated trajectories can be distilled into reusable procedures, making this the main path by which accumulated experience becomes codified expertise. Systems such as TED and UMEM show how episodic traces can be clustered, abstracted, and promoted into skill artifacts without modifying base-model weights [^183] [^180]. Voyager makes the same logic concrete in lifelong learning: successful behaviors are retained as reusable code-level skills that can be recomposed later [^140] [^187]. + +The cross-cutting significance of this flow is that memory does not merely preserve the past; it provides the evidence from which a harness can decide what deserves to become a reusable operating pattern. The quality of the distillation step—how the system determines which trajectories generalize and which are situational—therefore conditions the reliability of the entire skill layer downstream. If distillation is too aggressive, noisy or context-dependent behaviors become entrenched as skills; if too conservative, the system fails to capitalize on hard-won experience. + +##### Skill to memory: execution recording. + +The flow also runs in the opposite direction. Every skill execution generates traces, intermediate failures, and runtime refinements that would otherwise vanish with the active context window. Observability and logging infrastructure capture those trajectories as durable evidence, allowing the system to validate which skills remain reliable and which ones should be revised, split, or constrained [^19] [^150] [^145]. + +This flow is what makes the skill layer self-correcting rather than merely self-expanding. A mature skill system cannot be separated from memory management: reusable procedures only remain trustworthy if their real execution histories are continuously written back into external state. Without this recording, the harness has no empirical basis for skill maintenance, and the distillation path from memory to skill (the previous flow) operates on increasingly stale evidence. + +##### Skill to protocol: capability invocation. + +Skills become operational only when they cross the boundary from abstract procedure to governed action. That transition occurs through protocols, which translate high-level intent into typed calls, lifecycle events, and permission-checked interaction surfaces [^135] [^64] [^57]. A skill may specify that the agent should search code, run tests, and summarize a diff, but the individual operations are carried out through protocolized interfaces to search tools, shell commands, and test runners. + +The coupling matters for safety as well as for function. The OpenClaw analysis of the “Lethal Trifecta”—sensitive data access combined with unconstrained external communication and unverified execution—illustrates that unconstrained execution remains a safety problem even when the procedural guidance itself is sound [^96]. Protocol-level validation therefore acts as a boundary check that is independent of the skill’s own correctness: even a well-written skill can be intercepted if it attempts to invoke a forbidden operation or malformed call. + +##### Protocol to skill: capability generation. + +Once an interface is standardized, it becomes substantially easier to codify best practices for using it. OpenAPI and MCP do not merely make tools callable; they provide enough structural regularity for systems to package interface-specific know-how into reusable skill artifacts [^111] [^57]. The HashiCorp Agent Skills ecosystem is a concrete example: once the underlying interfaces for infrastructure management are made legible and stable through protocol contracts, domain procedures can be externalized as portable skill files rather than rederived ad hoc during each run [^7]. + +This flow highlights an important asymmetry in the externalization process. Protocol standardization does not merely consume skills; it actively expands the surface on which new skills can be authored or induced. Each new stable interface is a potential seed for a family of reusable procedures. The ecosystem growth of skill artifacts therefore depends in part on the pace and quality of protocol standardization. + +##### Memory to protocol: strategy selection. + +Stored context can also influence which protocol path the harness selects next. Historical success rates, user preferences, and prior failures can determine whether a request should stay local, call an external tool, or be delegated to another agent [^169] [^199]. In systems with multiple available interaction paths, memory transforms protocol selection from a static configuration into an experience-informed routing decision. + +This coupling is especially visible in multi-agent settings, where the harness must choose between local execution, tool invocation via MCP, and delegation to a remote agent via A2A. If past interactions with a particular tool have consistently failed for a certain class of tasks, the routing logic can learn to prefer an alternative path. Memory therefore informs not only what the model reasons about, but which interaction channel carries that reasoning into action. + +##### Protocol to memory: result assimilation. + +Finally, every protocol interaction produces state that must be preserved if it is to become part of the agent’s ongoing cognition. Tool outputs, approval events, error payloads, and delegation results arrive as structured responses, often in formats richer than plain text [^121]. The harness must normalize these results into memory so that later reasoning can rely on verified external state rather than on reconstructed or hallucinated assumptions. + +This flow closes the cycle. The protocol layer provides the evidence that memory stores, which later conditions new skill selection and new protocol routing. Without reliable result assimilation, the agent’s memory becomes disconnected from its actual interaction history, and downstream flows—particularly experience distillation and strategy selection—operate on unreliable premises. + +##### System-level dynamics. + +The six flows above are pairwise, but several important dynamics emerge only at the system level. First, the cycle is self-reinforcing: better memory enables better skill distillation, better skills produce richer execution traces, richer traces improve memory, and so on. This positive feedback can accelerate capability growth, but it can also amplify errors. A poisoned memory entry can lead to a flawed skill, whose execution traces further contaminate memory—a cascade that no single module’s quality control can interrupt without harness-level intervention. + +Second, the modules compete for the same scarce resource: the model’s context window. Memory retrieval, skill loading, and protocol schemas all occupy tokens. Expanding one module’s context footprint necessarily compresses the others. A harness must therefore manage not only the content of each module but also their relative budget allocation at each step of execution, a coordination problem analyzed further in Section 6. + +Third, the flows operate at different timescales. Protocol interactions are typically synchronous and fast; skill loading occurs at task or subtask boundaries; memory distillation and skill evolution unfold over sessions or longer. A harness that optimizes for one timescale—say, fast tool execution—may neglect the slower loops that determine long-term capability growth. Effective harness design requires balancing responsiveness at the fast loop with coherence at the slow loop. + +### 7.2 The LLM Input/Output Perspective + +Another useful viewpoint is to ask how each module manifests at the model boundary. Seen from the perspective of the context window and output surface, the harness does not simply add more components; it reorganizes what enters and leaves the model into functionally distinct layers. + +##### Memory as contextual input. + +Memory shapes the historical and situational input available at decision time. Instead of flooding the model with a full execution log, retrieval mechanisms select a small slice of state, prior trajectories, or entity relations that matter for the present step [^34]. This turns long-horizon continuity into a targeted contextualization problem and reduces context waste. The quality of this selection directly determines whether the model reasons over an accurate picture of the past or over a distorted one. + +##### Skills as instructional input. + +Skills shape the procedural guidance given to the model. Rather than encoding every workflow in a monolithic system prompt, the harness can load specialized instructions, examples, and constraints only when a relevant task pattern appears [^62]. The model is thereby asked less often to invent a workflow from scratch and more often to interpret and follow a prepared one. The risk, discussed in Section 4, is that overly detailed or context-consuming skill files can crowd out other inputs; the benefit is that procedural variance is reduced when the right skill is loaded at the right time. + +##### Protocols as action schema. + +Protocols shape the output boundary. By enforcing structured contracts such as JSON schemas, MCP messages, or OpenAPI-aligned calls, they constrain the model’s generative space and make downstream execution deterministic enough to govern [^54]. The output is no longer merely language to be interpreted later; it becomes a machine-readable action proposal situated inside an explicit interface. This constraint reduces the incidence of malformed tool calls and hallucinated arguments, though it also means that action expressiveness is bounded by the protocol’s schema. + +This input/output decomposition is analytically useful because it clarifies both the division of labor and the failure taxonomy. Retrieval errors manifest as input-selection errors: the model reasons correctly but over the wrong context. Skill failures manifest as procedural-guidance errors: the model follows instructions faithfully but the instructions themselves are flawed or mismatched. Protocol failures manifest as action-schema errors: the model’s intent is sound but the output violates the interface contract. The harness makes these failure classes separable enough to debug, attribute, and optimize independently—an important property for systems where multiple modules contribute to every decision. + +From a broader perspective, this tripartite organization of the model boundary—contextual input, instructional input, and action schema—can be understood as a structured form of context engineering. Rather than treating the prompt as an undifferentiated text buffer, the harness separates it into layers with distinct update rates, governance requirements, and failure modes. Each layer can be revised without disturbing the others: memory retrieval can be improved without rewriting skills, skill artifacts can be updated without changing protocol schemas, and protocol surfaces can be extended without altering memory policies. This modularity at the model boundary is one of the main practical advantages of the externalization approach. + +### 7.3 Parametric vs. Externalized: The Trade-off Space + +The relevant design problem is not whether intelligence should reside in the model or in the infrastructure. It is where particular burdens should live, given their update rate, reuse pattern, governance requirements, and execution cost. The following dimensions structure that partitioning decision. + +##### Update frequency and temporal decay. + +Fast-changing knowledge and procedures are strong candidates for externalization. APIs, organization structures, and live environment state decay too quickly to maintain reliably in model weights. Attempts to keep a model current through continual fine-tuning risk catastrophic forgetting and are often impractical at the required update frequency [^21] [^122] [^191] [^16]. External stores, by contrast, can be updated immediately without retraining and can maintain explicit provenance and versioning [^106] [^24]. Stable background capabilities—language understanding, broad reasoning, common-sense inference—decay at a much slower rate and are still more naturally carried parametrically, where they benefit from fast retrieval and deep integration with the model’s representational structure. + +##### Reusability and multi-agent portability. + +If a capability is repeatedly needed across tasks, users, or agents, externalization improves portability and composition [^134] [^165] [^93]. Explicit skills, scripts, and interface artifacts can be shared, versioned, and reused across heterogeneous runtimes without requiring that each agent rediscover or retrain the same procedures. In multi-agent settings, a skill authored for one agent can be broadcast to an entire swarm, provided that the skill’s assumptions about tools and protocols are met. One-off or highly idiosyncratic behavior may not justify the overhead of externalization, packaging, and maintenance [^193]. + +##### Auditability, governance, and alignment. + +Whenever inspection, approval, rollback, or policy enforcement matters, externalized artifacts have clear advantages over opaque parametric behavior [^79] [^72] [^73] [^40] [^203]. Symbolic interfaces support circuit breakers, schema validation, and traceable execution records in a way that weights alone do not. Alignment fine-tuning (such as RLHF) provides probabilistic behavioral shaping, but externalized constraints provide deterministic enforcement at the interface level. High-stakes deployment therefore pushes the architectural boundary outward: the more consequential the agent’s actions, the stronger the case for making the governing logic explicit and inspectable. + +##### Latency, simplicity, and context burden. + +Externalization shifts computational and organizational cost from the model’s forward pass into the surrounding system. Retrieval, routing, parsing, and tool invocation all introduce latency [^114] [^164]. Every retrieved artifact competes for limited context budget, and excessive context loading can degrade performance through information overload or the “lost in the middle” phenomenon [^28] [^98] [^39]. For ultra-fast, low-variance, or purely semantic tasks, allowing the model to rely on its internal parametric knowledge remains substantially simpler and often more reliable. + +The result is not a zero-sum contest between model intelligence and infrastructure intelligence. It is a systems-partitioning problem. Strong harnesses externalize the burdens that benefit from persistence, reuse, and control while leaving stable, fast, and generic competencies inside the model. The optimal partition is not static: as models grow more capable and as externalized infrastructure matures, the boundary will continue to shift—a dynamic explored further in Section 8.1. + +## 8 Future Discussion + +The preceding sections examined how memory, skills, and protocols externalize distinct cognitive burdens, and how the harness unifies them into a working agent. Those analyses describe what has already been externalized. This section asks what comes next, following the logic of externalization itself through six connected questions: + +- Where is the boundary between parametric and externalized capability heading, and how does multi-modal perception widen that frontier? +- Does the same logic extend from digital agents to embodied systems? +- How can the externalization process become more autonomous? +- What costs and risks accumulate as more is moved outward? +- How do externalized artifacts reshape interaction at ecosystem scale? +- How should the quality of externalization be measured? + +The following subsections take up these questions in turn, moving from the shifting boundary of externalization through its embodied extension to the problem of how its benefits and costs should be assessed. + +### 8.1 The Expanding Frontier + +A recurring lesson of the preceding sections is that the boundary between what stays inside the model and what gets externalized is not fixed. It shifts as models, tasks, and infrastructure co-evolve. Understanding that boundary—and anticipating where it will move next—is therefore a central design question for agent systems. + +In one direction, model improvement can pull capability back inward. A model that reliably produces structured output needs less format validation in the harness; one with a larger effective context window may tolerate simpler memory architectures; one with stronger intrinsic tool-use ability may require less elaborate intent-capture logic. Each such advance renders some piece of external infrastructure redundant. In the opposite direction, richer harnesses create new demands on models: operating inside a structured runtime requires respecting schemas, cooperating with permission checks, and coordinating with staged context injection [^191] [^21]. The frontier therefore moves in both directions at once, and a central engineering challenge is knowing when to externalize further and when to retract. + +Within this shifting landscape, several classes of cognitive work that today remain largely implicit are plausible candidates for further externalization. + +##### Planning and goal management. + +Current agents typically generate plans through in-context reasoning, producing decompositions that are ephemeral—they exist only in the active generation and are lost once the context resets. Early agent frameworks such as BabyAGI already experimented with persistent task queues [^100], and file-centric state abstractions like InfiAgent materialize planning artifacts outside the prompt [^181]. The direction points toward plans as first-class harness objects: persistent, inspectable, revisable, and shareable across agents or between agents and humans. That would convert planning from a transient reasoning act into a managed state artifact—the same representational shift that memory already performs for historical context. + +##### Evaluation and verification. + +Most evaluation logic today lives either inside the model’s chain of thought or in external benchmark harnesses that run post hoc. Externalizing evaluation criteria, rubrics, and verification procedures as runtime harness components—rather than leaving them implicit in model judgment—would allow the agent to check its own outputs against explicit standards during execution. Early signs of this direction are visible in verifiability-first engineering frameworks [^203] and in self-refine loops that separate generation from critique [^95]. The broader opportunity is to treat evaluation as externalized quality infrastructure rather than as a post-hoc measurement. + +##### Orchestration logic itself. + +The most recursive form of externalization is making the harness’s own configuration, policies, and execution logic into objects that the agent can inspect, critique, and revise. Once orchestration logic is externalized, the agent system can adapt not only what it knows and does, but how it organizes knowing and doing. This direction connects directly to the next subsection. + +##### Multi-modal externalization. + +The externalization framework developed so far assumes text as the dominant representational medium: memory stores textual traces, skills encode natural-language procedures, and protocols exchange structured text messages. As foundation models become natively multi-modal—processing images, video, audio, and screen content alongside text—each externalization dimension faces new design demands. Multi-modal skills must encode not only textual procedures but also visual perception workflows and cross-modal decision logic; early examples include computer-use skills that package GUI interaction sequences as reusable units [^20]. Multi-modal memory must index and retrieve visual and auditory experience, not only text-based episodic traces; MemVerse, for instance, maintains a multimodal knowledge graph that periodically distills fragmented sensory experience into more abstract representations [^87], and MuSEAgent accumulates stateful multimodal experiences to inform future reasoning [^145]. Multi-modal reasoning distillation extends the skill-acquisition loop to non-textual modalities: TED demonstrates that successful multimodal reasoning trajectories can be distilled into reusable experience without additional training [^183]. The broader implication is that multi-modal externalization is not simply a matter of adding new data types to existing stores. It changes the design assumptions of skill specification, memory indexing, and protocol schemas, and it opens a substantially wider frontier for the externalization of cognitive burden [^146] [^167]. + +### 8.2 From Digital Agents to Embodied Externalization + +The externalization framework developed in this paper applies to digital agents that read, write, and call APIs. A natural question is whether the same architectural logic extends to embodied systems—robots that must also perceive, move, and physically interact with the world. Recent developments in robot learning suggest that it does, and that the embodied domain is undergoing a decomposition strikingly parallel to the one analyzed here. + +##### The monolithic starting point. + +Early approaches to embodied intelligence pursued an end-to-end strategy analogous to the pre-externalization LLM agent. Vision-Language-Action (VLA) models [^11] [^67] were positioned as monolithic “brains”: given a natural-language instruction and a visual observation, the model directly outputs a continuous action sequence, handling perception, reasoning, planning, and motor control within a single forward pass. This design mirrors the pattern in which early LLM agents attempted to manage memory, skills, and orchestration entirely through in-context reasoning—and it encountered the same category of limitations. Complex multi-step tasks exceeded the model’s planning horizon; failures in intermediate steps could not be diagnosed or recovered from; and the tight coupling of high-level cognition with low-latency motor control created irreconcilable requirements on inference speed and model capacity. + +##### Decomposition: the cerebrum–cerebellum split. + +The emerging architectural response recapitulates the externalization logic at the level of the whole body. A high-level *robot agent* —typically an LLM or multimodal model—assumes the role of cerebrum: it interprets goals, decomposes tasks into subtask sequences, maintains state across steps, handles exceptions, and revises plans when execution feedback indicates failure [^1] [^131] [^83]. VLA models, meanwhile, are repositioned as a *cerebellum*: each one becomes a callable skill module responsible for a single atomic manipulation primitive—grasping, placing, pouring, inserting—executed with real-time sensorimotor feedback and low-latency control. The VLA no longer decides *what* to do; it ensures that *how* it is done is precise, stable, and adaptive to local physical perturbations. + +This decomposition maps directly onto the externalization dimensions of the present paper. Task planning and goal management migrate from the VLA’s implicit parametric reasoning into an explicit, inspectable agent loop—precisely the shift from in-context planning to externalized plan objects discussed in Section 8.1. Each VLA skill module functions as an externalized skill artifact: a reusable, composable unit with a defined interface, analogous to the skill files and tool specifications analyzed in Section 4. The communication between agent and skill—structured action requests, execution status reports, error codes—constitutes a protocol layer that enables the agent to orchestrate heterogeneous motor capabilities without embedding their implementation details. + +##### Why the parallel matters. + +The convergence is not coincidental. Both digital and embodied agents face the same fundamental tension: a single model cannot simultaneously optimize for slow, deliberative cognition and fast, reactive execution. Externalization resolves this tension by routing each class of cognitive work to the substrate best suited for it—persistent, inspectable structures for planning and memory; specialized, low-latency modules for execution. In the digital case the execution modules are tool calls and code interpreters; in the embodied case they are visuomotor policies. The harness pattern—a runtime that loads context, dispatches skills, enforces protocols, and manages state—is equally applicable to both, suggesting that embodied and digital agent architectures may ultimately share not only a design philosophy but a concrete engineering stack. + +##### Open challenges. + +Embodied externalization introduces constraints that the digital case does not face. Physical actions are irreversible in ways that API calls are not: a dropped object cannot be “rolled back.” Real-time control demands latency budgets orders of magnitude tighter than text generation. Perception is noisy, and the gap between simulated training environments and physical deployment remains substantial. These constraints will shape how memory, skills, and protocols are designed for embodied harnesses, but they do not change the fundamental argument: the logic of externalization—decomposing monolithic capability into specialized, composable, and governable external structures—extends naturally from digital cognition to physical action. + +### 8.3 Toward Self-Evolving Harnesses + +Most current agent systems still rely on humans to revise memory policies, rewrite skill artifacts, and tighten execution logic after failures. If orchestration logic is itself externalized—as the previous subsection suggests—then the harness becomes an object that can be adapted programmatically rather than only manually. The question is how to make that adaptation reliable. + +From a systems perspective, self-evolution can occur at three levels. At the *module level*, the architecture stays fixed but internal policies—retrieval granularity, skill-ranking heuristics, protocol-routing rules—are adjusted in response to observed failures. At the *system level*, the execution pipeline itself is restructured: scheduling strategies, execution order, or resource allocation may change when logs reveal recurring bottlenecks that local tuning cannot resolve. At the *boundary level*, the scope of the harness expands or contracts as models and tasks change, adding new externalized components where needed and pruning redundant ones—precisely the frontier dynamics discussed in Section 8.1. + +Several technical pathways are emerging. Reinforcement learning can optimize discrete runtime policies—search depth, compression ratio, retry strategy—against rewards such as task success, latency, or resource cost. Program synthesis treats harness adaptation as code repair: the model proposes patches after a failed trajectory, and sandboxed tests validate them before deployment. Evolutionary methods search over the topology of the harness—how modules are connected and in what order they are invoked. Imitation learning provides a stronger prior when exploration is too costly, by distilling execution logs from human experts or strong models into better orchestration patterns. These pathways target different search spaces—policy, program, structure, and prior experience—and are likely to be combined rather than used in isolation. + +Self-evolution is attractive because it targets infrastructural failure modes directly, but it also amplifies the costs and risks discussed next: an adaptive harness that drifts without adequate governance can introduce new failure modes faster than it resolves old ones. + +### 8.4 Costs, Risks, and Governance + +As more cognitive burden is moved outward, two classes of cost accumulate: cognitive overhead from the externalized infrastructure itself, and security risks from the expanded attack surface. + +##### Cognitive overhead. + +Externalization is not free [^143]. Every additional memory layer, API schema, or safety rule imposes latency and reasoning overhead, and past a certain point the model spends more effort discovering, parsing, and coordinating modules than solving the task itself. In memory, over-retrieval floods the context with marginally relevant traces. In skills, verbose or overlapping files compete for context budget and can cause the model to follow local procedure while losing sight of the global objective. In protocols, tool sprawl turns action selection into an unnecessary disambiguation problem. + +These failure modes suggest that the design target should be efficient and utility-positive rather than maximal externalization [^90]. *Minimal sufficiency* asks whether a given module actually reduces the model’s cognitive burden or merely adds one. *Lazy loading* defers detailed guidance until the task structure requires it. *Budget-aware routing* treats context allocation as an explicit optimization variable, dynamically adjusting how much space is devoted to memory, skills, and protocol metadata as the task phase changes [^186] [^116] [^132]. A good harness simplifies the model’s decision problem; it does not create a second one. + +##### Security and integrity risks. + +Cognitive overhead is a performance cost; the security dimension is more consequential. Once cognitive and procedural burdens are relocated into external artifacts, those artifacts become targets—and the threats map directly onto the three harness dimensions. Memory poisoning can silently distort future reasoning through corrupted episodic traces or factual stores. Malicious skill injection can embed adversarial procedures into the agent’s reusable repertoire. Protocol spoofing—forged tool manifests or manipulated endpoints—can cause unauthorized actions under the appearance of legitimate interaction [^92] [^52] [^144] [^85]. These risks are compounded when externalization becomes self-evolving (Section 8.3): adapting to new tasks can degrade old ones, accumulated patches can obscure system behavior, and optimization targets can be distorted when human supervision weakens. + +##### Governance as infrastructure. + +The implication is that externalization must be paired with governance—not as an afterthought, but as a co-designed layer of the harness. Mandatory review gates for critical updates, provenance tracking for memory and skill changes, deterministic rollback mechanisms, and regression testing all become part of the infrastructure. The quality of an externalized system is therefore measured not only by what it enables, but by how transparently and reversibly it does so. This criterion also informs evaluation, as discussed in Section 8.6. + +### 8.5 From Private Scaffolding to Shared Infrastructure + +The externalization described so far is largely agent-centric: memory serves one agent’s continuity, skills are loaded as local packages, and protocols often remain framework-bound. As collaboration chains lengthen, however, externalization begins to shift from private scaffolding toward shared infrastructure [^151] [^77] [^102]. This changes the unit of analysis from the individual agent to the ecosystem. + +##### Shared artifacts. + +The clearest sign is the emergence of shareable artifacts across all three dimensions. Shared memory shifts the question from “what I remember” to “what we know,” turning memory into a transactive system of shared state, indices, and common ground [^154] [^194]. Shared skills turn procedural expertise into public capability units that can be reused, forked, and maintained across agents [^86]. Shared protocols provide the common grammar that makes such coordination interoperable across platforms and organizations [^175]. + +##### Division of labor and collective learning. + +Once these structures are shared, agent systems can differentiate roles rather than replicate the same full stack everywhere. Drawing on stigmergy [^136], failure trajectories can accumulate in shared memory while successful paths crystallize into shared skills. Learning then diffuses through external structures rather than only through joint parametric training. + +##### Institutionalization and its tensions. + +As memory schemas, skill specifications, and protocol bindings are repeatedly validated, they begin to function less like temporary scaffolding and more like institutions: shared operating procedures and standards that coordinate behavior at ecosystem scale [^60]. But shared infrastructure also introduces new governance problems [^32] [^92] [^70]. Infrastructure drift, malicious or low-quality artifacts, and premature or delayed standardization can all destabilize the ecosystem [^52] [^137]. The governance costs identified in Section 8.4 are therefore amplified when externalization becomes collective: version control, permission auditing, provenance, and rollback become part of the institutional design of agent systems, not just the engineering of individual harnesses. + +### 8.6 Measuring Externalization + +Most current benchmarks evaluate agents primarily through task completion under fixed prompts and fixed model settings [^201] [^98]. That is useful for comparing base-model capability, but it systematically under-measures the contribution of externalized infrastructure. A harness that improves reliability through better memory retrieval, more precise skill loading, or tighter execution governance will show up only as a higher pass rate, with no way to attribute the gain to its actual source. + +A richer evaluation agenda would assess the quality of externalization along dimensions that current benchmarks largely ignore. *Transferability* asks whether the same harness configuration maintains its effectiveness when the underlying model is swapped—a direct test of how much capability resides in external infrastructure versus weights. *Maintainability* measures how gracefully the system degrades when skills, memory policies, or protocol schemas are updated. *Recovery robustness* tests whether the agent can detect failures, roll back partial actions, and resume from checkpoints. *Context efficiency* quantifies how much of the context budget is consumed by harness overhead versus task-relevant reasoning. *Governance quality* evaluates whether the externalized system meets the transparency and reversibility requirements identified in Section 8.4. + +Concrete evaluation strategies might include ablation studies that remove individual harness components and measure the resulting degradation; cross-model transfer tests that hold the harness constant while varying the base model; and long-horizon reliability metrics that track success rates, cost, and drift over extended multi-session interactions rather than single-turn completions. Until such methods mature, the field will continue to attribute to model intelligence what is partly an achievement of externalization design. For instance, the Agent Humanization Benchmark (AHB) suggests that agent evaluation should extend beyond task completion to the humanization of observable behavior at the user-interface boundary, especially for mobile GUI agents operating in human-centric environments [^202]. + +Taken together, these six directions trace the continuing logic of externalization beyond its current state. The frontier is expanding as new cognitive burdens—including multi-modal perception and cross-modal reasoning—become candidates for externalization; the same decomposition logic is extending from digital agents to embodied systems, where the cerebrum–cerebellum split recapitulates the separation of planning from execution; the process is becoming more autonomous through self-evolving harnesses; the trade-offs are sharpening as cognitive overhead and security risks accumulate; the scope is widening from private scaffolding to shared infrastructure; and the evaluation challenge is growing more pressing as externalization’s contribution remains invisible to model-centric benchmarks. The common thread is that externalization is not a one-time architectural decision but an ongoing design process whose boundaries, mechanisms, costs, and quality criteria co-evolve with the models and ecosystems they serve. + +## 9 Conclusion + +This paper has argued that externalization is the transition logic connecting many of the most important developments in LLM agents. Reliable agency increasingly depends on relocating selected cognitive burdens out of the model and into explicit infrastructure: memory externalizes state across time, skills externalize procedural expertise, protocols externalize interaction structure, and the harness coordinates these layers into a working runtime. + +From this perspective, the move from weights to context to harness is not just a sequence of engineering tricks. It marks a shift in where agent capability is organized. Some burdens remain well handled parametrically, but others become more reliable once they are made persistent, inspectable, reusable, and governable outside the model. + +What unifies these forms of externalization is representational transformation. Memory turns recall into retrieval, skills turn improvised generation into guided composition, and protocols turn ad hoc coordination into structured exchange. The effect is not simply to add more components around the model, but to change the task the model is being asked to solve. + +This reframing also clarifies the agenda ahead. The key questions are no longer only how to build stronger models, but how to partition capability between models and infrastructure, how to evaluate the contribution of externalized systems, and how to govern the shared artifacts on which agents increasingly rely. + +The broader implication is that progress in agents will come from the co-evolution of models and external infrastructure rather than from either in isolation. On that view, better agents are not merely better reasoners. They are better organized cognitive systems. + +[^1]: M. Ahn, A. Brohan, N. Brown, Y. Chebotar, O. Cortes, B. David, C. Finn, C. Fu, K. Gober, K. Gopalakrishnan, et al. Do as i can, not as i say: Grounding language in robotic affordances. In *Conference on Robot Learning*, 2022. + +[^2]: P. Anokhin, N. Semenov, A. Sorokin, D. Evseev, A. Kravchenko, M. Burtsev, and E. Burnaev. Arigraph: Learning knowledge graph world models with episodic memory for llm agents. *arXiv preprint arXiv:2407.04363*, 2024. + +[^3]: Anthropic. Introducing the model context protocol. [https://www.anthropic.com/news/model-context-protocol](https://www.anthropic.com/news/model-context-protocol), Nov. 2024. Anthropic news post, November 25, 2024. + +[^4]: Anthropic. Model context protocol, 2024. URL [https://www.anthropic.com/news/model-context-protocol](https://www.anthropic.com/news/model-context-protocol). Accessed: 2025-04-19. + +[^5]: Anthropic. Introducing agent skills. [https://claude.com/blog/skills](https://claude.com/blog/skills), Oct. 2025. Anthropic product announcement, October 16, 2025. + +[^6]: Anthropic. Agent skills. [https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview), 2026. Claude API Docs, accessed 2026-04-02. + +[^7]: G. Baghel and R. Chandna. Introducing hashicorp agent skills, 2026. URL [https://www.hashicorp.com/en/blog/introducing-hashicorp-agent-skills#what-are-agent-skills](https://www.hashicorp.com/en/blog/introducing-hashicorp-agent-skills#what-are-agent-skills). + +[^8]: Y. Bai, A. Jones, K. Ndousse, A. Askell, A. Chen, N. DasSarma, D. Drain, S. Fort, D. Ganguli, T. Henighan, et al. Training a helpful and harmless assistant with reinforcement learning from human feedback. *arXiv preprint arXiv:2204.05862*, 2022a. [10.48550/arXiv.2204.05862](https://arxiv.org/doi.org/10.48550/arXiv.2204.05862). URL [https://arxiv.org/abs/2204.05862](https://arxiv.org/abs/2204.05862). + +[^9]: Y. Bai, S. Kadavath, S. Kundu, A. Askell, J. Kernion, A. Jones, A. Chen, A. Goldie, A. Mirhoseini, C. McKinnon, C. Chen, C. Olsson, C. Olah, D. Hernandez, D. Drain, D. Ganguli, D. Li, E. Tran-Johnson, E. Perez, J. Kerr, J. Mueller, J. Ladish, J. Landau, K. Ndousse, K. Lukosuite, L. Lovitt, M. Sellitto, N. Elhage, N. Schiefer, N. Mercado, N. DasSarma, R. Lasenby, R. Larson, S. Ringer, S. Johnston, S. Kravec, S. E. Showk, S. Fort, T. Lanham, T. Telleen-Lawton, T. Conerly, T. Henighan, T. Hume, S. R. Bowman, Z. Hatfield-Dodds, B. Mann, D. Amodei, N. Joseph, S. McCandlish, T. Brown, and J. Kaplan. Constitutional ai: Harmlessness from ai feedback, 2022b. URL [https://arxiv.org/abs/2212.08073](https://arxiv.org/abs/2212.08073). + +[^10]: S. Borgeaud, A. Mensch, J. Hoffmann, T. Cai, E. Rutherford, K. Millican, G. B. M. Van Den Driessche, J.-B. Lespiau, B. Damoc, A. Clark, et al. Improving language models by retrieving from trillions of tokens. In *Proceedings of the 39th International Conference on Machine Learning*, pages 2206–2240. PMLR, 2022. URL [https://proceedings.mlr.press/v162/borgeaud22a.html](https://proceedings.mlr.press/v162/borgeaud22a.html). + +[^11]: A. Brohan, N. Brown, J. Carbajal, Y. Chebotar, X. Chen, K. Choromanski, T. Ding, D. Driess, A. Dubey, C. Finn, et al. Rt-2: Vision-language-action models transfer web knowledge to robotic control. *arXiv preprint arXiv:2307.15818*, 2023. + +[^12]: T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. In *Advances in Neural Information Processing Systems*, volume 33, pages 1877–1901, 2020. + +[^13]: H. Cai, Y. Li, W. Wang, F. Zhu, X. Shen, W. Li, and T.-S. Chua. Large language models empowered personalized web agents. In *Proceedings of the ACM on Web Conference 2025*, pages 198–215, 2025. + +[^14]: H. Chai, Z. Cao, M. Ran, Y. Yang, J. Lin, X. Peng, H. Wang, R. Ding, Z. Wan, M. Wen, et al. Parl-mt: Learning to call functions in multi-turn conversation with progress awareness. *arXiv preprint arXiv:2509.23206*, 2025. + +[^15]: G. Chang, E. Lin, C. Yuan, R. Cai, B. Chen, X. Xie, and Y. Zhang. Agent network protocol technical white paper, 2025. URL [https://arxiv.org/abs/2508.00007](https://arxiv.org/abs/2508.00007). + +[^16]: H. Chen, Z. Sun, H. Ye, K. Li, and X. Lin. Continual learning in large language models: Methods, challenges, and opportunities. *arXiv preprint arXiv:2603.12658*, 2026a. + +[^17]: M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. de Oliveira Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, A. Ray, R. Puri, G. Krueger, M. Petrov, H. Khlaaf, G. Sastry, P. Mishkin, B. Chan, S. Gray, N. Ryder, M. Pavlov, A. Power, L. Kaiser, M. Bavarian, C. Winter, P. Tillet, F. P. Such, D. Cummings, M. Plappert, F. Chantzis, E. Barnes, A. Herbert-Voss, W. H. Guss, A. Nichol, A. Paino, N. Tezak, J. Tang, I. Babuschkin, S. Balaji, S. Jain, W. Saunders, C. Hesse, A. N. Carr, J. Leike, J. Achiam, V. Misra, E. Morikawa, A. Radford, M. Knight, M. Brundage, M. Murati, K. Mayer, P. Welinder, B. McGrew, D. Amodei, S. McCandlish, I. Sutskever, and W. Zaremba. Evaluating large language models trained on code, 2021. URL [https://arxiv.org/abs/2107.03374](https://arxiv.org/abs/2107.03374). + +[^18]: S. Chen, S. Wong, L. Chen, and Y. Tian. Extending context window of large language models via positional interpolation. *arXiv preprint arXiv:2306.15595*, 2023. URL [https://arxiv.org/abs/2306.15595](https://arxiv.org/abs/2306.15595). + +[^19]: S. Chen, S. Lin, Y. Shi, H. Lian, X. Gu, L. Yun, D. Chen, L. Cao, J. Liu, N. Xia, et al. Swe-exp: Experience-driven software issue resolution. *arXiv preprint arXiv:2507.23361*, 2025. + +[^20]: T. Chen, Y. Li, M. Solodko, S. Wang, N. Jiang, T. Cui, J. Hao, J. Ko, S. Abdali, L. Xu, et al. Cua-skill: Develop skills for computer using agent. *arXiv preprint arXiv:2601.21123*, 2026b. + +[^21]: J. Cheng, M. Marone, O. Weller, D. Lawrie, D. Khashabi, and B. Van Durme. Dated data: Tracing knowledge cutoffs in large language models. *arXiv preprint arXiv:2403.12958*, 2024. + +[^22]: X. Cheng, W. Zeng, D. Dai, Q. Chen, B. Wang, Z. Xie, K. Huang, X. Yu, Z. Hao, Y. Li, et al. Conditional memory via scalable lookup: A new axis of sparsity for large language models. *arXiv preprint arXiv:2601.07372*, 2026. + +[^23]: P. Chhikara, D. Khant, S. Aryan, T. Singh, and D. Yadav. Mem0: Building production-ready AI agents with scalable long-term memory. *arXiv preprint arXiv:2504.19413*, 2025. [10.48550/arXiv.2504.19413](https://arxiv.org/doi.org/10.48550/arXiv.2504.19413). + +[^24]: M. R. Chinthareddy. Reliable graph-rag for codebases: Ast-derived graphs vs llm-extracted knowledge graphs. *arXiv preprint arXiv:2601.08773*, 2026. + +[^25]: A. Chowdhery, S. Narang, J. Devlin, M. Bosma, G. Mishra, A. Roberts, P. Barham, H. W. Chung, C. Sutton, S. Gehrmann, et al. PaLM: Scaling language modeling with pathways. *Journal of Machine Learning Research*, 24(240):1–113, 2023. URL [https://jmlr.org/papers/v24/22-1144.html](https://jmlr.org/papers/v24/22-1144.html). + +[^26]: A. Clark and D. J. Chalmers. The extended mind. *Analysis*, 58(1):7–19, 1998. [10.1093/analys/58.1.7](https://arxiv.org/doi.org/10.1093/analys/58.1.7). + +[^27]: CopilotKit. Ag-ui: The agent-user interaction protocol. [https://github.com/ag-ui-protocol/ag-ui](https://github.com/ag-ui-protocol/ag-ui), 2025. Official protocol repository and specification. + +[^28]: G. Corallo and P. Papotti. Parallel context-of-experts decoding for retrieval augmented generation. *arXiv preprint arXiv:2601.08670*, 2026. + +[^29]: CrewAI. CrewAI: Framework for orchestrating role-playing autonomous AI agents. [https://github.com/crewAIInc/crewAI](https://github.com/crewAIInc/crewAI), 2024. GitHub repository, accessed 2026-04-02. + +[^30]: F. De Brigard, S. Umanath, and M. Irish. Rethinking the distinction between episodic and semantic memory: Insights from the past, present, and future. *Memory & Cognition*, 50(3):459–463, 2022. + +[^31]: DeepSeek-AI. Deepseek-v3 technical report. *arXiv preprint arXiv:2412.19437*, 2025. URL [https://arxiv.org/abs/2412.19437](https://arxiv.org/abs/2412.19437). + +[^32]: Z. Deng, Y. Guo, C. Han, W. Ma, J. Xiong, S. Wen, and Y. Xiang. Ai agents under threat: A survey of key security challenges and future pathways. *ACM Computing Surveys*, 57(7):1–36, 2025. + +[^33]: P. Du. Memory for autonomous llm agents: Mechanisms, evaluation, and emerging frontiers. *arXiv preprint arXiv:2603.07670*, 2026a. + +[^34]: P. Du. Memory for autonomous llm agents:mechanisms, evaluation, and emerging frontiers, 2026b. URL [https://arxiv.org/abs/2603.07670](https://arxiv.org/abs/2603.07670). + +[^35]: D. Edge, H. Trinh, N. Cheng, J. Bradley, A. Chao, A. Mody, S. Truitt, D. Metropolitansky, R. O. Ness, and J. Larson. From local to global: A graph rag approach to query-focused summarization. *arXiv preprint arXiv:2404.16130*, 2024. + +[^36]: A. Ehtesham, A. Singh, G. K. Gupta, and S. Kumar. A survey of agent interoperability protocols: Mcp, acp, a2a, and anp. *arXiv preprint arXiv:2505.02279*, 2025a. + +[^37]: A. Ehtesham, A. Singh, G. K. Gupta, and S. Kumar. A survey of agent interoperability protocols: Model context protocol (mcp), agent communication protocol (acp), agent-to-agent protocol (a2a), and agent network protocol (anp), 2025b. URL [https://arxiv.org/abs/2505.02279](https://arxiv.org/abs/2505.02279). + +[^38]: A. Ehtesham et al. A survey of agent interoperability protocols: Model context protocol (MCP), agent communication protocol (ACP), agent-to-agent protocol (A2A), and agent network protocol (ANP). *arXiv preprint arXiv:2505.02279*, 2025c. [10.48550/arXiv.2505.02279](https://arxiv.org/doi.org/10.48550/arXiv.2505.02279). + +[^39]: N. Esmi, M. Nezhad-Moghaddam, F. Borhani, A. Shahbahrami, A. Daemdoost, and G. Gaydadjiev. Gpt-5 vs other llms in long short-context performance. In *2025 3rd International Conference on Foundation and Large Language Models (FLLM)*, pages 129–133. IEEE, 2025. + +[^40]: M. Fernandez. Agent control protocol: Admission control for agent actions. *arXiv preprint arXiv:2603.18829*, 2026. + +[^41]: S. Gao, R. Zhu, Z. Kong, A. Noori, X. Su, C. Ginder, T. Tsiligkaridis, and M. Zitnik. Txagent: An ai agent for therapeutic reasoning across a universe of tools. *arXiv preprint arXiv:2503.10970*, 2025a. URL [https://arxiv.org/abs/2503.10970](https://arxiv.org/abs/2503.10970). + +[^42]: S. Gao, R. Zhu, P. Sui, Z. Kong, S. Aldogom, Y. Huang, A. Noori, R. Shamji, K. Parvataneni, T. Tsiligkaridis, and M. Zitnik. Democratizing ai scientists using tooluniverse. *arXiv preprint arXiv:2509.23426*, 2025b. URL [https://arxiv.org/abs/2509.23426](https://arxiv.org/abs/2509.23426). + +[^43]: Y. Gao, Y. Xiong, X. Gao, K. Jia, J. Pan, Y. Bi, Y. Dai, J. Sun, M. Wang, and H. Wang. Retrieval-augmented generation for large language models: A survey. *arXiv preprint arXiv:2312.10997*, 2024. [10.48550/arXiv.2312.10997](https://arxiv.org/doi.org/10.48550/arXiv.2312.10997). URL [https://arxiv.org/abs/2312.10997](https://arxiv.org/abs/2312.10997). + +[^44]: Gemini Team, R. Anil, S. Borgeaud, Y. Wu, J.-B. Alayrac, J. Yu, R. Sorber, et al. Gemini: A family of highly capable multimodal models. *arXiv preprint arXiv:2312.11805*, 2023. URL [https://arxiv.org/abs/2312.11805](https://arxiv.org/abs/2312.11805). + +[^45]: G. Gigerenzer and W. Gaissmaier. Heuristic decision making. *Annual Review of Psychology*, 62(1):451–482, 2011. [10.1146/annurev-psych-120709-145346](https://arxiv.org/doi.org/10.1146/annurev-psych-120709-145346). URL [https://doi.org/10.1146/annurev-psych-120709-145346](https://doi.org/10.1146/annurev-psych-120709-145346). + +[^46]: Google. Gemini: Try deep research and gemini 2.0 flash experimental. [https://blog.google/products-and-platforms/products/gemini/google-gemini-deep-research/](https://blog.google/products-and-platforms/products/gemini/google-gemini-deep-research/), Dec. 2024. Google blog post introducing Deep Research in Gemini, December 11, 2024; accessed 2026-04-02. + +[^47]: Google. A2a: A new era of agent interoperability. [https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/](https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/), 2025a. Official announcement of the Agent2Agent (A2A) protocol for enabling secure communication and coordination between AI agents. + +[^48]: Google. A2ui: Agent-to-user interface protocol. [https://github.com/google/A2UI](https://github.com/google/A2UI), 2025b. Open-source implementation of the A2UI protocol, enabling AI agents to generate declarative user interfaces that are rendered natively across platforms. + +[^49]: Google. Under the hood: Universal commerce protocol (ucp). [https://developers.googleblog.com/under-the-hood-universal-commerce-protocol-ucp/](https://developers.googleblog.com/under-the-hood-universal-commerce-protocol-ucp/), 2026. Official introduction of the Universal Commerce Protocol (UCP), an open standard enabling interoperable agent-driven commerce across discovery, checkout, and post-purchase workflows. + +[^50]: Google Cloud. Announcing the agent2agent protocol (A2A). [https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/](https://developers.googleblog.com/en/a2a-a-new-era-of-agent-interoperability/), Apr. 2025a. Google Developers Blog announcement, April 9, 2025; see also the official specification site at [https://google.github.io/A2A/](https://google.github.io/A2A/). + +[^51]: Google Cloud. Announcing agent payments protocol (ap2). [https://cloud.google.com/blog/products/ai-machine-learning/announcing-agents-to-payments-ap2-protocol](https://cloud.google.com/blog/products/ai-machine-learning/announcing-agents-to-payments-ap2-protocol), 2025b. Official introduction of AP2 as an open protocol enabling secure, compliant, and interoperable agent-driven payments. + +[^52]: Z. Guo, Z. Chen, X. Nie, J. Lin, Y. Zhou, and W. Zhang. Skillprobe: Security auditing for emerging agent skill marketplaces via multi-agent collaboration. *arXiv preprint arXiv:2603.21019*, 2026. + +[^53]: Y. Hao, S. Mehri, C. Zhai, and D. Hakkani-Tür. User preference modeling for conversational llm agents: Weak rewards from retrieval-augmented interaction. *arXiv preprint arXiv:2603.20939*, 2026. + +[^54]: M. M. Hasan, H. Li, G. K. Rajbahadur, B. Adams, and A. E. Hassan. Model context protocol (mcp) tool descriptions are smelly! towards improving ai agent efficiency with augmented mcp tool descriptions, 2026. URL [https://arxiv.org/abs/2602.14878](https://arxiv.org/abs/2602.14878). + +[^55]: J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. de Las Casas, L. A. Hendricks, J. Welbl, A. Clark, et al. Training compute-optimal large language models. *arXiv preprint arXiv:2203.15556*, 2022. URL [https://arxiv.org/abs/2203.15556](https://arxiv.org/abs/2203.15556). + +[^56]: S. Hong, M. Zhuge, J. Chen, X. Zheng, Y. Cheng, C. Zhang, J. Wang, Z. Wang, S. K. S. Yau, Z. Lin, et al. MetaGPT: Meta programming for a multi-agent collaborative framework. *arXiv preprint arXiv:2308.00352*, 2023. URL [https://arxiv.org/abs/2308.00352](https://arxiv.org/abs/2308.00352). + +[^57]: X. Hou, Y. Zhao, S. Wang, and H. Wang. Model context protocol (mcp): Landscape, security threats, and future research directions. *ACM Transactions on Software Engineering and Methodology*, 2025. + +[^58]: V. Hsiao, M. Roberts, and L. Smith. Procedural knowledge improves agentic llm workflows, 2025. URL [https://arxiv.org/abs/2511.07568](https://arxiv.org/abs/2511.07568). + +[^59]: Z. Hu, Q. Zhu, H. Yan, Y. He, and L. Gui. Beyond rag for agent memory: Retrieval by decoupling and aggregation. *arXiv preprint arXiv:2602.02007*, 2026. + +[^60]: E. Hutchins. *Cognition in the Wild*. MIT press, 1995. + +[^61]: IBM Research. The simplest protocol for ai agents to work together. [https://research.ibm.com/blog/agent-communication-protocol-ai](https://research.ibm.com/blog/agent-communication-protocol-ai), 2025. Official introduction of ACP, describing it as a shared communication language enabling collaboration among AI agents. + +[^62]: P. Jiang, J. Lin, Z. Shi, Z. Wang, L. He, Y. Wu, M. Zhong, P. Song, Q. Zhang, H. Wang, X. Xu, H. Xu, P. Han, D. Zhang, J. Sun, C. Yang, K. Qian, T. Wang, C. Hu, M. Li, Q. Li, H. Peng, S. Wang, J. Shang, C. Zhang, J. You, L. Liu, P. Lu, Y. Zhang, H. Ji, Y. Choi, D. Song, J. Sun, and J. Han. Adaptation of agentic ai: A survey of post-training, memory, and skills, 2026a. URL [https://arxiv.org/abs/2512.16301](https://arxiv.org/abs/2512.16301). + +[^63]: Y. Jiang et al. SoK: Agentic skills – beyond tool use in LLM agents. *arXiv preprint arXiv:2602.20867*, 2026b. + +[^64]: JSON-RPC Working Group. Json-rpc 2.0 specification, 2010. URL [https://www.jsonrpc.org/specification](https://www.jsonrpc.org/specification). + +[^65]: J. Kang, M. Ji, Z. Zhao, and T. Bai. Memory os of ai agent. In *Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*, pages 25972–25981, 2025. + +[^66]: J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models. *arXiv preprint arXiv:2001.08361*, 2020. URL [https://arxiv.org/abs/2001.08361](https://arxiv.org/abs/2001.08361). + +[^67]: M. J. Kim, K. Pertsch, S. Karamcheti, T. Xiao, A. Balakrishna, S. Nair, R. Rafailov, E. Foster, G. Lam, P. Sanketi, et al. Openvla: An open-source vision-language-action model. *arXiv preprint arXiv:2406.09246*, 2024. + +[^68]: D. Kirsh. Complementary strategies: Why we use our hands when we think. In *Proceedings of the seventeenth annual conference of the cognitive science society*, Hillsdale, NJ, 1995. Lawrence Erlbaum. + +[^69]: T. Kojima, S. S. Gu, M. Reid, Y. Matsuo, and Y. Iwasawa. Large language models are zero-shot reasoners. In *Advances in Neural Information Processing Systems*, volume 35, pages 22199–22213, 2022. + +[^70]: D. Kong, S. Lin, Z. Xu, Z. Wang, M. Li, Y. Li, Y. Zhang, H. Peng, X. Chen, Z. Sha, et al. A survey of llm-driven ai agent communication: Protocols, security risks, and defense countermeasures. *arXiv preprint arXiv:2506.19676*, 2025. + +[^71]: LangChain. LangGraph: Build resilient language agents as graphs. [https://github.com/langchain-ai/langgraph](https://github.com/langchain-ai/langgraph), 2024. GitHub repository, accessed 2026-04-02. + +[^72]: K. Lazaros, A. G. Vrahatis, and S. Kotsiantis. Human-in-the-loop artificial intelligence: A systematic review of concepts, methods, and applications. *Entropy*, 28(4):377, 2026. + +[^73]: S. U. Lee, L. Zhu, M. Shamsujjoha, L. Dong, Q. Lu, J. Chen, and L. Briand. A structured approach to safety case construction for ai systems, 2026. URL [https://arxiv.org/abs/2601.22773](https://arxiv.org/abs/2601.22773). + +[^74]: W. Y. Lee. Capable but unreliable: Canonical path deviation as a causal mechanism of agent failure in long-horizon tasks. *arXiv preprint arXiv:2602.19008*, 2026. URL [https://arxiv.org/abs/2602.19008](https://arxiv.org/abs/2602.19008). + +[^75]: P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W.-t. Yih, T. Rocktäschel, S. Riedel, and D. Kiela. Retrieval-augmented generation for knowledge-intensive NLP tasks. In *Advances in Neural Information Processing Systems*, volume 33, pages 9459–9474, 2020. + +[^76]: G. Li, H. A. A. K. Hammoud, H. Itani, D. Khizbullin, and B. Ghanem. CAMEL: Communicative agents for “mind” exploration of large language model society. *Advances in Neural Information Processing Systems*, 36, 2023. + +[^77]: H. Li, C. Mu, J. Chen, S. Ren, Z. Cui, Y. Zhang, L. Bai, and S. Hu. Organizing, orchestrating, and benchmarking agent skills at ecosystem scale. *arXiv preprint arXiv:2603.02176*, 2026a. + +[^78]: J. Li and J. Li. Memory, consciousness and large language model. *arXiv preprint arXiv:2401.02509*, 2024. + +[^79]: N. Li, K. Zhang, K. Polley, and J. Ma. Security considerations for artificial intelligence agents. *arXiv preprint arXiv:2603.12230*, 2026b. + +[^80]: X. Li. A review of prominent paradigms for LLM-based agents: Tool use (including RAG), planning, and feedback learning. In *Proceedings of the 31st International Conference on Computational Linguistics*, pages 9760–9779, Abu Dhabi, UAE, 2025. Association for Computational Linguistics. + +[^81]: X. Li, W. Chen, Y. Liu, S. Zheng, X. Chen, Y. He, Y. Li, B. You, H. Shen, J. Sun, et al. Skillsbench: Benchmarking how well agent skills work across diverse tasks. *arXiv preprint arXiv:2602.12670*, 2026c. + +[^82]: Z. Li, C. Xi, C. Li, D. Chen, B. Chen, S. Song, S. Niu, H. Wang, J. Yang, C. Tang, et al. Memos: A memory os for ai system. *arXiv preprint arXiv:2507.03724*, 2025. + +[^83]: J. Liang, W. Huang, F. Xia, P. Xu, K. Hausman, B. Ichter, P. Florence, and A. Zeng. Code as policies: Language model programs for embodied control. *arXiv preprint arXiv:2209.07753*, 2023. + +[^84]: J. Lin, X. Dai, Y. Xi, W. Liu, B. Chen, H. Zhang, Y. Liu, C. Wu, X. Li, C. Zhu, et al. How can recommender systems benefit from large language models: A survey. *ACM Transactions on Information Systems*, 43(2):1–47, 2025a. + +[^85]: J. Lin, J. Zhu, Z. Zhou, Y. Xi, W. Liu, Y. Yu, and W. Zhang. Superplatforms have to attack ai agents. *arXiv preprint arXiv:2505.17861*, 2025b. + +[^86]: G. Ling, S. Zhong, and R. Huang. Agent skills: A data-driven analysis of claude skills for extending large language model functionality. *arXiv preprint arXiv:2602.08004*, 2026. + +[^87]: J. Liu, Y. Sun, W. Cheng, H. Lei, Y. Chen, L. Wen, X. Yang, D. Fu, P. Cai, N. Deng, et al. Memverse: Multimodal memory for lifelong learning agents. *arXiv preprint arXiv:2512.03627*, 2025a. + +[^88]: M. M. Liu, D. Garcia, F. Parllaku, V. Upadhyay, S. F. A. Shah, and D. Roth. Toolscope: Enhancing llm agent tool use through tool merging and context-aware filtering, 2025b. URL [https://arxiv.org/abs/2510.20036](https://arxiv.org/abs/2510.20036). + +[^89]: N. F. Liu, K. Lin, J. Hewitt, A. Paranjape, M. Bevilacqua, F. Petroni, and P. Liang. Lost in the middle: How language models use long contexts. *Transactions of the Association for Computational Linguistics*, 12:157–173, 2024a. [10.1162/tacl\_a\_00638](https://arxiv.org/doi.org/10.1162/tacl_a_00638). URL [https://aclanthology.org/2024.tacl-1.9/](https://aclanthology.org/2024.tacl-1.9/). + +[^90]: W. Liu, J. Qin, X. Huang, X. Zeng, Y. Xi, J. Lin, C. Wu, Y. Wang, L. Shang, R. Tang, et al. The real barrier to llm agent usability is agentic roi. *arXiv preprint arXiv:2505.17767*, 2025c. + +[^91]: X. Liu, Z. Peng, X. Yi, X. Xie, L. Xiang, Y. Liu, and D. Xu. Toolnet: Connecting large language models with massive tools via tool graph, 2024b. URL [https://arxiv.org/abs/2403.00839](https://arxiv.org/abs/2403.00839). + +[^92]: Y. Liu, W. Wang, R. Feng, Y. Zhang, G. Xu, G. Deng, Y. Li, and L. Zhang. Agent skills in the wild: An empirical study of security vulnerabilities at scale. *arXiv preprint arXiv:2601.10338*, 2026. + +[^93]: Z. Liu, Z. Wan, P. Li, M. Yan, J. Zhang, F. Huang, and Y. Liu. Scaling external knowledge input beyond context windows of llms via multi-agent collaboration. *arXiv preprint arXiv:2505.21471*, 2025d. + +[^94]: J. Luo et al. Large language model agent: A survey on methodology, applications and challenges. *arXiv preprint arXiv:2503.21460*, 2025. [10.48550/arXiv.2503.21460](https://arxiv.org/doi.org/10.48550/arXiv.2503.21460). + +[^95]: A. Madaan, N. Tandon, P. Gupta, S. Hallinan, L. Gao, S. Wiegreffe, U. Alon, N. Dziri, S. Prabhumoye, Y. Yang, S. Gupta, B. P. Majumder, K. Hermann, S. Welleck, A. Yazdanbakhsh, and P. Clark. Self-refine: Iterative refinement with self-feedback, 2023. URL [https://arxiv.org/abs/2303.17651](https://arxiv.org/abs/2303.17651). + +[^96]: R. McKerchar. The openclaw experiment: A warning for enterprise ai security and the rise of the “lethal trifecta.”, 2026. URL [https://www.sophos.com/en-us/blog/the-openclaw-experiment-is-a-warning-for-enterprise-ai-security](https://www.sophos.com/en-us/blog/the-openclaw-experiment-is-a-warning-for-enterprise-ai-security). + +[^97]: K. Meng, D. Bau, A. Andonian, and Y. Belinkov. Locating and editing factual associations in GPT. In *Advances in Neural Information Processing Systems*, volume 35, pages 17359–17372, 2022. + +[^98]: S. Mishra, S. Niroula, U. Yadav, D. Thakur, S. Gyawali, and S. Gaire. Sok: Agentic retrieval-augmented generation (rag): Taxonomy, architectures, evaluation, and research directions. *arXiv preprint arXiv:2603.07379*, 2026. + +[^99]: E. Mitchell, C. Lin, A. Bosselut, C. Finn, and C. D. Manning. Fast model editing at scale. In *International Conference on Learning Representations*, 2022. URL [https://openreview.net/forum?id=0DcZxeWfOPt](https://openreview.net/forum?id=0DcZxeWfOPt). + +[^100]: Y. Nakajima. BabyAGI. [https://github.com/yoheinakajima/babyagi](https://github.com/yoheinakajima/babyagi), 2023. GitHub repository, accessed 2026-04-02. + +[^101]: S. Nandi, A. Datta, R. Nama, U. Patel, N. Vichare, I. Bhattacharya, P. Grover, S. Asija, G. Carenini, W. Zhang, A. Gupta, S. Bhaduri, J. Xu, H. Raja, S. Ray, A. Chan, E. X. Fei, G. Du, Z. Akhtar, H. Asnani, W. Chan, M. Xiong, F. Carbone, and J. Mirchandani. Sop-bench: Complex industrial sops for evaluating llm agents, 2026. URL [https://arxiv.org/abs/2506.08119](https://arxiv.org/abs/2506.08119). + +[^102]: X. Nie, Z. Guo, Z. Cui, J. Yang, Z. Chen, L. De, Y. Zhang, J. Liao, B. Huang, Y. Yang, Z. Han, Z. Peng, L. Chen, W. T. Tang, Z. Liu, T. Zhou, B. A. Hu, S. Tang, J. Lin, W. Liu, M. Wen, Y. Zhou, and W. Zhang. Holos: A web-scale llm-based multi-agent system for the agentic web, 2026. URL [https://arxiv.org/abs/2604.02334](https://arxiv.org/abs/2604.02334). + +[^103]: D. A. Norman. Cognitive artifacts. In J. M. Carroll, editor, *Designing Interaction: Psychology at the Human-Computer Interface*, pages 17–38. Cambridge University Press, Cambridge, 1991. + +[^104]: D. A. Norman. *Things That Make Us Smart: Defending Human Attributes in the Age of the Machine*. Addison-Wesley, Reading, MA, 1993. + +[^105]: K. Nottingham, B. P. Majumder, B. D. Mishra, S. Singh, P. Clark, and R. Fox. Skill set optimization: Reinforcing language model behavior via transferable skills. *arXiv preprint arXiv:2402.03244*, 2024. + +[^106]: A. Oelen, M. Y. Jaradeh, and S. Auer. Introducing orkg ask: An ai-driven scholarly literature search and exploration system taking a neuro-symbolic approach. In *International Conference on Web Engineering*, pages 11–25. Springer, 2025. + +[^107]: OpenAI. Function calling and other API updates. [https://openai.com/index/function-calling-and-other-api-updates/](https://openai.com/index/function-calling-and-other-api-updates/), June 2023a. OpenAI blog post, June 13, 2023. + +[^108]: OpenAI. GPT-4 technical report. *arXiv preprint arXiv:2303.08774*, 2023b. URL [https://arxiv.org/abs/2303.08774](https://arxiv.org/abs/2303.08774). + +[^109]: OpenAI. Introducing codex. [https://openai.com/index/introducing-codex/](https://openai.com/index/introducing-codex/), May 2025a. Accessed: 2026-04-06. + +[^110]: OpenAI. Introducing deep research. [https://openai.com/index/introducing-deep-research/](https://openai.com/index/introducing-deep-research/), Feb. 2025b. OpenAI release post, February 2, 2025; accessed 2026-04-02. + +[^111]: OpenAPI Initiative. Openapi specification version 3.1.0, 2021. URL [https://spec.openapis.org/oas/v3.1.0.html](https://spec.openapis.org/oas/v3.1.0.html). + +[^112]: L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray, et al. Training language models to follow instructions with human feedback. In *Advances in Neural Information Processing Systems*, volume 35, pages 27730–27744, 2022. + +[^113]: C. Packer, S. Wooders, K. Lin, V. Fang, S. G. Patil, I. Stoica, and J. E. Gonzalez. MemGPT: Towards LLMs as operating systems. *arXiv preprint arXiv:2310.08560*, 2023. [10.48550/arXiv.2310.08560](https://arxiv.org/doi.org/10.48550/arXiv.2310.08560). + +[^114]: G. Park, S. Lee, and Y. Park. Minimizing response latency in llm-based agent systems: A comprehensive survey. *IEEE Access*, 2026. + +[^115]: J. S. Park, J. C. O’Brien, C. J. Cai, M. R. Morris, P. Liang, and M. S. Bernstein. Generative agents: Interactive simulacra of human behavior. In *Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology*, pages 1–22. ACM, 2023. + +[^116]: B. Patel, D. Belli, A. Jalalirad, M. Arnold, A. Ermolov, and B. Major. Dynamic tool dependency retrieval for efficient function calling. *arXiv preprint arXiv:2512.17052*, 2025. + +[^117]: S. G. Patil, T. Zhang, X. Wang, and J. E. Gonzalez. Gorilla: Large language model connected with massive apis, 2023. URL [https://arxiv.org/abs/2305.15334](https://arxiv.org/abs/2305.15334). + +[^118]: B. Peng, J. Quesnelle, H. Fan, and E. Shao. YaRN: Efficient context window extension of large language models. *arXiv preprint arXiv:2309.00071*, 2024. URL [https://arxiv.org/abs/2309.00071](https://arxiv.org/abs/2309.00071). + +[^119]: C. C. Phiri. Creating characteristically auditable agentic ai systems. In *Proceedings of the Intelligent Robotics FAIR 2025*, IntRob ’25, page 1–14, New York, NY, USA, 2025. Association for Computing Machinery. ISBN 9798400715891. [10.1145/3759355.3759356](https://arxiv.org/doi.org/10.1145/3759355.3759356). URL [https://doi.org/10.1145/3759355.3759356](https://doi.org/10.1145/3759355.3759356). + +[^120]: R. Pryzant, D. Iter, J. Li, Y. T. Lee, C. Zhu, and M. Zeng. Automatic prompt optimization with “gradient descent” and beam search. *arXiv preprint arXiv:2305.03495*, 2023. URL [https://arxiv.org/abs/2305.03495](https://arxiv.org/abs/2305.03495). + +[^121]: Y. Qin, S. Liang, Y. Ye, K. Zhu, L. Yan, Y. Lu, Y. Lin, X. Cong, X. Tang, B. Qian, S. Zhao, L. Hong, R. Tian, R. Xie, J. Zhou, M. Gerstein, D. Li, Z. Liu, and M. Sun. Toolllm: Facilitating large language models to master 16000+ real-world apis, 2023. URL [https://arxiv.org/abs/2307.16789](https://arxiv.org/abs/2307.16789). + +[^122]: S. Qiu, J. Li, Z. Zhou, J. Huang, L. Qiu, and Z. Sun. Logits replay+ moclip: Stabilized, low-cost post-training with minimal forgetting. *arXiv preprint arXiv:2510.09152*, 2025. + +[^123]: C. Qu, S. Dai, X. Wei, H. Cai, S. Wang, D. Yin, J. Xu, and J.-R. Wen. Tool learning with large language models: A survey. *arXiv preprint arXiv:2405.17935*, 2024. + +[^124]: Qwen Team. Qwen2.5 technical report. *arXiv preprint arXiv:2412.15115*, 2025. URL [https://arxiv.org/abs/2412.15115](https://arxiv.org/abs/2412.15115). + +[^125]: R. Rafailov, A. Sharma, E. Mitchell, S. Ermon, C. D. Manning, and C. Finn. Direct preference optimization: Your language model is secretly a reward model. In *Advances in Neural Information Processing Systems*, volume 36, 2023. + +[^126]: O. Ram, Y. Levine, I. Dalmedigos, D. Muhlgay, A. Shashua, K. Leyton-Brown, and Y. Shoham. In-context retrieval-augmented language models. *Transactions of the Association for Computational Linguistics*, 11:1316–1331, 2023. [10.1162/tacl\_a\_00605](https://arxiv.org/doi.org/10.1162/tacl_a_00605). URL [https://aclanthology.org/2023.tacl-1.75/](https://aclanthology.org/2023.tacl-1.75/). + +[^127]: T. B. Richards. Auto-GPT: An autonomous GPT-4 experiment. [https://github.com/Significant-Gravitas/Auto-GPT](https://github.com/Significant-Gravitas/Auto-GPT), 2023. GitHub repository, accessed 2026-04-02. + +[^128]: H. Ross, A. S. Mahabaleshwarkar, and Y. Suhara. When2call: When (not) to call tools. In *Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)*, pages 3391–3409, 2025. + +[^129]: T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, and T. Scialom. Toolformer: Language models can teach themselves to use tools. In *Advances in Neural Information Processing Systems*, volume 36, 2023. + +[^130]: N. Shinn, F. Cassano, A. Gopinath, K. Narasimhan, and S. Yao. Reflexion: Language agents with verbal reinforcement learning. *Advances in Neural Information Processing Systems*, 36, 2023. + +[^131]: I. Singh, V. Blukis, A. Mousavian, A. Goyal, D. Xu, J. Tremblay, D. Fox, J. Thomason, and A. Garg. Progprompt: Generating situated robot task plans using large language models. *arXiv preprint arXiv:2209.11302*, 2023. + +[^132]: Y. Sui, H. Zhao, R. Ma, Z. He, H. Wang, J. Li, and Y. Yang. Act while thinking: Accelerating llm agents via pattern-aware speculative tool execution. *arXiv preprint arXiv:2603.18897*, 2026. + +[^133]: T. R. Sumers, S. Yao, K. Narasimhan, and T. L. Griffiths. Cognitive architectures for language agents. *Transactions on Machine Learning Research*, 2024. Published in TMLR; available at [https://openreview.net/forum?id=1i6ZCvflQJ](https://openreview.net/forum?id=1i6ZCvflQJ). + +[^134]: P. Tagkopoulos, F. Li, and I. Tagkopoulos. Skillflow: Efficient skill and code transfer through communication in adapting ai agents. *arXiv preprint arXiv:2504.06188*, 2025. + +[^135]: A. Takyar. Unlocking ai interoperability: A deep dive into the model context protocol (mcp), 2025. URL [https://zbrain.ai/model-context-protocol/](https://zbrain.ai/model-context-protocol/). + +[^136]: G. Theraulaz and E. Bonabeau. A brief history of stigmergy. *Artificial life*, 5(2):97–116, 1999. + +[^137]: S. Timmermans and S. Epstein. A world of standards but not a standard world: Toward a sociology of standards and standardization. *Annual review of Sociology*, 36(1):69–89, 2010. + +[^138]: H. Touvron, T. Lavril, G. Izacard, X. Martinet, M.-A. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar, et al. LLaMA: Open and efficient foundation language models. *arXiv preprint arXiv:2302.13971*, 2023. [10.48550/arXiv.2302.13971](https://arxiv.org/doi.org/10.48550/arXiv.2302.13971). URL [https://arxiv.org/abs/2302.13971](https://arxiv.org/abs/2302.13971). + +[^139]: UCP Documentation. Ucp and ap2 integration. [https://ucp.dev/documentation/ucp-and-ap2/](https://ucp.dev/documentation/ucp-and-ap2/), 2026. Explains that AP2 serves as the trust and payment layer for transactions executed within the UCP commerce lifecycle. + +[^140]: G. Wang, Y. Xie, Y. Jiang, A. Mandlekar, C. Xiao, Y. Zhu, L. Fan, and A. Anandkumar. Voyager: An open-ended embodied agent with large language models. *arXiv preprint arXiv:2305.16291*, 2023a. + +[^141]: J. Wang, Y. Ming, Z. Ke, S. Joty, A. Albarghouthi, and F. Sala. Skillorchestra: Learning to route agents via skill transfer, 2026a. URL [https://arxiv.org/abs/2602.19672](https://arxiv.org/abs/2602.19672). + +[^142]: L. Wang, C. Ma, X. Feng, Z. Zhang, H. Yang, J. Zhang, Z. Chen, J. Tang, X. Chen, Y. Lin, W. X. Zhao, Z. Wei, and J.-R. Wen. A survey on large language model based autonomous agents. *Frontiers of Computer Science*, 18(6):186345, 2024a. + +[^143]: Q. Wang, Y. Hu, M. Lu, J. Wu, Y. Liu, and Y. Tang. Beyond accuracy: A cognitive load framework for mapping the capability boundaries of tool-use agents. *arXiv preprint arXiv:2601.20412*, 2026b. + +[^144]: Q. Wang, B. Ma, M. Xu, and Y. Zhang. When skills lie: Hidden-comment injection in llm agents. *arXiv preprint arXiv:2602.10498*, 2026c. + +[^145]: S. Wang, J. Jin, R. Fu, Z. Yan, X. Wang, M. Hu, E. Wang, X. Li, K. Zhang, L. Yao, W. Jiao, X. Cheng, Y. Lu, and Z. Ge. Museagent: A multimodal reasoning agent with stateful experiences, 2026d. URL [https://arxiv.org/abs/2603.27813](https://arxiv.org/abs/2603.27813). + +[^146]: T. Wang, R. Shan, J. Lin, J. Wu, T. Xu, J. Zhang, W. Chen, C. Zhang, Z. Wang, W. Zhang, et al. Oscar: Optimization-steered agentic planning for composed image retrieval. *arXiv preprint arXiv:2602.08603*, 2026e. + +[^147]: X. Wang, J. Wei, D. Schuurmans, Q. V. Le, E. H. Chi, S. Narang, A. Chowdhery, and D. Zhou. Self-consistency improves chain of thought reasoning in language models. In *International Conference on Learning Representations*, 2023b. URL [https://openreview.net/forum?id=1PL1NIMMrw](https://openreview.net/forum?id=1PL1NIMMrw). + +[^148]: X. Wang, B. Chen, et al. OpenDevin: An open platform for AI software developers as generalist agents. *arXiv preprint arXiv:2407.16741*, 2024b. URL [https://arxiv.org/abs/2407.16741](https://arxiv.org/abs/2407.16741). + +[^149]: X. Wang, S. Rosenberg, J. Michelini, C. Smith, H. Tran, E. Nyst, R. Malhotra, X. Zhou, V. Chen, R. Brennan, et al. The openhands software agent sdk: A composable and extensible foundation for production agents. *arXiv preprint arXiv:2511.03690*, 2025a. + +[^150]: X. Wang, J. Shi, S. Feng, P. Yuan, Y. Li, Y. Zhang, C. Tan, J. Zhang, B. Pan, Y. Hu, et al. Do not waste your rollouts: Recycling search experience for efficient test-time scaling. *arXiv preprint arXiv:2601.21684*, 2026f. + +[^151]: Y. Wang and X. Chen. Mirix: Multi-agent memory system for llm-based agents. *arXiv preprint arXiv:2507.07957*, 2025. + +[^152]: Y. Wang, R. Takanobu, Z. Liang, Y. Mao, Y. Hu, J. McAuley, and X. Wu. Mem- $\{$ $\backslash$ alpha $\}$: Learning memory construction via reinforcement learning. *arXiv preprint arXiv:2509.25911*, 2025b. + +[^153]: Z. Z. Wang, A. Gandhi, G. Neubig, and D. Fried. Inducing programmatic skills for agentic tasks. *arXiv preprint arXiv:2504.06821*, 2025c. + +[^154]: D. M. Wegner. Transactive memory: A contemporary analysis of the group mind. In *Theories of group behavior*, pages 185–208. Springer, 1987. + +[^155]: J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. H. Chi, Q. V. Le, and D. Zhou. Chain-of-thought prompting elicits reasoning in large language models. In *Advances in Neural Information Processing Systems*, volume 35, pages 24824–24837, 2022. + +[^156]: J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. Chi, Q. Le, and D. Zhou. Chain-of-thought prompting elicits reasoning in large language models, 2023. URL [https://arxiv.org/abs/2201.11903](https://arxiv.org/abs/2201.11903). + +[^157]: Q. Wu, G. Bansal, J. Zhang, Y. Wu, B. Li, E. Zhu, L. Jiang, X. Zhang, S. Zhang, J. Liu, et al. AutoGen: Enabling next-gen LLM applications via multi-agent conversation. *arXiv preprint arXiv:2308.08155*, 2023. URL [https://arxiv.org/abs/2308.08155](https://arxiv.org/abs/2308.08155). + +[^158]: Y. Wu and Y. Zhang. Agent skills from the perspective of procedural memory: A survey. *TechRxiv*, 2026. [10.36227/techrxiv.176857932.25697838/v1](https://arxiv.org/doi.org/10.36227/techrxiv.176857932.25697838/v1). + +[^159]: Z. Wu, C. Han, Z. Ding, Z. Weng, Z. Liu, S. Yao, T. Yu, and L. Kong. OS-Copilot: Towards generalist computer agents with self-improvement. *arXiv preprint arXiv:2402.07456*, 2024. URL [https://arxiv.org/abs/2402.07456](https://arxiv.org/abs/2402.07456). + +[^160]: Z. Wu, H. Huang, Y. Yang, Y. Song, X. Lou, W. Liu, W. Zhang, J. Wang, and Z. Zhang. Quick on the uptake: Eliciting implicit intents from human demonstrations for personalized mobile-use agents. *arXiv preprint arXiv:2508.08645*, 2025. + +[^161]: Y. Xi, W. Liu, J. Lin, B. Chen, R. Tang, W. Zhang, and Y. Yu. Memocrs: Memory-enhanced sequential conversational recommender systems with large language models. In *Proceedings of the 33rd ACM International Conference on Information and Knowledge Management*, pages 2585–2595, 2024. + +[^162]: Y. Xi, J. Lin, Y. Xiao, Z. Zhou, R. Shan, T. Gao, J. Zhu, W. Liu, Y. Yu, and W. Zhang. A survey of llm-based deep search agents: Paradigm, optimization, evaluation, and challenges. *arXiv preprint arXiv:2508.05668*, 2025. + +[^163]: Z. Xi, W. Chen, X. Guo, W. He, Y. Ding, B. Hong, M. Zhang, J. Wang, S. Jin, E. Zhou, et al. The rise and potential of large language model based agents: A survey. *arXiv preprint arXiv:2309.07864*, 2023. URL [https://arxiv.org/abs/2309.07864](https://arxiv.org/abs/2309.07864). + +[^164]: H. Xu, Z. Wang, Z. Zhu, L. Pan, X. Chen, S. Fan, L. Chen, and K. Yu. Alignment for efficient tool calling of large language models. In *Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*, pages 17787–17803, 2025a. + +[^165]: R. Xu and Y. Yan. Agent skills for large language models: Architecture, acquisition, security, and the path forward. *arXiv preprint arXiv:2602.12430*, 2026a. + +[^166]: R. Xu and Y. Yan. Agent skills for large language models: Architecture, acquisition, security, and the path forward, 2026b. URL [https://arxiv.org/abs/2602.12430](https://arxiv.org/abs/2602.12430). + +[^167]: T. Xu, R. Shan, J. Wu, J. Huang, T. Wang, J. Zhu, W. Chen, M. Tu, Q. Dou, Z. Wang, et al. Photobench: Beyond visual matching towards personalized intent-driven photo retrieval. *arXiv preprint arXiv:2603.01493*, 2026a. + +[^168]: W. Xu, Z. Liang, K. Mei, H. Gao, J. Tan, and Y. Zhang. A-MEM: Agentic memory for LLM agents. *arXiv preprint arXiv:2502.12110*, 2025b. [10.48550/arXiv.2502.12110](https://arxiv.org/doi.org/10.48550/arXiv.2502.12110). NeurIPS 2025. + +[^169]: Y. Xu, Q. Chen, Z. Ma, D. Liu, W. Wang, X. Wang, L. Xiong, and W. Wang. Toward personalized llm-powered agents: Foundations, evaluation, and future directions. *arXiv preprint arXiv:2602.22680*, 2026b. + +[^170]: B. Yan, C. Li, H. Qian, S. Lu, and Z. Liu. General agentic memory via deep research. *arXiv preprint arXiv:2511.18423*, 2025a. + +[^171]: S. Yan, X. Yang, Z. Huang, E. Nie, Z. Ding, Z. Li, X. Ma, J. Bi, K. Kersting, J. Z. Pan, et al. Memory-r1: Enhancing large language model agents to manage and utilize memories via reinforcement learning. *arXiv preprint arXiv:2508.19828*, 2025b. + +[^172]: J. Yang, C. E. Jimenez, A. Wettig, K. Liber, K. Narasimhan, and O. Press. SWE-agent: Agent–computer interfaces enable automated software engineering. *arXiv preprint arXiv:2405.15793*, 2024a. URL [https://arxiv.org/abs/2405.15793](https://arxiv.org/abs/2405.15793). + +[^173]: J. Yang, C. E. Jimenez, A. Wettig, K. Lieret, S. Yao, K. Narasimhan, and O. Press. Swe-agent: Agent-computer interfaces enable automated software engineering. *Advances in Neural Information Processing Systems*, 37:50528–50652, 2024b. + +[^174]: Y. Yang, H. Chai, Y. Song, S. Qi, M. Wen, N. Li, J. Liao, H. Hu, J. Lin, G. Chang, W. Liu, Y. Wen, Y. Yu, and W. Zhang. A survey of ai agent protocols, 2025a. URL [https://arxiv.org/abs/2504.16736](https://arxiv.org/abs/2504.16736). + +[^175]: Y. Yang, H. Chai, Y. Song, S. Qi, M. Wen, N. Li, J. Liao, H. Hu, J. Lin, G. Chang, et al. A survey of ai agent protocols. *arXiv preprint arXiv:2504.16736*, 2025b. + +[^176]: S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao. React: Synergizing reasoning and acting in language models, 2023a. URL [https://arxiv.org/abs/2210.03629](https://arxiv.org/abs/2210.03629). + +[^177]: S. Yao, D. Yu, J. Zhao, I. Shafran, T. L. Griffiths, Y. Cao, and K. Narasimhan. Tree of thoughts: Deliberate problem solving with large language models. *Advances in Neural Information Processing Systems*, 36, 2024. + +[^178]: Y. Yao, P. Wang, B. Tian, S. Cheng, Z. Li, S. Deng, H. Chen, and N. Zhang. Editing large language models: Problems, methods, and opportunities. *arXiv preprint arXiv:2305.13172*, 2023b. URL [https://arxiv.org/abs/2305.13172](https://arxiv.org/abs/2305.13172). + +[^179]: A. Ye, Q. Ma, J. Chen, M. Li, T. Li, F. Liu, S. Mai, M. Lu, H. Bao, and Y. You. Sop-agent: Empower general purpose ai agent with domain-specific sops, 2025. URL [https://arxiv.org/abs/2501.09316](https://arxiv.org/abs/2501.09316). + +[^180]: Y. Ye, H. Jiang, F. Jiang, T. Lan, Y. Du, B. Fu, X. Shi, Q. Jia, L. Wang, and W. Luo. Umem: Unified memory extraction and management framework for generalizable memory. *arXiv preprint arXiv:2602.10652*, 2026. + +[^181]: C. Yu, Y. Wang, S. Wang, H. Yang, and M. Li. Infiagent: An infinite-horizon framework for general-purpose autonomous agents, 2026. URL [https://arxiv.org/abs/2601.03204](https://arxiv.org/abs/2601.03204). + +[^182]: S. Yu, G. Li, W. Shi, and P. Qi. Polyskill: Learning generalizable skills through polymorphic abstraction. *arXiv preprint arXiv:2510.15863*, 2025. + +[^183]: S. Yuan, J. Wang, Z. Liu, M. Yuan, H. Peng, J. Zhao, B. Wang, and H. Wang. Ted: Training-free experience distillation for multimodal reasoning, 2026. URL [https://arxiv.org/abs/2603.26778](https://arxiv.org/abs/2603.26778). + +[^184]: G. Zhang, H. Ren, C. Zhan, Z. Zhou, J. Wang, H. Zhu, W. Zhou, and S. Yan. Memevolve: Meta-evolution of agent memory systems. *arXiv preprint arXiv:2512.18746*, 2025a. + +[^185]: H. Zhang, Q. Long, J. Bao, T. Feng, W. Zhang, H. Yue, and W. Wang. Memskill: Learning and evolving memory skills for self-evolving agents. *arXiv preprint arXiv:2602.02474*, 2026a. + +[^186]: H. Zhang, H. Yue, T. Feng, Q. Long, J. Bao, B. Jin, W. Zhang, X. Li, J. You, C. Qin, et al. Learning query-aware budget-tier routing for runtime agent memory. *arXiv preprint arXiv:2602.06025*, 2026b. + +[^187]: K. Zhang, X. Chen, B. Liu, T. Xue, Z. Liao, Z. Liu, X. Wang, Y. Ning, Z. Chen, X. Fu, et al. Agent learning via early experience. *arXiv preprint arXiv:2510.08558*, 2025b. + +[^188]: S. Zhang, J. Wang, R. Zhou, J. Liao, Y. Feng, Z. Li, Y. Zheng, W. Zhang, Y. Wen, Z. Li, et al. Memrl: Self-evolving agents via runtime reinforcement learning on episodic memory. *arXiv preprint arXiv:2601.03192*, 2026c. + +[^189]: W. Zhang, J. Liao, N. Li, K. Du, and J. Lin. Agentic information retrieval. *arXiv preprint arXiv:2410.09713*, 2024. + +[^190]: Z. Zhang, Q. Dai, R. Li, X. Bo, X. Chen, and Z. Dong. Learn to memorize: Optimizing llm-based agents with adaptive memory framework. *arXiv preprint arXiv:2508.16629*, 2025c. + +[^191]: Z. Zhang, Z. Wei, and M. Sun. Dynamic orthogonal continual fine-tuning for mitigating catastrophic forgettings. *arXiv preprint arXiv:2509.23893*, 2025d. + +[^192]: H. Zhao, H. Chen, F. Yang, N. Liu, H. Deng, H. Cai, S. Wang, D. Yin, and M. Du. Explainability for large language models: A survey. *ACM Transactions on Intelligent Systems and Technology*, 15(2):1–38, 2024. + +[^193]: S. Zhao, F. Liu, X. Zhang, H. Chen, X. Gu, Z. Jiang, F. Ling, B. Fei, W. Zhang, J. Wang, et al. Openearth-agent: From tool calling to tool creation for open-environment earth observation. *arXiv preprint arXiv:2603.22148*, 2026a. + +[^194]: Y. Zhao, C. Dai, Y. Xiu, M. Kou, Y. Zheng, and D. Niyato. Shardmemo: Masked moe routing for sharded agentic llm memory. *arXiv preprint arXiv:2601.21545*, 2026b. + +[^195]: B. Zheng, M. Y. Fatemi, X. Jin, Z. Z. Wang, A. Gandhi, Y. Song, Y. Gu, J. Srinivasa, G. Liu, G. Neubig, et al. Skillweaver: Web agents can self-improve by discovering and honing skills. *arXiv preprint arXiv:2504.07079*, 2025a. + +[^196]: C. Zheng, J. Zhu, Z. Ou, Y. Chen, K. Zhang, R. Shan, Z. Zheng, M. Yang, J. Lin, Y. Yu, et al. A survey of process reward models: From outcome signals to process supervisions for large language models. *arXiv preprint arXiv:2510.08049*, 2025b. + +[^197]: L. Zheng, R. Wang, X. Wang, and B. An. Synapse: Trajectory-as-exemplar prompting with memory for computer control. *arXiv preprint arXiv:2306.07863*, 2023. + +[^198]: W. Zhong, L. Guo, Q. Gao, H. Ye, and Y. Wang. Memorybank: Enhancing large language models with long-term memory. In *Proceedings of the AAAI conference on artificial intelligence*, volume 38, pages 19724–19731, 2024. + +[^199]: H. Zhou, Y. Chen, S. Guo, X. Yan, K. H. Lee, Z. Wang, K. Y. Lee, G. Zhang, K. Shao, L. Yang, et al. Memento: Fine-tuning llm agents without fine-tuning llms. *arXiv preprint arXiv:2508.16153*, 2025. + +[^200]: Y. Zhou, A. I. Muresanu, Z. Han, K. Paster, S. Pitis, H. Chan, and J. Ba. Large language models are human-level prompt engineers. In *International Conference on Learning Representations*, 2023. URL [https://openreview.net/forum?id=92gvk82DE-](https://openreview.net/forum?id=92gvk82DE-). + +[^201]: J. Zhu, M. Zhu, R. Rui, R. Shan, C. Zheng, B. Chen, Y. Xi, J. Lin, W. Liu, R. Tang, et al. Evolutionary perspectives on the evaluation of llm-based ai agents: A comprehensive survey. *arXiv preprint arXiv:2506.11102*, 2025. + +[^202]: J. Zhu, L. Yang, R. Shan, C. Zheng, Z. Zheng, W. Liu, Y. Yu, W. Zhang, and J. Lin. Turing test on screen: Abenchmark for mobile gui agent humanization. 2026. + +[^203]: L. Zhu and Q. Lu. Verifiability-first ai engineering in the era of aiware: A conceptual framework, design principles, and architectural patterns for scalable verification. *Design Principles, and Architectural Patterns for Scalable Verification (January 07, 2026)*, 2026. + +[^204]: J. Zou, L. Yang, Y. Qi, S. Chen, M. Ai, K. Shen, J. He, and M. Wang. Autotool: Dynamic tool selection and integration for agentic reasoning, 2025. URL [https://arxiv.org/abs/2512.13278](https://arxiv.org/abs/2512.13278). \ No newline at end of file diff --git a/raw/Harness Engineering - first thoughts.md b/raw/Harness Engineering - first thoughts.md new file mode 100644 index 0000000..08f5e70 --- /dev/null +++ b/raw/Harness Engineering - first thoughts.md @@ -0,0 +1,69 @@ +--- +title: "Harness Engineering - first thoughts" +source: "https://martinfowler.com/articles/exploring-gen-ai/harness-engineering-memo.html" +author: + - "[[Birgitta Böckeler Birgitta is a Distinguished Engineer and AI-assisted delivery expert at Thoughtworks. She has over 20 years of experience as a software developer]]" + - "[[architect and technical leader.]]" +published: +created: 2026-04-11 +description: "Notes from my Thoughtworks colleagues on AI-assisted software delivery" +tags: + - "clippings" +--- +Since writing this memo, I have had time to analyze the topic further and write a [more considered article describing Harness Engineering](https://martinfowler.com/articles/harness-engineering.html). This frames the elements of a harness as guides and sensors, which may be computational or inferential. Harness templates allow us to share common guides and sensors around a larger software organization. Harnesses attempt to externalise and make explicit what human developer experience brings to the table, but they can only go so far. A good harness should not necessarily aim to fully eliminate human input, but to direct it to where our input is most important. + +It was very interesting to read [OpenAI’s recent write-up on “Harness engineering”](https://openai.com/index/harness-engineering/) which describes how a team used “no manually typed code at all” as a forcing function to build a harness for maintaining a large application with AI agents. After 5 months, they’ve built a real product that’s now over 1 million lines of code. + +The article is titled “Harness engineering: leveraging Codex in an agent-first world”, but only mentions “harness” once in the text. Maybe the term was an afterthought inspired by [Mitchell Hashimoto](https://mitchellh.com/writing/my-ai-adoption-journey#step-5-engineer-the-harness) ’s recent blog post. Either way, I like “harness” as a word to describe the tooling and practices we can use to keep AI agents in check. + +The OpenAI team’s harness components mix deterministic and LLM-based approaches across 3 categories (grouping based on my interpretation): + +1. **Context engineering**: Continuously enhanced knowledge base in the codebase, plus agent access to dynamic context like observability data and browser navigation +2. **Architectural constraints**: Monitored not only by the LLM-based agents, but also deterministic custom linters and structural tests +3. **“Garbage collection”**: Agents that run periodically to find inconsistencies in documentation or violations of architectural constraints, fighting entropy and decay + +They also highlight how iterative this is: “When the agent struggles, we treat it as a signal: identify what is missing — tools, guardrails, documentation — and feed it back into the repository, always by having Codex itself write the fix.” + +All of the described measures focus on increasing long-term internal quality and maintainability. What I am missing in the write-up is verification of functionality and behaviour. + +Leaving that gap aside, and assuming we can trust OpenAI’s representation of the success of this (with respect to the author and the team, OpenAI do have a vested interest in us believing in AI-maintainable code) — here are my thoughts on what *is* in the article. + +### Harnesses - the future service templates? + +Most organizations have just two or three main tech stacks — not every application is its own snowflake. The article made me imagine a future where teams pick from a set of harnesses for common application topologies to get started. This evokes today’s service templates, which help teams instantiate new services on a “golden path”. Will harnesses — with custom linters, structural tests, basic context and knowledge documentation, and additional context providers — become the new service templates? Will teams use them as a starting point, then shape them over time for their application’s specifics? + +With service templates, teams contribute back as they gain experience, then other teams often struggle to incorporate updates. Would we see a similar forking and synchronization challenge with harnesses? + +The article also made me revisit some of my older hypotheses: + +### The runtime has to be constrained for more AI autonomy? + +A lot of early and current AI coding hype assumes LLMs will give us unlimited flexibility of the target runtime. Generate in any language, any pattern, without constraints — the LLM will figure it out. But for maintainable, AI-generated code at scale that we can trust, something has to give. + +The harness described suggests that increasing trust and reliability required constraining the solution space: specific architectural patterns, enforced boundaries, standardized structures. That means giving up some “generate anything” flexibility for prompts, rules, and harnesses full of technical specifics. + +### A convergence on a limited number of tech stacks and topologies? + +As coding becomes less about typing code and more about steering its generation, AI might push us toward fewer tech stacks. Usability of frameworks and SDKs still matters — we’re seeing repeatedly that what’s good for humans is good for AI. But developer tastes will matter less at that level of detail. Little inefficiencies and idiosyncracies in interfaces will be less annoying since we don’t deal with them directly. We might choose stacks with good harnesses available and prioritize “AI-friendliness”. + +This might apply not just to tech stacks, but also to codebase structures and topologies. We might default to structures that are easier to maintain with AI because they’re easier to harness. The OpenAI team discusses architectural rigidity and enforcement rules. The main focus areas I can see are keeping data structures stable and defining and enforcing module boundaries. Sounds reasonable — but without concrete examples, I’m still struggling to imagine what “we require Codex to parse data shapes at the boundary” looks like in practice in their harness. + +But if we can figure out widely how to harness codebase design patterns, will these topologies become the new abstraction layer, not natural language itself like so many AI enthusiasts hope? + +### Two future worlds: Pre-AI vs post-AI application maintenance? + +Say we develop good harnessing techniques to turn AI autonomy up to 9 and increase our confidence in the results. Which techniques could we apply to existing applications, and which would only work for applications built from scratch with a harness in mind? + +For older codebases, we’d need to consider whether retrofitting a harness is worth the effort. AI can help us do that faster, but those applications are often so non-standardized and full of entropy that it might not be worthwhile. It makes me think of running a static code analysis tool on a codebase that’s never had one, and then drowning in alerts. + +### What’s your harness today? + +That this team worked on their harness for 5 months shows this isn’t something you can jump into for quick results. But it’s worth reflecting on what your harness is today. Do you have a pre-commit hook? What’s in it? Do you have ideas for custom linters? What architectural constraints would you like to impose on your codebase? Have you experimented with structural testing frameworks like ArchUnit? + +### Final thoughts + +Unsurprisingly, what they describe sounds like much more work than just generating and maintaining a bunch of Markdown rules files. They built extensive tooling for the deterministic part of the harness. Their context engineering involved not only curating a knowledge base, but also significant design work — the code design itself is a huge part of the context. + +The OpenAI team says: “Our most difficult challenges now center on designing environments, feedback loops, and control systems.” This reminded me of [Chad Fowler’s recent post on “Relocating Rigor”](https://aicoding.leaflet.pub/3mbrvhyye4k2e). It’s refreshing to hear concrete ideas and experiences about where that rigor might go, rather than just hoping “better models” will magically solve maintainability issues. + +And finally, for once, I like a term in this space. Though it’s only 2 weeks old — I can probably hold my metaphorical breath until somebody calls their one-prompt, LLM-based code review agent a harness… \ No newline at end of file diff --git a/raw/Harness Engineering The Complete Guide to Building Systems That Make AI Agents Actually Work (2026).md b/raw/Harness Engineering The Complete Guide to Building Systems That Make AI Agents Actually Work (2026).md new file mode 100644 index 0000000..c8009e3 --- /dev/null +++ b/raw/Harness Engineering The Complete Guide to Building Systems That Make AI Agents Actually Work (2026).md @@ -0,0 +1,330 @@ +--- +title: "Harness Engineering: The Complete Guide to Building Systems That Make AI Agents Actually Work (2026)" +source: "https://www.nxcode.io/resources/news/harness-engineering-complete-guide-ai-agent-codex-2026" +author: + - "[[NxCode Team]]" +published: 2026-03-01 +created: 2026-04-11 +description: "Harness engineering is the new discipline of designing environments, constraints, and feedback loops that make AI coding agents reliable at scale. OpenAI built 1M+ lines of code with zero human-written code using this approach." +tags: + - "clippings" +--- +Turn your idea into a working app — no coding required.[Start Free](https://studio.nxcode.io/?ref=article_top_harness-engineering-complete-guide-ai-agent-codex-2026&article=harness-engineering-complete-guide-ai-agent-codex-2026) + +## Harness Engineering: The Complete Guide to Building Systems That Make AI Agents Actually Work + +**March 2026** — If 2025 was the year AI agents proved they could write code, 2026 is the year we learned that **the agent isn't the hard part — the harness is.** + +OpenAI's Codex team just built a production application with **over 1 million lines of code** where **zero lines were written by human hands**. The engineers didn't write code. They designed the system that let AI write code reliably. That system — the constraints, feedback loops, documentation, linters, and lifecycle management — is what the industry now calls a **harness**. + +**Harness engineering** is the new discipline of designing these systems. And it's changing what it means to be a software engineer. + +--- + +## What Is Harness Engineering? + +### The Horse Metaphor + +The term "harness" comes from horse tack — reins, saddle, bit — the complete set of equipment for channeling a powerful but unpredictable animal in the right direction. The metaphor is deliberate: + +- The **horse** is the AI model — powerful, fast, but it doesn't know where to go on its own +- The **harness** is the infrastructure — constraints, guardrails, feedback loops that channel the model's power productively +- The **rider** is the human engineer — providing direction, not doing the running + +Without a harness, an AI agent is a thoroughbred in an open field. Fast, impressive, and completely useless for getting anything done. + +### The Formal Definition + +**Harness engineering** is the design and implementation of systems that: + +1. **Constrain** what an AI agent can do (architectural boundaries, dependency rules) +2. **Inform** the agent about what it should do (context engineering, documentation) +3. **Verify** that the agent did it correctly (testing, linting, CI validation) +4. **Correct** the agent when it goes wrong (feedback loops, self-repair mechanisms) + +Martin Fowler describes it as *"the tooling and practices we can use to keep AI agents in check"* — but it's more than just safety. A good harness makes agents **more capable**, not just more controlled. + +--- + +## Why Harness Engineering Matters Now + +### The Model Is Commodity. The Harness Is Moat. + +Here's the uncomfortable truth the AI industry is confronting: **the underlying model matters less than the system around it.** + +LangChain proved this definitively. Their coding agent went from **52.8% to 66.5%** on Terminal Bench 2.0 — jumping from **Top 30 to Top 5** — by changing nothing about the model. They only changed the harness: + +| Change | What They Did | Impact | +| --- | --- | --- | +| Self-verification loop | Added pre-completion checklist middleware | Caught errors before submission | +| Context engineering | Mapped directory structures at startup | Agent understood codebase from the start | +| Loop detection | Tracked repeated file edits | Prevented "doom loops" | +| Reasoning sandwich | High reasoning for planning/verification, medium for implementation | Better quality within time budgets | + +**Same model. Different harness. Dramatically better results.** + +### OpenAI's 1 Million Line Proof Point + +OpenAI's experiment is the most compelling evidence yet: + +- **5 months** of development +- **1 million+ lines of code** in the final product +- **Zero manually written lines** — every line was produced by Codex agents +- **Built in ~1/10th the time** it would have taken humans +- The product has **internal daily users and external alpha testers** +- It **ships, deploys, breaks, and gets fixed** — all by agents within the harness + +The engineers' job? Designing the harness. Specifying intent. Providing feedback. Not writing code. + +--- + +## The Three Pillars of Harness Engineering + +OpenAI's framework organizes harness engineering into three core categories: + +### 1\. Context Engineering + +Context engineering is about ensuring the agent has the right information at the right time. + +**Static context:** + +- Repository-local documentation (architecture specs, API contracts, style guides) +- `AGENTS.md` or `CLAUDE.md` files that encode project-specific rules +- Cross-linked design documents validated by linters + +**Dynamic context:** + +- Observability data (logs, metrics, traces) accessible to agents +- Directory structure mapping at agent startup +- CI/CD pipeline status and test results + +**The critical rule:** From the agent's perspective, anything it can't access in-context doesn't exist. Knowledge in Google Docs, Slack threads, or people's heads is invisible to the system. **The repository must be the single source of truth.** + +### 2\. Architectural Constraints + +This is where harness engineering diverges most sharply from traditional AI prompting. Instead of telling the agent "write good code," you **mechanically enforce what good code looks like.** + +**Dependency layering:** + +``` +Types → Config → Repo → Service → Runtime → UI +``` + +Each layer can only import from layers to its left. This isn't a suggestion — it's enforced by structural tests and CI validation. + +**Constraint enforcement tools:** + +- **Deterministic linters** — Custom rules that flag violations automatically +- **LLM-based auditors** — Agents that review other agents' code for architectural compliance +- **Structural tests** — Like ArchUnit, but for AI-generated code +- **Pre-commit hooks** — Automated checks before any code is committed + +**Why constraints improve output:** Paradoxically, constraining the solution space makes agents **more productive**, not less. When an agent can generate anything, it wastes tokens exploring dead ends. When the harness defines clear boundaries, the agent converges faster on correct solutions. + +### 3\. Entropy Management ("Garbage Collection") + +This is the most underappreciated component. Over time, AI-generated codebases accumulate entropy — documentation drifts from reality, naming conventions diverge, dead code accumulates. + +Harness engineering addresses this with **periodic cleanup agents:** + +- **Documentation consistency agents** — Verify that docs match current code +- **Constraint violation scanners** — Find code that slipped past earlier checks +- **Pattern enforcement agents** — Identify and fix deviations from established patterns +- **Dependency auditors** — Track and resolve circular or unnecessary dependencies + +These agents run on schedules — daily, weekly, or triggered by specific events — keeping the codebase healthy for both human reviewers and future AI agents. + +--- + +## Harness Engineering in Practice: How Teams Actually Do It + +### The OpenAI Approach: Zero Human Code + +OpenAI's team structure for harness engineering: + +| Role | Traditional | Harness Engineering | +| --- | --- | --- | +| Writing code | Primary job | Never | +| Designing architecture | Part of the job | Primary job | +| Writing documentation | Afterthought | Critical infrastructure | +| Reviewing PRs | Code review | Reviewing agent output + harness effectiveness | +| Debugging | Reading code | Analyzing agent behavior patterns | +| Testing | Writing tests | Designing test strategies agents execute | + +### The Stripe Approach: Minions at Scale + +Stripe's internal coding agents, called **Minions**, now produce **over 1,000 merged pull requests per week**: + +1. Developer posts a task in Slack +2. Minion writes the code +3. Minion passes CI +4. Minion opens a PR +5. Human reviews and merges + +No developer interaction between step 1 and step 5. The harness handles everything — test execution, CI validation, style compliance, and documentation updates. + +### The LangChain Approach: Middleware-First + +LangChain structures their harness as composable middleware layers: + +``` +Agent Request + → LocalContextMiddleware (maps codebase) + → LoopDetectionMiddleware (prevents repetition) + → ReasoningSandwichMiddleware (optimizes compute) + → PreCompletionChecklistMiddleware (enforces verification) + → Agent Response +``` + +Each middleware layer adds a specific capability without modifying the core agent logic. This modular approach makes the harness testable and evolvable. + +--- + +## Building Your First Harness: A Practical Framework + +### Level 1: Basic Harness (Single Developer) + +If you're using Claude Code, Cursor, or Codex for individual projects: + +**What to set up:** + +- `CLAUDE.md` or `.cursorrules` file with project conventions +- Pre-commit hooks for linting and formatting +- A test suite the agent can run to self-verify +- Clear directory structure with consistent naming + +**Time to set up:** 1-2 hours **Impact:** Prevents the most common agent mistakes + +### Level 2: Team Harness (Small Team) + +For teams of 3-10 developers sharing a codebase: + +**Add to Level 1:** + +- `AGENTS.md` with team-wide conventions +- Architectural constraints enforced by CI +- Shared prompt templates for common tasks +- Documentation-as-code validated by linters +- Code review checklists specifically for agent-generated PRs + +**Time to set up:** 1-2 days **Impact:** Consistent agent behavior across the team + +### Level 3: Production Harness (Engineering Organization) + +For organizations running dozens of concurrent agents: + +**Add to Level 2:** + +- Custom middleware layers (loop detection, reasoning optimization) +- Observability integration (agents read logs and metrics) +- Entropy management agents on scheduled runs +- Harness versioning and A/B testing +- Agent performance monitoring dashboards +- Escalation policies for when agents get stuck + +**Time to set up:** 1-2 weeks **Impact:** Agents operate as autonomous contributors + +--- + +## Common Harness Engineering Mistakes + +### 1\. Over-Engineering the Control Flow + +> *"If you over-engineer the control flow, the next model update will break your system."* + +Models improve rapidly. Capabilities that required complex pipelines in 2024 are now handled by a single context-window prompt. Build your harness to be **rippable** — you should be able to remove "smart" logic when the model gets smart enough to not need it. + +### 2\. Treating the Harness as Static + +The harness needs to evolve with the model. When a new model release improves reasoning, your reasoning-optimization middleware might become counterproductive. Review and update harness components with every major model update. + +### 3\. Ignoring the Documentation Layer + +The most impactful harness improvement is often the simplest: **better documentation**. If your `AGENTS.md` is vague, your agent output will be vague. Invest in precise, machine-readable documentation that serves as the agent's ground truth. + +### 4\. No Feedback Loop + +A harness without feedback is a cage, not a guide. The agent needs to know when it's succeeding and when it's failing. Build in: + +- Self-verification steps before task completion +- Test execution as part of the agent workflow +- Metrics on agent success rates by task type + +### 5\. Human-Only Documentation + +If your architectural decisions live in people's heads or in Confluence pages the agent can't access, the harness has a gap. **Everything the agent needs must be in the repository.** + +--- + +## Harness Engineering vs. Related Concepts + +| Concept | Scope | Focus | +| --- | --- | --- | +| **Prompt Engineering** | Single interaction | Crafting effective prompts | +| **Context Engineering** | Model context window | What information the model sees | +| **Harness Engineering** | Entire agent system | Environment, constraints, feedback, lifecycle | +| **Agent Engineering** | Agent architecture | Internal agent design and routing | +| **Platform Engineering** | Infrastructure | Deployment, scaling, operations | + +Harness engineering **includes** context engineering and draws from prompt engineering, but it operates at a higher level — it's about the complete system that makes agents reliable, not just the inputs to a single interaction. + +--- + +## What This Means for Software Engineers + +### The Job Is Changing + +Harness engineering represents a genuine evolution in what software engineers do: + +| Before | After | +| --- | --- | +| Write code | Design environments where AI writes code | +| Debug code | Debug agent behavior | +| Review code | Review agent output + harness effectiveness | +| Write tests | Design test strategies | +| Maintain docs | Build documentation as machine-readable infrastructure | + +This doesn't mean engineers become less technical. If anything, harness engineering requires **deeper** architectural thinking — you're designing systems that must work without your constant intervention. + +### The Skills That Matter + +Based on what we've seen building AI-powered products at [NxCode](https://www.nxcode.io/): + +1. **Systems thinking** — Understanding how constraints, feedback loops, and documentation interact +2. **Architecture design** — Defining boundaries that are enforceable and productive +3. **Specification writing** — Articulating intent precisely enough for agents to execute +4. **Observability** — Building monitoring that reveals agent behavior patterns +5. **Iteration speed** — Rapidly testing and refining harness configurations + +### Our Experience: What Works in Practice + +We've been building AI-powered web applications using multiple agent systems (Claude Code, Codex, Cursor). The patterns that have made the biggest difference for us: + +- **Repository-first documentation**: Every architectural decision, naming convention, and deployment process is in the repo. Nothing lives in Slack or Google Docs. +- **Incremental constraint building**: Start with basic linting, add architectural constraints as patterns emerge, don't try to design the perfect harness upfront. +- **Agent-specific review checklists**: AI-generated code has different failure modes than human code. Our review process accounts for common agent patterns (over-abstraction, unnecessary error handling, documentation drift). +- **Multi-provider harness design**: Our harness works with Claude, GPT, and Gemini models. Provider-agnostic design means we can switch models without rebuilding the entire system. + +--- + +## Key Takeaways + +1. **Harness engineering is the new discipline** of designing systems that make AI agents reliable — constraints, feedback loops, documentation, and lifecycle management +2. **The model is commodity; the harness is moat** — LangChain jumped from Top 30 to Top 5 on benchmarks by only changing the harness +3. **OpenAI built 1M+ lines with zero human code** — proving harness engineering works at production scale +4. **Three pillars**: Context engineering, architectural constraints, and entropy management +5. **Start simple**: A good `AGENTS.md` and pre-commit hooks are more impactful than complex middleware +6. **The engineer's job is evolving** — from writing code to designing environments where AI writes code +7. **Build rippable harnesses** — over-engineering breaks when models improve; keep it adaptable + +--- + +## Related Articles + +- [Best AI for Coding in 2026: 10 Tools Ranked by Real-World Performance](https://www.nxcode.io/resources/news/best-ai-for-coding-2026-complete-ranking) +- [OpenAI Frontier Guide: Enterprise AI Agent Platform for Building AI Coworkers (2026)](https://www.nxcode.io/resources/news/openai-frontier-enterprise-ai-agent-platform-guide-2026) +- [Cursor Tutorial 2026: Learn AI Coding in 15 Minutes (Beginner Guide)](https://www.nxcode.io/resources/news/cursor-tutorial-beginners-2026) + +[Back to all news](https://www.nxcode.io/resources/news) + +Enjoyed this article? \ No newline at end of file diff --git a/raw/anthropic-harness-design.md b/raw/Harness design for long-running application development.md similarity index 89% rename from raw/anthropic-harness-design.md rename to raw/Harness design for long-running application development.md index 163421d..b64140d 100644 --- a/raw/anthropic-harness-design.md +++ b/raw/Harness design for long-running application development.md @@ -1,5 +1,13 @@ -# Harness design for long-running application development - +--- +title: "Harness design for long-running application development" +source: "https://www.anthropic.com/engineering/harness-design-long-running-apps" +author: +published: +created: 2026-04-11 +description: "Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems." +tags: + - "clippings" +--- *Written by Prithvi Rajasekaran, a member of our [Labs](https://www.anthropic.com/news/introducing-anthropic-labs) team.* Over the past several months I’ve been working on two interconnected problems: getting Claude to produce high-quality frontend designs, and getting it to build complete applications without human intervention. This work originated with earlier efforts on our [frontend design skill](https://github.com/anthropics/claude-code/blob/main/plugins/frontend-design/skills/frontend-design/SKILL.md) and [long-running coding agent harness](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), where my colleagues and I were able to improve Claude’s performance well above baseline through prompt engineering and harness design—but both eventually hit ceilings. @@ -10,7 +18,7 @@ I then applied these techniques to long-running autonomous coding, carrying over ## Why naive implementations fall short -We've previously shown that harness design has a substantial impact on the effectiveness of long running agentic coding. In an earlier [experiment](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), we used an initializer agent to decompose a product spec into a task list, and a coding agent that implemented the tasks one feature at a time before handing off artifacts to carry context across sessions. The broader developer community has converged on similar insights, with approaches like the "[Ralph Wiggum](https://ghuntley.com/ralph/)" method using hooks or scripts to keep agents in continuous iteration cycles. +We've previously shown that harness design has a substantial impact on the effectiveness of long running agentic coding. In an earlier [experiment](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), we used an initializer agent to decompose a product spec into a task list, and a coding agent that implemented the tasks one feature at a time before handing off artifacts to carry context across sessions. The broader developer community has converged on similar insights, with approaches like the " [Ralph Wiggum](https://ghuntley.com/ralph/) " method using hooks or scripts to keep agents in continuous iteration cycles. But some problems remained persistent. For more complex tasks, the agent still tends to go off the rails over time. While decomposing this issue, we observed two common failure modes with agents executing these sorts of tasks. @@ -30,10 +38,10 @@ Two insights shaped the harness I built for frontend design. First, while aesthe With this in mind, I wrote four grading criteria that I gave to both the generator and evaluator agents in their prompts: -- **Design quality:** Does the design feel like a coherent whole rather than a collection of parts? Strong work here means the colors, typography, layout, imagery, and other details combine to create a distinct mood and identity. -- **Originality:** Is there evidence of custom decisions, or is this template layouts, library defaults, and AI-generated patterns? A human designer should recognize deliberate creative choices. Unmodified stock components—or telltale signs of AI generation like purple gradients over white cards—fail here. -- **Craft:** Technical execution: typography hierarchy, spacing consistency, color harmony, contrast ratios. This is a competence check rather than a creativity check. Most reasonable implementations do fine here by default; failing means broken fundamentals. -- **Functionality:** Usability independent of aesthetics. Can users understand what the interface does, find primary actions, and complete tasks without guessing? +- **Design quality:** Does the design feel like a coherent whole rather than a collection of parts? Strong work here means the colors, typography, layout, imagery, and other details combine to create a distinct mood and identity. +- **Originality:** Is there evidence of custom decisions, or is this template layouts, library defaults, and AI-generated patterns? A human designer should recognize deliberate creative choices. Unmodified stock components—or telltale signs of AI generation like purple gradients over white cards—fail here. +- **Craft:** Technical execution: typography hierarchy, spacing consistency, color harmony, contrast ratios. This is a competence check rather than a creativity check. Most reasonable implementations do fine here by default; failing means broken fundamentals. +- **Functionality:** Usability independent of aesthetics. Can users understand what the interface does, find primary actions, and complete tasks without guessing? I emphasized design quality and originality over craft and functionality. Claude already scored well on craft and functionality by default, as the required technical competence tended to come naturally to the model. But on design and originality, Claude often produced outputs that were bland at best. The criteria explicitly penalized highly generic “AI slop” patterns, and by weighting design and originality more heavily it pushed the model toward more aesthetic risk-taking. @@ -49,13 +57,15 @@ While scores generally improved over iterations, the pattern was not always clea In one notable example, I prompted the model to create a website for a Dutch art museum. By the ninth iteration, it had produced a clean, dark-themed landing page for a fictional museum. The page was visually polished but largely in line with my expectations. Then, on the tenth cycle, it scrapped the approach entirely and reimagined the site as a spatial experience: a 3D room with a checkered floor rendered in CSS perspective, artwork hung on the walls in free-form positions, and doorway-based navigation between gallery rooms instead of scroll or click. It was the kind of creative leap that I hadn't seen before from a single-pass generation. + + ## Scaling to full-stack coding With these findings in hand, I applied this GAN-inspired pattern to full-stack development. The generator-evaluator loop maps naturally onto the software development lifecycle, where code review and QA serve the same structural role as the design evaluator. ### The architecture -In our earlier [long-running harness](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), we had solved for coherent multi-session coding with an initializer agent, a coding agent that worked one feature at a time, and context resets between sessions. Context resets were a key unlock: the harness used Sonnet 4.5, which exhibited the “context anxiety” tendency mentioned earlier. Creating a harness that worked well across context resets was key to keeping the model on task. Opus 4.5 largely removed that behavior on its own, so I was able to drop context resets from this harness entirely. The agents were run as one continuous session across the whole build, with the [Claude Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview)'s automatic compaction handling context growth along the way. +In our earlier [long-running harness](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), we had solved for coherent multi-session coding with an initializer agent, a coding agent that worked one feature at a time, and context resets between sessions. Context resets were a key unlock: the harness used Sonnet 4.5, which exhibited the “context anxiety” tendency mentioned earlier. Creating a harness that worked well across context resets was key to keeping the model on task. Opus 4.5 largely removed that behavior on its own, so I was able to drop context resets from this harness entirely. The agents were run as one continuous session across the whole build, with the [Claude Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview) 's automatic compaction handling context growth along the way. For this work I built on the foundation from the original harness with a three-agent system, with each agent addressing a specific gap I'd observed in prior runs. The system contained the following agent personas: @@ -63,8 +73,8 @@ For this work I built on the foundation from the original harness with a three-a **Generator:** The one-feature-at-a-time approach from the earlier harness worked well for scope management. I applied a similar model here, instructing the generator to work in sprints, picking up one feature at a time from the spec. Each sprint implemented the app with a React, Vite, FastAPI, and SQLite (later PostgreSQL) stack, and the generator was instructed to self-evaluate its work at the end of each sprint before handing off to QA. It also had git for version control. -**Evaluator:** Applications from earlier harnesses often looked impressive but still had real bugs when you actually tried to use them. To catch these, the evaluator used the Playwright MCP to click through the running application the way a user would, testing UI features, API endpoints, and database states. It then graded each sprint against both the bugs it had found and a set of criteria modeled on the frontend experiment, adapted here to cover product depth, functionality, visual design, and code quality. Each criterion had a hard threshold, and if any one fell below it, the sprint failed and the generator got detailed feedback on what went wrong. - +**Evaluator:** Applications from earlier harnesses often looked impressive but still had real bugs when you actually tried to use them. To catch these, the evaluator used the Playwright MCP to click through the running application the way a user would, testing UI features, API endpoints, and database states. It then graded each sprint against both the bugs it had found and a set of criteria modeled on the frontend experiment, adapted here to cover product depth, functionality, visual design, and code quality. Each criterion had a hard threshold, and if any one fell below it, the sprint failed and the generator got detailed feedback on what went wrong. + Before each sprint, the generator and evaluator negotiated a sprint contract: agreeing on what "done" looked like for that chunk of work before any code was written. This existed because the product spec was intentionally high-level, and I wanted a step to bridge the gap between user stories and testable implementation. The generator proposed what it would build and how success would be verified, and the evaluator reviewed that proposal to make sure the generator was building the right thing. The two iterated until they agreed. Communication was handled via files: one agent would write a file, another agent would read it and respond either within that file or with a new file that the previous agent would read in turn. The generator then built against the agreed-upon contract before handing the work off to QA. This kept the work faithful to the spec without over-specifying implementation too early. @@ -79,23 +89,10 @@ I wrote the following prompt to generate a retro video game maker: The table below shows the harness type, length it ran for, and the total cost. -**Harness** - -**Duration** - -**Cost** - -Solo - -20 min - -$9 - -Full harness - -6 hr - -$200 +| **Harness** | **Duration** | **Cost** | +| --- | --- | --- | +| Solo | 20 min | $9 | +| Full harness | 6 hr | $200 | The harness was over 20x more expensive, but the difference in output quality was immediately apparent. @@ -103,6 +100,12 @@ I was expecting an interface where I could construct a level and its component p As I clicked through, however, issues started to emerge. The layout wasted space, with fixed-height panels leaving most of the viewport empty. The workflow was rigid. Trying to populate a level prompted me to create sprites and entities first, but nothing in the UI guided me toward that sequence. More to the point, the actual game was broken. My entities appeared on screen but nothing responded to input. Digging into the code revealed that the wiring between entity definitions and the game runtime was broken, with no surface indication of where. +![[23c98f1d7ae720bfb39190d50e0706c03b177ad8-1999x1320.webp]] + +Initial screen when opening the app created by the solo harness. + + + After evaluating the solo run, I turned my attention to the harness run. This run started from the same one-sentence prompt, but the planner step expanded that prompt into a 16-feature spec spread across ten sprints. It went well beyond what the solo run attempted. In addition to the core editors and play mode, the spec called for a sprite animation system, behavior templates, sound effects and music, an AI-assisted sprite generator and level designer, and game export with shareable links. I gave the planner access to our [frontend design skill](https://github.com/anthropics/claude-code/blob/main/plugins/frontend-design/skills/frontend-design/SKILL.md), which it read and used to create a visual design language for the app as part of the spec. For each sprint, the generator and evaluator negotiated a contract defining the specific implementation details for the sprint, and the testable behaviors that would be tested to verify completion. The app immediately showed more polish and smoothness than the solo run. The canvas used the full viewport, the panels were sized sensibly, and the interface had a consistent visual identity that tracked the design direction from the spec. Some of the clunkiness I'd seen in the solo run did remain—the workflow still didn't make it clear that you should build sprites and entities before trying to populate a level, and I had to figure that out by poking around. This read as a gap in the base model’s product intuition rather than something the harness was designed to address, though it did suggest a place where targeted iteration inside the harness could help to further improve output quality. @@ -111,30 +114,23 @@ Working through the editors, the new run's advantages over solo became more appa Because I'd asked the planner to weave AI features into its specs, the app also came with a built-in Claude integration that let me generate different parts of the game through prompting. This significantly sped up the workflow. +![[a8bef95425966495629095a5cb38bde4a8b13558-1999x997.webp]] + +Initial screen: Creating a new game, in the app built with the full harness + The biggest difference was in play mode. I was actually able to move my entity and play the game. The physics had some rough edges—my character jumped onto a platform but ended up overlapping with it, which felt intuitively wrong—but the core thing worked, which the solo run did not manage. After moving around a bit, I did hit some limitations with the AI’s game level construction. There was a large wall that I wasn’t able to jump past, so I was stuck. This suggested there were some common sense improvements and edge cases that the harness could handle to further refine the app. Reading through the logs, it was clear that the evaluator kept the implementation in line with the spec. Each sprint, it walked through the sprint contract's test criteria and exercised the running application through Playwright, filing bugs against anything that diverged from expected behavior. The contracts were granular—Sprint 3 alone had 27 criteria covering the level editor—and the evaluator's findings were specific enough to act on without extra investigation. The table below shows several examples of issues our evaluator identified: -**Contract criterion** - -**Evaluator finding** - -Rectangle fill tool allows click-drag to fill a rectangular area with selected tile - -**FAIL** — Tool only places tiles at drag start/end points instead of filling the region. `fillRectangle` function exists but isn't triggered properly on mouseUp. - -User can select and delete placed entity spawn points - -**FAIL** — Delete key handler at `LevelEditor.tsx:892` requires both `selection` and `selectedEntityId` to be set, but clicking an entity only sets `selectedEntityId`. Condition should be `selection || (selectedEntityId && activeLayer === 'entity')`. - -User can reorder animation frames via API - -**FAIL** — `PUT /frames/reorder` route defined after `/{frame_id}` routes. FastAPI matches 'r`eorder`' as a frame\_id integer and returns 422: "unable to parse string as an integer." +| **Contract criterion** | **Evaluator finding** | +| --- | --- | +| Rectangle fill tool allows click-drag to fill a rectangular area with selected tile | **FAIL** — Tool only places tiles at drag start/end points instead of filling the region. `fillRectangle` function exists but isn't triggered properly on mouseUp. | +| User can select and delete placed entity spawn points | **FAIL** — Delete key handler at `LevelEditor.tsx:892` requires both `selection` and `selectedEntityId ` to be set, but clicking an entity only sets `selectedEntityId`. Condition should be `selection \|\| (selectedEntityId && activeLayer === 'entity')`. | +| User can reorder animation frames via API | **FAIL** — `PUT /frames/reorder` route defined after `/{frame_id}` routes. FastAPI matches 'r `eorder` ' as a frame\_id integer and returns 422: "unable to parse string as an integer." | Getting the evaluator to perform at this level took work. Out of the box, Claude is a poor QA agent. In early runs, I watched it identify legitimate issues, then talk itself into deciding they weren't a big deal and approve the work anyway. It also tended to test superficially, rather than probing edge cases, so more subtle bugs often slipped through. The tuning loop was to read the evaluator's logs, find examples where its judgment diverged from mine, and update the QAs prompt to solve for those issues. It took several rounds of this development loop before the evaluator was grading in a way that I found reasonable. Even then, the harness output showed the limits of the model’s QAing capabilities: small layout issues, interactions that felt unintuitive in places, and undiscovered bugs in more deeply nested features that the evaluator hadn't exercised thoroughly. There was clearly more verification headroom to capture with further tuning. But compared to the solo run, where the central feature of the application simply didn't work, the lift was obvious. -### -Iterating on the harness +### Iterating on the harness The first set of harness results was encouraging, but it was also bulky, slow, and expensive. The logical next step was to find ways to simplify the harness without degrading its performance. This was partly common sense and partly a function of a more general principle: every component in a harness encodes an assumption about what the model can't do on its own, and those assumptions are worth stress testing, both because they may be incorrect, and because they can quickly go stale as models improve. Our blog post [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents) frames the underlying idea as "find the simplest solution possible, and only increase complexity when needed," and it's a pattern that shows up consistently for anyone maintaining an agent harness. @@ -164,59 +160,16 @@ The run was still lengthy and expensive, at about 4 hours and $124 in token cost Most of the time went to the builder, which ran coherently for over two hours without the sprint decomposition that Opus 4.5 had needed. -**Agent & Phase** - -**Duration** - -**Cost** - -Planner - -4.7 min - -$0.46 - -Build (Round 1) - -2 hr 7 min - -$71.08 - -QA (Round 1) - -8.8 min - -$3.24 - -Build (Round 2) - -1 hr 2 min - -$36.89 - -QA (Round 2) - -6.8 min - -$3.09 - -Build (Round 3) - -10.9 min - -$5.88 - -QA (Round 3) - -9.6 min - -$4.06 - -**Total V2 Harness** - -**3 hr 50 min** - -**$124.70** +| **Agent & Phase** | **Duration** | **Cost** | +| --- | --- | --- | +| Planner | 4.7 min | $0.46 | +| Build (Round 1) | 2 hr 7 min | $71.08 | +| QA (Round 1) | 8.8 min | $3.24 | +| Build (Round 2) | 1 hr 2 min | $36.89 | +| QA (Round 2) | 6.8 min | $3.09 | +| Build (Round 3) | 10.9 min | $5.88 | +| QA (Round 3) | 9.6 min | $4.06 | +| **Total V2 Harness** | **3 hr 50 min** | **$124.70** | As with the previous harness, the planner expanded the one-line prompt into a full spec. From the logs, I could see the generator model did a good job planning the app and the agent design, wiring the agent up, and testing it before handing off to QA. @@ -235,6 +188,8 @@ The generator was still liable to miss details or stub features when left to its Based on the prompt, I was expecting a program where I could create melodies, harmonies, and drum patterns, arrange them into a song, and get help from an integrated agent along the way. The video below shows the result. + + The app is far from a professional music production program, and the agent's song composition skills could clearly use a lot of work. Additionally, Claude can’t actually hear, which made the QA feedback loop less effective with respect to musical taste. But the final app had all the core pieces of a functional music production program: a working arrangement view, mixer, and transport running in the browser. Beyond that, I was able to put together a short song snippet entirely through prompting: the agent set the tempo and key, laid down a melody, built a drum track, adjusted mixer levels, and added reverb. The core primitives for song composition were present, and the agent could drive them autonomously, using tools to create a simple production from end to end. You might say it’s not pitch-perfect yet—but it’s getting there. @@ -247,15 +202,13 @@ With this in mind, there are a few lessons from this work worth carrying forward From this work, my conviction is that the space of interesting harness combinations doesn't shrink as models improve. Instead, it moves, and the interesting work for AI engineers is to keep finding the next novel combination. -## -Acknowledgements +## Acknowledgements Special thanks to Mike Krieger, Michael Agaby, Justin Young, Jeremy Hadfield, David Hershey, Julius Tarng, Xiaoyi Zhang, Barry Zhang, Orowa Sidker, Michael Tingley, Ibrahim Madha, Martina Long, and Canyon Robbins for their contributions to this work. Thanks also to Jake Eaton, Alyssa Leonard, and Stef Sequeira for their help shaping the post. -## -Appendix +## Appendix Example plan generated by planner agent. @@ -290,5 +243,4 @@ Color palette selection All associated sprites, tilesets, levels, and entity definitions ... - ``` \ No newline at end of file diff --git a/raw/martinfowler-harness-engineering.md b/raw/Harness engineering for coding agent users.md similarity index 57% rename from raw/martinfowler-harness-engineering.md rename to raw/Harness engineering for coding agent users.md index ca4c9fc..cb1ef6f 100644 --- a/raw/martinfowler-harness-engineering.md +++ b/raw/Harness engineering for coding agent users.md @@ -1,80 +1,43 @@ -# Harness engineering for coding agent users - +--- +title: "Harness engineering for coding agent users" +source: "https://martinfowler.com/articles/harness-engineering.html" +author: + - "[[Birgitta Böckeler Birgitta is a Distinguished Engineer and AI-assisted delivery expert at Thoughtworks. She has over 20 years of experience as a software developer]]" + - "[[architect and technical leader.]]" +published: 2026-04-02 +created: 2026-04-11 +description: "A mental model for building trust in coding agents through feedforward guides, feedback sensors, and iterative harness engineering." +tags: + - "clippings" +--- The term harness has emerged as a shorthand to mean everything in an AI agent except the model itself - [Agent = Model + Harness](https://blog.langchain.com/the-anatomy-of-an-agent-harness/). That is a very wide definition, and therefore worth narrowing down for common categories of agents. I want to take the liberty here of defining its meaning in the bounded context of using a coding agent. In coding agents, part of the harness is already built in (e.g. via the system prompt, or the chosen code retrieval mechanism, or even a [sophisticated orchestration system](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)). But coding agents also provide us, their users, with many features to build an outer harness specifically for our use case and system. - +![[harness-bounded-contexts.png|Three concentric circles, with the model in the core (the ultimate thing being harnessed), then the coding agent's builder harness next circle out, and the coding agent's user harness as the outermost ring]] Figure 1: The term “harness” means different things depending on the bounded context. A well-built outer harness serves two goals: it increases the probability that the agent gets it right in the first place, and it provides a feedback loop that self-corrects as many issues as possible before they even reach human eyes. Ultimately it should reduce the review toil and increase the system quality, all with the added benefit of fewer wasted tokens along the way. -![Title "Harness engineering for coding agent users". Overview of guides (examples shown are \[inferential\] principles, CfRs, Rules, Ref Docs, How-tos; \[computational\] Language Servers, CLIs, scripts, codemods) that feedforward into a coding agent; and feedback sensors (examples shown are \[inferential\] review agents; \[computational\] static analysis, logs, browser). The feedback sensors point at the coding agent as well as input into its self-correcting loop. On the left side of it all we see a box with a human who steers both the guides and sensors.](../../martinfowler-assets/harness-overview.png) - -## Feedforward and Feedback - -To harness a coding agent we both anticipate unwanted outputs and try to prevent them, and we put sensors in place to allow the agent to self-correct: - -- **Guides (feedforward controls)** - anticipate the agent's behaviour and aim to steer it *before* it acts. Guides increase the probability that the agent creates good results in the first attempt -- **Sensors (feedback controls)** - observe *after* the agent acts and help it self-correct. Particularly powerful when they produce signals that are optimised for LLM consumption, e.g. custom linter messages that include instructions for the self-correction - a positive kind of prompt injection. - -Separately, you get either an agent that keeps repeating the same mistakes (feedback-only) or an agent that encodes rules but never finds out whether they worked (feed-forward-only). +![[harness-overview.png|Title "Harness engineering for coding agent users". Overview of guides (examples shown are [inferential] principles, CfRs, Rules, Ref Docs, How-tos; [computational] Language Servers, CLIs, scripts, codemods) that feedforward into a coding agent; and feedback sensors (examples shown are [inferential] review agents; [computational] static analysis, logs, browser). The feedback sensors point at the coding agent as well as input into its self-correcting loop. On the left side of it all we see a box with a human who steers both the guides and sensors.]] ## Computational vs Inferential There are two execution types of guides and sensors: -- **Computational** - deterministic and fast, run by the CPU. Tests, linters, type checkers, structural analysis. Run in milliseconds to seconds; results are reliable. -- **Inferential** - Semantic analysis, AI code review, “LLM as judge”. Typically run by a GPU or NPU. Slower and more expensive; results are more non-deterministic. +- **Computational** - deterministic and fast, run by the CPU. Tests, linters, type checkers, structural analysis. Run in milliseconds to seconds; results are reliable. +- **Inferential** - Semantic analysis, AI code review, “LLM as judge”. Typically run by a GPU or NPU. Slower and more expensive; results are more non-deterministic. Computational guides increase the probability of good results with deterministic tooling. Computational sensors are cheap and fast enough to run on every change, alongside the agent. Inferential controls are of course more expensive and non-deterministic, but allow us to both provide rich guidance, and add additional semantic judgment. In spite of their non-determinism, inferential sensors can particularly increase our trust when used with a strong model, or rather a model that is suitable to the task at hand. **Examples** -Direction - -Computational / Inferential - -Example implementations - -Coding conventions - -feedforward - -Inferential - -AGENTS.md, Skills - -Instructions how to bootstrap a new project - -feedforward - -Both - -Skill with instructions and a bootstrap script - -Code mods - -feedforward - -Computational - -A tool with access to OpenRewrite recipes - -Structural tests - -feedback - -Computational - -A pre-commit (or coding agent) hook running ArchUnit tests that check for violations of module boundaries - -Instructions how to review - -feedback - -Inferential - -Skills +| | Direction | Computational / Inferential | Example implementations | +| --- | --- | --- | --- | +| Coding conventions | feedforward | Inferential | AGENTS.md, Skills | +| Instructions how to bootstrap a new project | feedforward | Both | Skill with instructions and a bootstrap script | +| Code mods | feedforward | Computational | A tool with access to OpenRewrite recipes | +| Structural tests | feedback | Computational | A pre-commit (or coding agent) hook running ArchUnit tests that check for violations of module boundaries | +| Instructions how to review | feedback | Inferential | Skills | ## The steering loop @@ -88,17 +51,14 @@ Teams who are [continuously integrating](https://martinfowler.com/articles/conti **Feedforward and feedback in the change lifecycle** -- What is reasonably fast and should be run even before integration, or even before a commit is even created? (e.g. linters, fast test suites, basic code review agent) -- What is more expensive and should therefore only be run post-integration in the pipeline, in addition to a repetition of the fast controls? (e.g. mutation testing, a more broad code review that can take into account the bigger picture) - - +- What is reasonably fast and should be run even before integration, or even before a commit is even created? (e.g. linters, fast test suites, basic code review agent) +- What is more expensive and should therefore only be run post-integration in the pipeline, in addition to a repetition of the fast controls? (e.g. mutation testing, a more broad code review that can take into account the bigger picture) +![[harness-change-lifecycle-examples.png|Examples of feedforward and feedback in a change's lifecycle. Feedforward: LSP, architecture.md, /how-to-test skill, AGENTS.md, MCP server that can access a team's knowledge management tool, /xyz-api-docs skill; they feed into the agent's initial generation; feedback sensor examples for first self-correction loop are /code-review, npx eslint, semgrep, npm run coverage, npm run dep-cruiser; then human review is an additional feedback sensor; then integration happens; after integration, examples shown in the pipeline, which reruns all the previous sensors, and additional examples for more expensive sensors are /architecture-review skill, /detailed-review skill, mutation testing. An arrow shows that the feedback can then lead to new commits by agents or humans.]] **Continuous drift and health sensors** -- What type of drift accumulates gradually and should be monitored by sensors running continuously against the codebase, outside the change lifecycle? (e.g. dead code detection, analysis of the quality of the test coverage, dependency scanners) -- What runtime feedback could agents be monitoring? (e.g. having them look for degrading SLOs to make suggestions how to improve them, or AI judges continuously sampling response quality and flagging log anomalies) - - +- What type of drift accumulates gradually and should be monitored by sensors running continuously against the codebase, outside the change lifecycle? (e.g. dead code detection, analysis of the quality of the test coverage, dependency scanners) +- What runtime feedback could agents be monitoring? (e.g. having them look for degrading SLOs to make suggestions how to improve them, or AI judges continuously sampling response quality and flagging log anomalies) ## Regulation categories @@ -124,21 +84,21 @@ This groups guides and sensors that define and check the architecture characteri Examples: -- Skills that feed forward our performance requirements, and performance tests that feed back to the agent if it improved or degraded them. -- Skills that describe coding conventions for better observability (like logging standards), and debugging instructions that ask the agent to reflect on the quality of the logs it had available. +- Skills that feed forward our performance requirements, and performance tests that feed back to the agent if it improved or degraded them. +- Skills that describe coding conventions for better observability (like logging standards), and debugging instructions that ask the agent to reflect on the quality of the logs it had available. ### Behaviour harness This is the elephant in the room - how do we guide and sense if the application functionally behaves the way we need it to? At the moment, I see most people who give high autonomy to their coding agents do this: -- Feed-forward: A functional specification (of varying levels of detail, from a short prompt to multi-file descriptions) -- Feed-back: Check if the AI-generated test suite is green, has reasonably high coverage, some might even monitor its quality with mutation testing. Then combine that with manual testing. +- Feed-forward: A functional specification (of varying levels of detail, from a short prompt to multi-file descriptions) +- Feed-back: Check if the AI-generated test suite is green, has reasonably high coverage, some might even monitor its quality with mutation testing. Then combine that with manual testing. This approach puts a lot of faith into the AI-generated tests, that's not good enough yet. Some of my colleagues are seeing good results with the [approved fixtures](https://lexler.github.io/augmented-coding-patterns/patterns/approved-fixtures/) pattern, but it's easier to apply in some areas than others. They use it selectively where it fits, it's not a wholesale answer to the test quality problem. So overall, we still have a lot to do to figure out good harnesses for functional behaviour that increase our confidence enough to reduce supervision and manual testing. - +![[harness-types.png|Simplified overview of a harness showing guides and sensors in horizontal, and then the regulation dimensions maintainability, architecture fitness, and behaviour, in vertical. Examples shown for the behaviour harness, spec as feedforward guide, test suite as feedback sensor that is a mix of inferential and computational, plus a human icon indicating human review and manual tests as main additional feedback sensor.]] ## Harnessability @@ -150,7 +110,7 @@ This plays out differently for greenfield versus legacy. Greenfield teams can ba Most enterprises have a few common topologies of services that cover 80% of what they need - business services that exposes data via APIs; event processing services; data dashboards. In many mature engineering organizations these topologies are already codified in service templates. These might evolve into harness templates in the future: a bundle of guides and sensors that leash a coding agent to the structure, conventions and tech stack of a topology. Teams may start picking tech stacks and structures partly based on what harnesses are already available for them. - +![[harness-templates.png|A stack of examples of topologies (Data dashboard in Node, CRUD business service on JVM, event processor in Golang). The top one, data dashboard, is shown in detail, as a combination of structure definition and tech stack. The graphic indicates a "harness template" with guides and sensors for each topology, which can be instantiated.]] We would of course face similar challenges as with service templates. As soon as teams instantiate them, they start fall out of sync with upstream improvements. Harness templates would face the same versioning and contribution problems, maybe even worse with non-deterministic guides and sensors that are harder to test. @@ -168,12 +128,28 @@ The mental model I've laid out here describes techniques that are already happen Here are some harness-related examples from the current discourse: -- [An OpenAI team documented what their harness looks like](https://openai.com/index/harness-engineering/): layered architecture enforced by custom linters and structural tests, and recurring “garbage collection” that scans for drift and has agents suggest fixes. Their conclusion: “Our most difficult challenges now center on designing environments, feedback loops, and control systems.” -- [Stripe's write-up about their minions](https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents) describes things like pre-push hooks that run relevant linters based on a heuristic, they highlight how important “shift feedback left” is to them, and their “blueprints” show how they're integrating feedback sensors into the agent workflows. -- Mutation and structural testing are examples of computational feedback sensors that have been underused in the past, but are now having a resurgence. -- There is increased chatter among developers about the integration of LSPs and code intelligence in coding agents, examples of computational feedforward guides. -- I hear stories from teams at Thoughtworks about tackling architecture drift with both computational and inferential sensors, e.g. increasing API quality with a mix of agents and custom linters, or increasing code quality with a “janitor army”. +- [An OpenAI team documented what their harness looks like](https://openai.com/index/harness-engineering/): layered architecture enforced by custom linters and structural tests, and recurring “garbage collection” that scans for drift and has agents suggest fixes. Their conclusion: “Our most difficult challenges now center on designing environments, feedback loops, and control systems.” +- [Stripe's write-up about their minions](https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents) describes things like pre-push hooks that run relevant linters based on a heuristic, they highlight how important “shift feedback left” is to them, and their “blueprints” show how they're integrating feedback sensors into the agent workflows. +- Mutation and structural testing are examples of computational feedback sensors that have been underused in the past, but are now having a resurgence. +- There is increased chatter among developers about the integration of LSPs and code intelligence in coding agents, examples of computational feedforward guides. +- I hear stories from teams at Thoughtworks about tackling architecture drift with both computational and inferential sensors, e.g. increasing API quality with a mix of agents and custom linters, or increasing code quality with a “janitor army”. There's plenty still to figure out, not just the already mentioned behavioural harness. How do we keep a harness coherent as it grows, with guides and sensors in sync, not contradicting each other? How far can we trust agents to make sensible trade-offs when instructions and feedback signals point in different directions? If sensors never fire, is that a sign of high quality or inadequate detection mechanisms? We need a way to evaluate harness coverage and quality similar to what code coverage and mutation testing do for tests. Feedforward and feedback controls are currently scattered across delivery steps, there's real potential for tooling that helps configure, sync, and reason about them as a system. Building this outer harness is emerging as an ongoing engineering practice, not a one-time configuration. -* * * \ No newline at end of file +--- + +## Acknowledgements + +Big thanks to the Doppler team for the engaging discussion at our last technology radar meeting, in particular Kief Morris for bringing up cybernetics. Thanks to Ned Letcher, Chris Ford and Ben O'Mahoney for the conversations about what a harness even is, and to Matteo Vaccari for his insights on the behaviour harness. And to everybody who took the time to read the draft and provide lots of valuable feedback: Christoph Burgmer, Jörn Dinkla, Michael Feathers, Karrtik Iyer, Swapnil Phulse, Paul Sobocinski, Zhenjia Zhou + +GenAI (Claude and Claude Code) was used for research, pulling in relevant ideas from existing notes, and polishing the language. + +## Earlier Memo + +I wrote [a memo in early February](https://martinfowler.com/articles/exploring-gen-ai/harness-engineering-memo.html) containing my initial thoughts on Harness Engineering as the term first appeared. That post has attracted a lot of traffic. This article supersedes that memo, so we have redirected the original memo URL to this page, as we believe this page is the better resource for readers. + +Significant Revisions + +*02 April 2026:* published full article including introducing guides, sensors, computational and inferential elements, and harness templates + +*17 February 2026:* published my [initial memo](https://martinfowler.com/articles/exploring-gen-ai/harness-engineering-memo.html) on Harness Engineering \ No newline at end of file diff --git a/raw/langchain-harness-engineering.md b/raw/Improving Deep Agents with harness engineering.md similarity index 68% rename from raw/langchain-harness-engineering.md rename to raw/Improving Deep Agents with harness engineering.md index 442eb8c..5202fc0 100644 --- a/raw/langchain-harness-engineering.md +++ b/raw/Improving Deep Agents with harness engineering.md @@ -1,5 +1,14 @@ -# Improving Deep Agents with harness engineering - +--- +title: "Improving Deep Agents with harness engineering" +source: "https://blog.langchain.com/improving-deep-agents-with-harness-engineering/" +author: + - "[[LangChain Accounts]]" +published: 2026-02-18 +created: 2026-04-11 +description: "TLDR: Our coding agent went from Top 30 to Top 5 on Terminal Bench 2.0. We only changed the harness. Here’s our approach to harness engineering (teaser: self-verification & tracing help a lot).The Goal of Harness EngineeringThe goal of a harness is to mold the inherently spiky" +tags: + - "clippings" +--- TLDR: Our coding agent went from Top 30 to Top 5 on [Terminal Bench 2.0](https://www.tbench.ai/leaderboard/terminal-bench/2.0?ref=blog.langchain.com). We only changed the harness. Here’s our approach to harness engineering (teaser: self-verification & tracing help a lot). ## The Goal of Harness Engineering @@ -12,7 +21,9 @@ At LangChain, we use [Traces](https://docs.langchain.com/langsmith/observability We used a simple recipe to iteratively improve [deepagents-cli](https://github.com/langchain-ai/deepagents/tree/main/libs/cli?ref=blog.langchain.com) (our coding agent) `13.7 points` from `52.8` to `66.5` on Terminal Bench 2.0. We only tweaked the harness and kept the model fixed, `gpt-5.2-codex`. - +![[Screenshot-2026-02-12-at-12.25.20---PM-1.png]] + +Spending more reasoning compute on planning and verification ## Experiment Setup & The Knobs on a Harness @@ -20,27 +31,31 @@ We used [Terminal Bench 2.0](https://www.tbench.ai/?ref=blog.langchain.com), a n Every agent action is stored in [LangSmith](https://smith.langchain.com/?ref=blog.langchain.com). It also includes metrics like latency, token counts, and costs. -### **The Knobs we can Turn** +### The Knobs we can Turn An agent harness has a lot of knobs: system prompts, tools, hooks/middleware, skills, sub-agent delegation, memory systems, and more. We deliberately compress the optimization space and focus on three: **System Prompt, Tools,** and [**Middleware**](https://docs.langchain.com/oss/python/langchain/middleware/overview?ref=blog.langchain.com#the-agent-loop) (our term for hooks around model and tool calls). We start with a default prompt and standard tools+middleware. This scores 52.8% with GPT-5.2-Codex. A solid score, just outside the Top 30 of the leaderboard today, but room to grow. - +![[Screenshot-2026-02-16-at-12.50.00---PM.png]] -### **The Trace Analyzer Skill** +Spending more reasoning compute on planning and verification + +### The Trace Analyzer Skill We wanted trace analysis to be repeatable so we made it into an Agent Skill. This serves as our recipe to **analyze errors across runs and make improvements to the harness**. The flow is: -1. Fetch experiment traces from LangSmith -2. Spawn parallel error analysis agents → main agent synthesizes findings + suggestions -3. Aggregate feedback and make targeted changes to the harness. +1. Fetch experiment traces from LangSmith +2. Spawn parallel error analysis agents → main agent synthesizes findings + suggestions +3. Aggregate feedback and make targeted changes to the harness. This works similarly to [boosting](https://en.wikipedia.org/wiki/Boosting_\(machine_learning\)?ref=blog.langchain.com) which focuses on mistakes from previous runs. A human can be pretty helpful in Step 3 (though not required) to verify and discuss proposed changes. Changes that overfit to a task are bad for generalization and can lead to regressions in other Tasks. Automated trace analysis saves hours of time and made it easy to quickly try experiments. We’ll be publishing this skill soon, we’re currently testing it for prompt optimization generally. - +![[langsmith_trace_analyzer_skill.png]] + +Spending more reasoning compute on planning and verification ## What Actually Improved Agent Performance @@ -56,22 +71,24 @@ The most common failure pattern was that the agent wrote a solution, re-read its We added guidance to the system prompt on how to approach problem solving. -1. **Planning & Discovery:** Read the task, scan the codebase, and build an initial plan based on the task specification and how to verify the solution. -2. **Build:** Implement the plan with verification in mind. Build tests, if they don’t exist and test both happy paths and edge cases. -3. **Verify:** Run tests, read the full output, compare against what was asked (not against your own code). -4. **Fix:** Analyze any errors, revisit the original spec, and fix issues. +1. **Planning & Discovery:** Read the task, scan the codebase, and build an initial plan based on the task specification and how to verify the solution. +2. **Build:** Implement the plan with verification in mind. Build tests, if they don’t exist and test both happy paths and edge cases. +3. **Verify:** Run tests, read the full output, compare against what was asked (not against your own code). +4. **Fix:** Analyze any errors, revisit the original spec, and fix issues. We really focus on testing because it powers the changes in every iteration. We found that alongside prompting, deterministic context injection helps agents verify their work. We use a `PreCompletionChecklistMiddleware` that intercepts the agent before it exits and reminds it to run a verification pass against the Task spec. This is similar to a [Ralph Wiggum Loop](https://ghuntley.com/loop/?ref=blog.langchain.com) where a hook forces the agent to continue executing on exit, we use this for verification. - +![[self-verification-loop.png]] + +Spending more reasoning compute on planning and verification ### Giving Agents Context about their Environment Part of harness engineering is **building a good delivery mechanism for context engineering.** Terminal Bench tasks come with directory structures, built-in tooling, and strict timeouts. -1. **Directory Context & Tooling:** A `LocalContextMiddleware` runs on agent start to map the `cwd` and other parent+children directories. We run `bash` commands to find tools like `Python` installations. Context discovery and search are error prone, so injecting context reduces this error surface and helps **onboard the agent into its environment.** -2. **Teaching Agents to Write Testable Code:** Agents don’t know how their code needs to be testable. We add prompting say their work will be measured against programatic tests, similar to when committing code. For example, Task specs that mention file paths should be followed exactly so the solutions works in an automated scoring step. Prompting that stresses edge-cases helps the agent avoid only checking “happy path” cases. Forcing models to conform to testing standards is a powerful strategy to avoid “slop buildup” over time. -3. **Time Budgeting:** We inject time budget warnings to nudge the agent to finish work and shift to verification. Agents are famously bad at time estimation so this heuristic helps in this environment. Real world coding usually doesn’t have strict time limits, but without adding any knowledge of constraints, agents won’t work within time bounds. +1. **Directory Context & Tooling:** A `LocalContextMiddleware` runs on agent start to map the `cwd` and other parent+children directories. We run `bash` commands to find tools like `Python` installations. Context discovery and search are error prone, so injecting context reduces this error surface and helps **onboard the agent into its environment.** +2. **Teaching Agents to Write Testable Code:** Agents don’t know how their code needs to be testable. We add prompting say their work will be measured against programatic tests, similar to when committing code. For example, Task specs that mention file paths should be followed exactly so the solutions works in an automated scoring step. Prompting that stresses edge-cases helps the agent avoid only checking “happy path” cases. Forcing models to conform to testing standards is a powerful strategy to avoid “slop buildup” over time. +3. **Time Budgeting:** We inject time budget warnings to nudge the agent to finish work and shift to verification. Agents are famously bad at time estimation so this heuristic helps in this environment. Real world coding usually doesn’t have strict time limits, but without adding any knowledge of constraints, agents won’t work within time bounds. The more that agents know about their environment, constraints, and evaluation criteria, the better they can autonomously self-direct their work. @@ -93,11 +110,11 @@ Terminal Bench timeout limits create a tradeoff. More reasoning helps agents eva We found that reasoning helps with planning to fully understand the problem, some Terminal Bench tasks are very difficult. A good plan helps get to a working solution more quickly. -Later stage verification also benefits from more reasoning to catch mistakes and get a solution submitted. As a heuristic, we choose a xhigh-high-xhigh "**reasoning sandwich**" as a baseline. +Later stage verification also benefits from more reasoning to catch mistakes and get a solution submitted. As a heuristic, we choose a xhigh-high-xhigh " **reasoning sandwich** " as a baseline. - +![[the-reasoning-sandwich.png]] -**Spending more reasoning compute on planning and verification** +Spending more reasoning compute on planning and verification Running only at `xhigh` scored poorly at `53.9%` due to agent timeouts compared to `63.6%` at `high`. There weren’t large differences in trial runs across reasoning budget splits so we stuck with our approach which pushed the score to `66.5%`. @@ -109,11 +126,11 @@ In a multi-model harness, balancing reasoning budgets could play out as using a The design space of agents is big. Here are some general principles from our experiments and building deepagents overall. -1. **Context Engineering on Behalf of Agents.** Context assembly is still difficult for agents today, especially in unseen environments. Onboarding models with context like directory structures, available tools, coding best practices, and problem solving strategies helps reduce the error surface for poor search and avoidable errors in planning. -2. **Help agents self-verify their work.** Models are biased towards their first plausible solution. Prompt them aggressively to verify their work by running tests and refining solutions. This is especially important in autonomous coding systems that don’t have humans in the loop. -3. **Tracing as a feedback signal.** Traces allow agents to self-evaluate and debug themselves. It’s important to debug tooling and reasoning together (ex: models go down wrong paths because they lack a tool or instructions how to do something). -4. **Detect and fix bad patterns in the short term.** Models today aren’t perfect. The job of the harness designer is to design around today’s shortcomings while planning for smarter models in the future. Blind retries and not verifying work are good examples. These guardrails will almost surely dissolve over time, but to build robust agent applications today, they’re useful tools to experiment with. -5. **Tailor Harnesses to Models. T**he [Codex](https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide/?ref=blog.langchain.com) and [Claude](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?ref=blog.langchain.com) prompting guides show that models require different prompting. A test run with Claude Opus 4.6 scored `59.6%` with an earlier harness version, competitive but worse than Codex because we didn’t run the same Improvement Loop with Claude. Many principles generalize like good context preparation and a focus on verification, but running a few rounds of harness iterations for your task helps maximize agent performance across tasks. +1. **Context Engineering on Behalf of Agents.** Context assembly is still difficult for agents today, especially in unseen environments. Onboarding models with context like directory structures, available tools, coding best practices, and problem solving strategies helps reduce the error surface for poor search and avoidable errors in planning. +2. **Help agents self-verify their work.** Models are biased towards their first plausible solution. Prompt them aggressively to verify their work by running tests and refining solutions. This is especially important in autonomous coding systems that don’t have humans in the loop. +3. **Tracing as a feedback signal.** Traces allow agents to self-evaluate and debug themselves. It’s important to debug tooling and reasoning together (ex: models go down wrong paths because they lack a tool or instructions how to do something). +4. **Detect and fix bad patterns in the short term.** Models today aren’t perfect. The job of the harness designer is to design around today’s shortcomings while planning for smarter models in the future. Blind retries and not verifying work are good examples. These guardrails will almost surely dissolve over time, but to build robust agent applications today, they’re useful tools to experiment with. +5. **Tailor Harnesses to Models. T** he [Codex](https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide/?ref=blog.langchain.com) and [Claude](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices?ref=blog.langchain.com) prompting guides show that models require different prompting. A test run with Claude Opus 4.6 scored `59.6%` with an earlier harness version, competitive but worse than Codex because we didn’t run the same Improvement Loop with Claude. Many principles generalize like good context preparation and a focus on verification, but running a few rounds of harness iterations for your task helps maximize agent performance across tasks. There’s more open research to do in harness design. Interesting avenues include multi-model systems (Codex, Gemini, and Claude together), memory primitives for continual learning so agents can autonomously improve on tasks, and measuring harness changes across models. diff --git a/raw/Meta-Harness End-to-End Optimization of Model Harnesses.md b/raw/Meta-Harness End-to-End Optimization of Model Harnesses.md new file mode 100644 index 0000000..21839df --- /dev/null +++ b/raw/Meta-Harness End-to-End Optimization of Model Harnesses.md @@ -0,0 +1,557 @@ +--- +title: "Meta-Harness: End-to-End Optimization of Model Harnesses" +source: "https://arxiv.org/html/2603.28052v1" +author: +published: +created: 2026-04-11 +description: +tags: + - "clippings" +--- +Yoonho Lee +Stanford &Roshen Nair +Stanford &Qizheng Zhang +Stanford &Kangwook Lee +KRAFTON Omar Khattab +MIT &Chelsea Finn +Stanford + +###### Abstract + +The performance of large language model (LLM) systems depends not only on model weights, but also on their harness: the code that determines what information to store, retrieve, and present to the model. Yet harnesses are still designed largely by hand, and existing text optimizers are poorly matched to this setting because they compress feedback too aggressively: they are memoryless, condition only on scalar scores, or restrict feedback to short templates or summaries. We introduce Meta-Harness, an outer-loop system that searches over harness code for LLM applications. It uses an agentic proposer that accesses the source code, scores, and execution traces of all prior candidates through a filesystem. On online text classification, Meta-Harness improves over a state-of-the-art context management system by 7.7 points while using 4 $\times$ fewer context tokens. On retrieval-augmented math reasoning, a single discovered harness improves accuracy on 200 IMO-level problems by 4.7 points on average across five held-out models. On agentic coding, discovered harnesses surpass the best hand-engineered baselines on TerminalBench-2. Together, these results show that richer access to prior experience can enable automated harness engineering. + +Project page w/ interactive demo: [https://yoonholee.com/meta-harness/](https://yoonholee.com/meta-harness/) + +Optimized harness: [https://github.com/stanford-iris-lab/meta-harness-tbench2-artifact](https://github.com/stanford-iris-lab/meta-harness-tbench2-artifact) + +![[x1 1.png|Refer to caption]] + +Figure 1: (Left) On text classification, Meta-Harness outperforms the best prior hand-designed harnesses (ACE) and existing text optimizers (TTT-Discover, OpenEvolve), matching the next-best method’s final accuracy after just 4 evaluations. (Right) On TerminalBench-2, Meta-Harness outperforms all reported Claude Haiku 4.5 harnesses. + +## 1 Introduction + +Changing the harness around a fixed large language model (LLM) can produce a 6 $\times$ performance gap on the same benchmark [^46]. The harness—the code that determines what to store, retrieve, and show to the model—often matters as much as the model itself. This sensitivity has led to growing interest in harness engineering, the practice of refining the code around an LLM to improve the overall system’s performance [^35] [^20] [^9] [^8]. But despite its importance, harness engineering remains largely manual: practitioners inspect failures, adjust heuristics, and iterate on a small number of designs. In this paper, we ask whether this process itself can be automated. + +A natural starting point is recent work on text optimization, since harness engineering also involves iteratively improving text and code artifacts using feedback from prior attempts [^37] [^38] [^34] [^25] [^1]. However, these methods are poorly matched to harness engineering because they typically operate with short-horizon or heavily compressed feedback: some condition only on the current candidate [^30] [^50] [^52], others rely primarily on scalar scores [^34] [^11], and others restrict feedback to short templates or LLM-generated summaries [^1] [^25]. This is a pragmatic scalability choice, not evidence that longer-range dependencies are uninformative. Harnesses act over long horizons: a single choice about what to store, when to retrieve it, or how to present it can affect behavior many reasoning steps later. Compressed feedback often removes the information needed to trace downstream failures to earlier harness decisions. Across the tasks studied by several representative text optimizers, the available context per optimization step ranges from only 100 to 30,000 tokens (Table 1), far below the diagnostic footprint of harness search. More broadly, work on retrieval and memory-augmented language models suggests that useful context should often be accessed adaptively rather than monolithically packed into a single prompt [^27] [^47] [^36] [^55]. + +![[x3 1.png|Refer to caption]] + +Figure 2: Meta-Harness search loop. (1) An agent reads a filesystem containing all prior candidates’ source code, execution traces, and scores, and proposes a new harness. (2) We evaluate the proposed harness on evaluation tasks. (3) All logs (proposed code, reasoning traces, evaluation scores) are stored in the filesystem in a new directory, and the loop repeats. + +| Method | History | Log content | MTok/iter | +| --- | --- | --- | --- | +| OPRO [^50] | Window | past (solution, score) pairs | $0.002$ | +| TextGrad [^52] | Last | textual feedback on current artifact | $0.015$ | +| AlphaEvolve [^34] | Window | program database + eval. scores | $0.022$ | +| GEPA [^1] | Summary | reflective feedback from rollout traces | $0.008$ | +| Feedback Descent [^25] | Summary | comparison + textual feedback | $0.012$ | +| TTT-Discover [^54] | Window | prev. solution fragment | $0.026$ | +| Meta-Harness | Full | all logs and scores | $10.0$ | + +Table 1: Comparison of text optimization methods and their settings. Each row represents a method collapsed across tasks. Mtok/iter is our best estimate of the full context generated from one evaluation of a text artifact in the largest setting considered in each paper. This paper considers settings that yield orders-of-magnitude more context per artifact evaluation. + +We address this limitation with Meta-Harness, an agentic harness for optimizing harnesses via end-to-end search (Figure 2). Its proposer is a coding agent, i.e., a language-model-based system that can invoke developer tools and modify code. The choice of coding agent (rather than raw LLM) matters because the amount of experience quickly exceeds context limits, so the proposer must decide what to inspect and validate edits through direct interaction with the codebase. Its key design choice is to expose full history through a filesystem, enabling selective diagnosis of raw prior code and execution traces rather than optimization from compressed per-candidate summaries. For every previous candidate harness, the filesystem stores the source code, evaluation scores, and execution traces, which the proposer retrieves via standard operations such as grep and cat rather than ingesting them as a single prompt. In practice, the proposer reads a median of 82 files per iteration in our most demanding setting, referencing over 20 prior candidates per step (Appendix A). In the settings we study, a single evaluation can produce up to 10,000,000 tokens of diagnostic information, roughly three orders of magnitude beyond the largest feedback budgets used in prior text optimization settings (Table 1). + +We evaluate Meta-Harness on online text classification, mathematical reasoning, and agentic coding. On online text classification, harnesses discovered by Meta-Harness improve over Agentic Context Engineering (ACE, [^58]) by 7.7 points while using 4 $\times$ fewer context tokens, and match the next-best text optimizer’s final performance after $60$ proposals with only four (Figure 1). On retrieval-augmented math reasoning, a single discovered harness improves accuracy on 200 IMO-level problems by 4.7 points on average across five held-out models. On TerminalBench-2, the discovered harness surpasses Terminus-KIRA and ranks #1 among all Haiku 4.5 agents. + +## 2 Related Work + +At a high level, Meta-Harness brings ideas from the broader literature on credit assignment and meta-learning [^39] [^45] [^2] [^16] [^43] in a new regime enabled by recent advances in coding agents. Rather than updating model weights, the system assigns credit at the harness level: it uses experience from past rollouts to deliberately reason about which steps and components are responsible for failures, then rewrites the external code that governs future behavior. More specifically, the method lies at the intersection of several recent research threads; it is most directly related to work on adaptive access to external context, executable code search, and text optimization. + +External memory and adaptive access. Several prior works note the benefits of treating large knowledge sources or long inputs as external resources that a language model accesses adaptively, rather than consuming them in a single pass. Specifically, retrieval-augmented generation [^27], interleaved retrieval and reasoning [^47], memory-based agents [^36], or recursive language models [^55] are mechanisms for adaptive access to external context. Meta-Harness uses a similar access pattern, but in the more demanding setting of harness engineering, where the proposer selectively inspects a large external history of code, scores, and execution traces to improve context-management procedures themselves. + +Executable code search. Recent methods search over executable code for functions, workflows, or agent designs. Early work proposes using large models as mutation and crossover operators in evolutionary program search [^26]. Later methods evolve designated functions within fixed program scaffolds [^38], use meta-agents to program new agents from prior discoveries [^19], or search over workflow graphs for agentic systems [^57]. Another line of work searches over memory designs for continual-learning agents, where memory persists across task streams [^56] [^49]. In contrast, Meta-Harness searches over domain-specific harnesses, including prompt construction, retrieval, and state update strategies that reset between tasks. Its outer loop is deliberately minimal: instead of relying on a fixed scaffold, an archive of prior discoveries, or a persistent memory mechanism, it gives the proposer unrestricted filesystem access to prior experience. This lets the agent decide what information to inspect and enables search over full harness implementations rather than a predefined space of context-management procedures. + +Text optimization methods. Meta-Harness is also closely related to methods such as ProTeGi, TextGrad, OPRO, GEPA, AlphaEvolve/OpenEvolve, and Feedback Descent, which iteratively improve prompts or other text artifacts using feedback from prior attempts [^37] [^30] [^52] [^50] [^1] [^34] [^42] [^25]. However, these methods are less well suited to harness engineering, where optimization targets a complete executable procedure, and the relevant environmental feedback is distributed across code, scores, and execution traces in a way that is hard to summarize up front. Rather than reacting only to aggregate scores or summaries, the proposer in Meta-Harness can reason over failed examples and their execution traces to propose targeted edits. See Table 1 for a comparison of problem scale considered in those papers and ours, and Figures 1 and 4 for a direct comparison with OpenEvolve, GEPA, and TTT-Discover in our problem setting. + +## 3 Meta-Harness: A Harness for Optimizing Harnesses + +This section describes Meta-Harness, our outer-loop procedure for searching over task-specific harnesses. Meta-Harness is built on the idea that harness optimization benefits from allowing a proposer to selectively inspect prior code and execution traces via filesystem access, rather than optimizing from lossy summaries or an additional hand-designed search structure. At a high level, it repeatedly proposes, evaluates, and logs new harnesses. + +Meta-Harness is itself a harness in the broad sense (hence the name), since it determines what information the proposer model sees during search. Unless otherwise noted, we use *harness* to refer to the task-specific programs being optimized. + +Objective. A harness is a stateful program that wraps a language model and determines what context the model sees at each step. The goal is simple: find the harness that makes the underlying model perform best on the target task distribution. Formally, let $M$ denote a fixed language model and $\mathcal{X}$ a task distribution. For a harness $H$ and task instance $x\sim\mathcal{X}$, we execute a rollout trajectory $\tau\sim p_{M}(H,x)$. The harness constructs prompts for $M$, the model responds, and the harness updates its state after each interaction. A task-specific reward function $r(\tau,x)$ scores the trajectory. The objective of harness optimization is to find the harness that maximizes the expected final reward: + +$$ +H^{*}=\operatorname*{arg\,max}_{H}\mathbb{E}_{x\sim\mathcal{X},\tau\sim p_{M}(H,x)}\;r(\tau,x), +$$ + +When multiple objectives are relevant (e.g., accuracy and context cost), we evaluate candidates under Pareto dominance and report the resulting frontier. In practice, this search has traditionally been carried out by human engineers and researchers, who iteratively refine prompts, context-management rules, and tool-use logic by hand. + +Meta-Harness search loop. Meta-Harness uses a single coding-agent proposer with access to a growing filesystem $\mathcal{D}$ that serves as its feedback channel 1. Here, a coding agent is a language-model-based system that can invoke developer tools and modify code. Unlike prior systems that externalize the improvement logic in a hand-designed search loop, Meta-Harness delegates diagnosis and proposal to the coding agent itself: it decides which prior artifacts to inspect, which failure modes to address, and whether to make a local edit or a more substantial rewrite. Equivalently, the proposer is not a raw next-token model operating on a fixed prompt assembled by the outer loop; it is an agent that retrieves information, navigates prior artifacts, and edits code as part of the search itself. Each evaluated harness contributes a directory containing its source code, scores, and execution traces (such as prompts, tool calls, model outputs, and state updates). The filesystem is typically far larger than the proposer’s context window, so the proposer queries it through terminal tools such as grep and cat rather than ingesting it as a single prompt. At each iteration, the proposer first inspects prior code, scores, and execution traces, then reasons about likely failure modes before generating a new harness. + +Meta-Harness maintains a population $\mathcal{H}$ and a Pareto frontier over evaluated harnesses, but imposes no parent-selection rule: the proposer is free to inspect any prior harness and its execution trace when proposing new ones. We run evolution for a fixed number of iterations and perform a final test-set evaluation on the Pareto frontier. This simplicity is deliberate: by leaving diagnosis and edit decisions to the proposer rather than hard-coding search heuristics, Meta-Harness can improve automatically as coding agents become more capable. The proposer never sees test-set results; its only feedback comes from the search set, the subset of task instances used to evaluate candidate harnesses during search and generate the feedback signal for improvement, and from execution traces logged during those search runs. + +Advantages of code-space search. Harness optimization occurs in code space, where small changes to retrieval, memory, or prompt-construction logic can affect behavior many steps later, making local search heuristics poorly matched to the problem. By inspecting execution traces, the proposer can often infer *why* a harness failed and which earlier design choices likely contributed to the failure, not just *that* it failed, as illustrated by the search trajectories in Appendices A and A.2. There, we see that the proposer reads broadly across prior code and logs, then uses those traces to identify confounded edits, isolate likely causal changes, and shift toward safer modifications after repeated regressions. The proposer can therefore modify the harness at the level of algorithmic structure, ranging from changes to retrieval, memory, or prompt-construction logic to full program rewrites, rather than filling in templates or applying predefined mutation operators. In practice, it often starts from a strong prior harness, but this is an emergent strategy rather than a hard-coded rule. Although the search space is large, representing harnesses as programs provides a natural regularization bias: coding models tend to propose coherent algorithms rather than brittle, hard-coded solutions, which biases the search toward reusable context-management procedures. This action space is closely aligned with the read–write–execute workflows on which frontier coding assistants are trained. + +Practical implementation. In our experiments, each harness is a single-file Python program that modifies task-specific prompting, retrieval, memory, and orchestration logic. In our experiments, the proposer $P$ is Claude Code [^4] with Opus-4.6. The proposer is guided by a minimal domain-specific skill that describes where to write new harnesses, how to inspect previous harnesses and their execution traces, and what files it can and cannot modify. The base model $M$ varies by domain and is always frozen; see Section 4 for details. In our experiments, a typical run evaluates roughly 60 harnesses over 20 iterations. We provide additional tips for implementing Meta-Harness in a new domain in Appendix D. + +Algorithm 1 Meta-Harness outer loop over harnesses + +Input: tasks $\mathcal{X}$, LLM $M$, proposer $P$, iterations $N$ + +Initialize: population $\mathcal{H}$ $\triangleright$ Initial set of valid harnesses + +Initialize: filesystem $\mathcal{D}\leftarrow\emptyset$ $\triangleright$ stores code, scores, traces + +for $H\in\mathcal{H}$ do + + $E_{H}\leftarrow\textrm{Evaluate}(H,M,\mathcal{X})$ $\mathcal{D}\leftarrow\mathcal{D}\cup\{(H,E_{H})\}$ + +for $t=1\ldots N$ do + + Proposer $P$ queries filesystem $\mathcal{D}$ $\triangleright$ inspects prior harnesses and scores + + Proposer $P$ proposes $k$ new harnesses $\{H_{1},\dots,H_{k}\}$ + + for $H$ in $\{H_{1},\dots,H_{k}\}$ do + + if $H$ passes interface validation then + + $\mathcal{D}\leftarrow\mathcal{D}\cup\{(H,\textsc{Evaluate}(H,M,\mathcal{X}))\}$ + +return Pareto frontier of harnesses stored in $\mathcal{D}$ + +## 4 Experiments + +We evaluate Meta-Harness on three task domains: online text classification, math reasoning, and agentic coding. In each domain, we compare harnesses discovered by our search against domain-appropriate baselines using the standard evaluation metric. Please refer to each subsection for the precise experimental setup. + +We compare against two main classes of methods. (1) Human-designed strategies: these are hand-crafted harnesses for each domain, representing the current state of the art in context construction. We describe these baselines in the corresponding subsections. (2) Program-search methods: these methods search over candidate harnesses using feedback and reward signals, but are designed for smaller-scale settings than harness engineering. + +### 4.1 Online Text Classification + +We follow the online text classification setup of [^58] [^51]: an LLM receives labeled examples one at a time, updates its memory, and is evaluated on a held-out test set. We use GPT-OSS-120B as the LLM text classifier, and consider the problem of designing a harness for text classification. We use three datasets, chosen for difficulty and domain diversity: LawBench (Law) [^15] predicts criminal charges from case descriptions (215 classes); Symptom2Disease (S2D) [^18] predicts diseases from symptom descriptions (22 classes); and USPTO-50k [^40] predicts precursor reactants from product molecules (180 classes). We initialize the search population $\mathcal{H}$ from the main baseline harnesses in this setting: zero-shot, few-shot, ACE, and MCE. We ran 20 evolution iterations with two candidates per iteration, producing 40 candidate harnesses. + +![[x4.png|Refer to caption]] + +Table 2: Test-set metrics for all harnesses on the three datasets. Ctx denotes additional input tokens in context (thousands). †: implementation from 51. ↓ \\downarrow: lower is better. Meta-Harness improves online text classification accuracy while using a smaller input context. + +Comparison vs text optimizers. We compare Meta-Harness against representative methods for optimizing text. For a fair comparison, we use the same proposer configuration (Opus-4.6 with max reasoning), select candidates solely based on search-set performance, and hold out the test sets until the final evaluation. Since evaluation is the main computational bottleneck, we give each method the same budget of proposal harness evaluations. We consider the following points of comparison: + +- Best-of-N: independent samples from the seed with no search structure; a compute-matched control for whether search matters at all. +- OpenEvolve [^42]: evolutionary search over programs with LLM mutation. +- TTT-Discover [^53]: we use only the text-optimization component of their method, i.e., proposal selection via the PUCT reuse rule. + +In this setting, Meta-Harness matches the best prior text optimizers (OpenEvolve, TTT-Discover) in $0.1\times$ the evaluations, and its final accuracy surpasses theirs by more than 10 points (Figures 1 and 4). We attribute this speedup to the intentional design choices that impose minimum necessary structure on the outer loop (Section 3). In particular, Meta-Harness preserves full experience history using a filesystem and allows the proposer to inspect anything necessary, whereas both OpenEvolve and TTT-Discover operate with more structured and substantially more limited proposer inputs than full filesystem access. We note that online text classification is the smallest-context setting we study (Table 1), so if structure-heavy text optimizers already lag here, their limitations may only grow in harder regimes. + + + +| Method | Scores | Code | Summ. | Traces | Median $\uparrow$ | Best Acc $\uparrow$ | $>$ ZS | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Scores Only | ✓ | ✓ | × | × | 34.6 | 41.3 | 26 | +| Scores + Summary | ✓ | ✓ | ✓ | × | 34.9 | 38.7 | 23 | +| Meta-Harness (full) | ✓ | ✓ | \- | ✓ | 50.0 | 56.7 | 39 | + +Table 3: Ablation of the information available to the proposer in online text classification. $>$ ZS: number of runs whose accuracy exceeded the zero-shot baseline. The full Meta-Harness interface substantially outperforms scores-only and scores-plus-summary ablations. Access to raw execution traces is the key ingredient for enabling harness search. + +To isolate which parts of the proposer interface matter most, we compare three conditions in online text classification: a scores-only condition, a scores-plus-summary condition in which the proposer receives LLM-generated summaries but no raw traces, and the full Meta-Harness interface with access to execution traces (Table 3). The results show a large gap in favor of the full interface: scores-only reaches 34.6 median and 41.3 best accuracy, while scores-plus-summary reaches 34.9 median and 38.7 best. By contrast, Meta-Harness reaches 50.0 median and 56.7 best accuracy, and even its median candidate outperforms the best candidate found under either ablation. We interpret this as evidence that full access to execution traces is the most important component of the interface: summaries do not recover the missing signal, and may even hurt by compressing away diagnostically useful details. + +| Method | Median | Best | +| --- | --- | --- | +| GEPA [^1] | 32.6 | 40.2 | +| Best-of-N | 34.0 | 44.2 | +| OpenEvolve [^42] | 39.1 | 43.3 | +| TTT-Discover [^53] | 34.1 | 45.6 | +| Meta-Harness | 50.0 | 56.7 | + +Table 4: Text classification accuracies of the harnesses proposed by different text optimizers (search set). Meta-Harness is substantially more effective at harness optimization. + +Comparison vs state-of-the-art harnesses. Our primary points of comparison are hand-designed harnesses for this problem setting: Agentic Context Engineering (ACE, [^58]), which uses reflective memory curation to build context over time, and Meta Context Engineering (MCE, [^51]), which maintains and evolves a library of natural-language skills for context construction. As additional baselines, we evaluate zero-shot prompting and few-shot prompting with $N\in\{4,8,16,32,\text{all}\}$ examples. Results in Table 2 show that Meta-Harness improves substantially over prior hand-designed harnesses. The selected Meta-Harness 2 reaches 48.6% accuracy, outperforming ACE by 7.7 points and MCE by 8.6 points. These gains do not come from using more context: Meta-Harness uses only 11.4K context tokens, versus 50.8K for ACE and 28.5K for MCE. + +Accuracy–Context Tradeoffs. Because Meta-Harness performs free-form optimization over harness code, we can express a joint preference for both accuracy and context cost rather than committing to a single scalar objective in advance. Given only the current metrics and the desired trade-off, the proposer is able to discover harnesses across a broad range of the frontier, yielding a smooth accuracy–context Pareto curve in Figure 3. This allows us to trade additional context for higher test accuracy in a controlled way, rather than committing to a single hand-designed operating point. + +Out-of-distribution (OOD) task evaluation. We evaluate whether the discovered harness generalizes to entirely new datasets unseen during search. We consider nine diverse datasets, and describe them in detail in Section C.1. The selected Meta-Harness system achieves the best average accuracy (73.1%), outperforming ACE (70.2%) and all few-shot baselines (Table 5). Notably, we observe that naively adding more few-shot examples beyond $32$ hurts performance in $7/9$ tasks. Meta-Harness shows the highest performance on 6/9 datasets, suggesting that the discovered harness captures generally effective strategies for text classification rather than overfitting to the specific datasets used during search. + +| Harness | SciC | FiNER | Amz5 | FPB | GoEmo | Bank77 | News | SciT | TwHate | Avg Acc | Ctx $\downarrow$ | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| Zero-shot | 32.7 | 56.0 | 52.7 | 90.0 | 42.0 | 80.7 | 84.7 | 89.3 | 75.3 | 67.0 | \- | +| Few-shot (8) | 34.0 | 63.0 | 54.0 | 90.0 | 44.0 | 82.7 | 84.7 | 91.3 | 76.7 | 68.9 | 2.2 | +| Few-shot (32) | 38.7 | 62.0 | 53.3 | 90.7 | 43.3 | 86.0 | 85.3 | 90.7 | 76.7 | 69.6 | 5.2 | +| Few-shot (all) | 35.3 | 61.0 | 50.0 | 93.3 | 42.7 | 80.7 | 84.0 | 90.0 | 76.7 | 68.2 | 7.4 | +| ACE [^58] | 40.7 | 74.0 | 48.0 | 96.7 | 44.0 | 83.3 | 86.0 | 90.7 | 68.7 | 70.2 | 11.7 | +| Meta-Harness | 53.3 | 67.0 | 60.0 | 94.0 | 46.0 | 82.7 | 86.7 | 91.3 | 77.3 | 73.1 | 7.3 | + +Table 5: OOD text classification dataset evaluation. We report test accuracy for each dataset and the average additional context tokens across all nine datasets. Meta-Harness outperforms the next best method by 2.9 points on these 9 previously unseen tasks. + +### 4.2 Harnesses for Retrieval-Augmented Reasoning + +We study a somewhat non-standard setup for olympiad math solving: augmenting the model with the ability to retrieve examples from a large corpus. There is a good reason to expect retrieval to help mathematical reasoning in principle, because solutions often share reusable proof patterns, so previous reasoning traces contain information that a model may be able to exploit at inference time. Yet retrieval has not become a standard ingredient in this setting, and prior work suggests that it has been much less successful on reasoning-intensive math benchmarks than in more fact-grounded domains [^41] [^48] [^5]. The difficulty is that naive retrieval rarely surfaces the right traces in the right form. This suggests that success depends less on adding retrieval per se than on discovering the right retrieval policy. Rather than hand-designing that policy, we give Meta-Harness a hard set of olympiad problems and allow the retrieval behavior itself to emerge from search. + +The retrieval corpus contains $\geq$ 500,000 solved problems from eight open-source datasets. We carefully deduplicated and decontaminated it against both evaluation benchmarks and the search set, confirmed that held-out problems have no exact prefix matches under our string-based filter, and manually inspected top BM25 retrievals for held-out examples (Section C.2). We use Meta-Harness to optimize a harness for 40 iterations over a 250-problem search set of Olympiad-difficulty math problems (OlympiadBench + Omni-MATH hard), producing 109 candidate retrieval harnesses. We initialize the search population $\mathcal{H}$ from the main baseline harnesses in this setting: zero-shot, few-shot, and ACE. We select a single harness based on search-set performance using GPT-OSS-20B (Section B.2). We evaluate this harness on $200$ previously unseen IMO-level problems drawn from IMO-AnswerBench, IMO-ProofBench, and ArXivMath [^29] [^5]. In addition to GPT-OSS-20B, we evaluate the same retrieval harness on four models not seen during search: GPT-5.4-nano, GPT-5.4-mini, Gemini-3.1-Flash-Lite, and Gemini-3-Flash. We follow the standard evaluation protocol of prior work [^29] and report accuracy averaged over three samples per problem. + +Results. Table 6 compares the discovered harness against no retrieval, dense retrieval using the separate embedding model text-embedding-3-small, random few-shot prompting, and BM25 retrieval. In contrast, Meta-Harness operates entirely in code space on top of the same BM25-based lexical retrieval stack as the sparse baseline, rather than introducing an additional dense encoder. The discovered retrieval harness outperforms the no-retrieval baseline across all five held-out models, with an average gain of 4.7 points. It also matches or exceeds the strongest fixed baselines on average, outperforming BM25 retrieval by 1.3 points overall, while avoiding the regressions observed with dense retrieval and random few-shot prompting across several models. + +| Method | GPT-5.4n | GPT-5.4m | Gem-3.1FL | Gem-3F | GPT-20B | Avg. | +| --- | --- | --- | --- | --- | --- | --- | +| No Retriever | 23.0 | 28.8 | 28.6 | 42.6 | 47.6 | 34.1 | +| Dense Retrieval ($k{=}1$) | 27.1 (+4.1) | 24.5 (-4.3) | 31.3 (+2.7) | 42.3 (-0.3) | 46.9 (-0.7) | 34.4 (+0.3) | +| Dense Retrieval ($k{=}5$) | 31.1 (+8.1) | 28.3 (-0.5) | 37.1 (+8.5) | 47.2 (+4.6) | 46.7 (-0.9) | 38.1 (+4.0) | +| Random Few-shot | 23.1 (+0.1) | 24.5 (-4.3) | 31.0 (+2.4) | 40.4 (-2.2) | 41.8 (-5.8) | 32.2 (-1.9) | +| BM25 Retrieval | 30.2 (+7.2) | 29.2 (+0.4) | 32.8 (+4.2) | 46.6 (+4.0) | 48.9 (+1.3) | 37.5 (+3.4) | +| Meta-Harness | 31.7 (+8.7) | 30.4 (+1.6) | 34.9 (+6.3) | 46.3 (+3.7) | 50.6 (+3.0) | 38.8 (+4.7) | + +Table 6: Retrieval-augmented math problem solving on 200 IMO-level math problems. We show pass@1 averaged over three samples per problem, with absolute improvement over the baseline in parentheses. The discovered Meta-Harness retrieval strategy improves reasoning on these IMO-level problems across all five held-out models, with a 4.7-point average gain over no retriever. + + + +### 4.3 Evaluating Agentic Coding Harnesses on TerminalBench-2 + +TerminalBench-2 [^32] evaluates LLM agents on 89 challenging tasks that require long-horizon, fully autonomous execution under complex dependencies, and substantial domain knowledge. Prior work has shown that the choice agent harness has a large effect on performance on this benchmark. We initialize search from two strong open baselines, Terminus 2 [^32] and Terminus-KIRA [^24]. For this experiment, we perform search and final evaluation on the same 89-task benchmark. We use this benchmark as a discovery problem [^54] in which the goal is to discover a harness configuration that improves performance on a hard, publicly contested benchmark. This is standard practice: public writeups already describe repeated benchmark-specific harness iteration on TerminalBench itself [^17] [^33] [^24], and the benchmark is small and expensive enough that introducing a separate split would materially weaken the search signal. We additionally check for overfitting by manual inspection and regex-based audits for task-specific string leakage into evolved harnesses. We note that although the resulting harness is specialized to the TerminalBench-2 regime, autonomous completion of difficult long-horizon tasks from a single instruction is a core capability, and the benchmark consists of many tasks that frontier models and heavily engineered harnesses struggle with. + +
| Harness | Auto | Pass (%) |
| Claude Opus 4.6 | ||
| Claude Code | × | |
| Terminus 2 | × | |
| Mux | × | |
| Droid | × | |
| TongAgents | × | |
| MAYA-V2 | × | |
| Terminus-KIRA | × | |
| Capy | × | |
| ForgeCode | × | |
| Meta-Harness | ✓ | |
| Claude Haiku 4.5 | ||
| OpenHands | × | |
| Claude Code | × | |
| Terminus 2 | × | |
| Mini-SWE-Agent | × | |
| Terminus-KIRA | × | |
| Goose | × | |
| Meta-Harness | ✓ | |
| Statistic | Value |
|---|---|
| Files read per iteration (median) | 82 |
| Files read per iteration (range) | 69–99 |
| File type breakdown | |
| Harness source code | 41% |
| Execution traces | 40% |
| Score/summary files | 6% |
| Other | 13% |
| Datasets | Avg metrics | ||||
| Variant | USPTO | Symptom | LawBench | Avg | Ctx |
| Meta-Harness (Draft Verification) | 18.0 | ||||
| Meta-Harness (Error-Annotated) | |||||
| Meta-Harness (CoT Replay) | |||||
| Meta-Harness (Cluster Coverage) | |||||
| Meta-Harness (Cascade Retrieval) | |||||
| Meta-Harness (RRF + Contrastive) | 18.0 | ||||
| Meta-Harness (Relevance + Contrastive) | 18.0 | 90.6 | |||
| Meta-Harness (Label-Primed Query) | 45.0 | 48.6 | |||
I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-I’m afraid this is not the document you’re looking for. Try using the -search box above, and good luck.
-