Answers are grounded in this paper and cite their sources.
An agent built around a large language model includes a coordination layer that, for example, stores interaction history, selects prompts, and invokes tools. We call this layer the harness. Existing formal accounts of agents describe reasoning, policy, uncertainty, coordination, and harness architecture. We develop a compositional theory of harnesses using category theory. We begin with the category Poly of polynomial functors, modeling the interfaces of harness components as objects and interactions between components as morphisms. To capture component coordination and architectural structure, we then introduce the category Harn, in which harnesses are composable morphisms between polynomial interfaces. There, harnesses compose sequentially, in parallel, and hierarchically, so complex harnesses can be built from simple ones. We instantiate the theory through a sequence of examples, such as a chatbot, an agent calling a finite family of tools, and a coding agent using Bash. Using the resulting calculus, we extend the coding agent with agent skills and build an autoresearch harness with a strict-improvement policy, for which we prove that the recorded best score never regresses, independently of the model's decisions. This preprint has been submitted to Artificial Intelligence (Elsevier). It has not been peer reviewed.
No takes yet. Share an insight, caveat, or question.
Reimer et al. (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: