ARLIResearch
← ENSO Media
DEEP ANALYSIS

Agent Harness Architecture:
Convergence

Deep analysis of 6 articles on modern agent harness architecture, by Aparna Dhinakaran (Arize) and Mike Piccolo (iii). Convergence, context management, swarms, sandboxes, and the battle for trajectory data.

9
Architecture
Components
6
Harnesses
Compared
4
Convergent
Patterns
15
Jobs
(iii model)

6 Key Theses

  1. Convergence is the primary signal. Cursor, Claude Code, Windsurf, Codex, Hermes, OpenClaw, Pi, Letta, Alyx, all independently arrived at the same architectural patterns. This is not coincidence, but convergent evolution under the pressure of the same engineering constraints.
  2. Harness ≠ Framework. A harness ships as a working agent, the loop, context, tools, and safety are already configured. A framework requires assembly. Harness is for the agent; framework is for the human.
  3. Context management is the hardest subsystem. It's not "what fits in the prompt." It's a multi-layered system: caps, budgets, pagination, compaction, deduplication, and memory persistence.
  4. From delegation to orchestration. Delegation is spawn → block → return. Swarm management is identity, addressing, steering, recovery, cleanup. The runtime owns many agents over time.
  5. The sandbox is the server of the harness era. Harness : Sandbox = Application : Server. The trajectory and sandbox filesystem are the two artifacts that make an agent restartable.
  6. The battle for trajectory data. Whoever controls the trajectory (the full history of reasoning, tool calls, and decisions) defines the market. Labs vs enterprise infrastructure.

§1. What is a harness: the 9-component model

"A harness is not designed for humans to build agents. A harness is designed for the agent to accomplish almost any task."
— Aparna Dhinakaran, Arize

The modern agent harness was born bottom-up, from coding agents solving real tasks. Cursor, Claude Code, Windsurf, and Codex independently arrived at strikingly similar architectures. A harness is not a framework: it ships as a working agent. The iteration loop, context management, tool registry, and safety layer are already configured and running. There is no assembly step.

The harness closes the open loop of an LLM. Without a harness, the model is a one-shot text generator: it responds and stops. A model inside a harness can read a file, edit it, run tests, see errors, read the log, fix the code, and run tests again. Act → Observe → Adjust, a closed feedback loop.

1. Outer Iteration Loop (Act → Observe → Adjust) 2. Context Management & Compression 3. Skills / Tools Management 4. SubAgent Management 5. Built-in Pre-packaged Skills 6. Session Persistence & Recovery 7. System Prompt Assembly 8. Lifecycle Hooks 9. Permission & Safety Layer read-only → workspace-write → full-access Closed-loop paradigm
Fig. 1: 9-component harness architecture (Aparna Dhinakaran / Arize model). The outer ring is the Outer Iteration Loop; the inner core is the Permission & Safety Layer. Permission hierarchy: read-only → workspace-write → full-access.
Table 1. Framework vs Harness: the fundamental difference
DimensionFrameworkHarness
PurposeA tool for a human to assemble an agentA ready-made environment for an agent to perform tasks
Starting stateRequires configuration and assemblyWorks "out of the box"
ArchitectureHuman defines the state graphFixed architecture, validated by convergence
LoopOpen-loop: call model → responseClosed-loop: Act → Observe → Adjust
ExamplesLangGraph, CrewAI, AutoGen, OpenAI Agents SDKClaude Code, Hermes, OpenClaw, Pi, Letta, Cursor
Component replacementEntire stack — monolith; replacement = forkComponents are isolated; replacement = swap worker/plugin
Table 2. 9 components of a modern harness
#ComponentDescriptionAnalogy
1Outer Iteration LoopInfinite loop: model thinks → calls tools → gets results → thinks again. Provider-agnostic (Chat Completions, Anthropic Messages, Bedrock).CPU instruction cycle
2Context ManagementActive context window management: file caps, tool result budgets, pagination, pressure estimation, compaction.Virtual memory manager
3Skills / ToolsTool registry, separated from exposure. The model discovers available tools and composes them on its own.syscall table
4SubAgent ManagementSpawn child agents with isolated sessions, tool allowlists, and context inheritance.fork() + exec()
5Built-in SkillsPre-packaged skills: file operations, shell, search, web requests.libc / standard library
6Session PersistenceSession persistence: SQLite + FTS5, append-only JSONL, git-backed MemFS. Recovery after restart.Filesystem journal
7System Prompt AssemblyMulti-level system prompt assembly: stable (SOUL.md) → contextual (AGENTS.md) → volatile (memory, timestamps).Linker / symbol resolution
8Lifecycle HooksPre/post tool call hooks: plugin lifecycle (in-process) + filesystem gateway (out-of-process shell/Python).BPF / eBPF hooks
9Permission & SafetyPermission hierarchy: read-only → workspace-write → full-access. Fail-closed semantics. Approval gate. Recursion depth cap.seccomp / sandbox

🟢 Convergence: 9 components: not a wishlist

These nine components are not a wishlist. They are what every successful harness converged on independently. That convergence is the signal. Cursor, Claude Code, Windsurf, and Codex did not coordinate. They solved the same problem, and arrived at the same answer.

"These nine components are not a wishlist. They are what every successful harness converged on independently. That convergence is the signal."
— Aparna Dhinakaran, Arize

§2. Context management: the hardest subsystem

"Every agent harness runs into the same limit: the context window is too small for everything the model might want to remember."
— Aparna Dhinakaran, Arize

Context management is where the real engineering lives. It's not about "what fits in the prompt." It's about a multi-layered system: file read caps, tool result budgets, offset/limit pagination, compaction triggers, deduplication, and memory persistence. The key design question: how much context management happens inside the harness, and how much does the model do itself.

All four analyzed harnesses (Pi, OpenClaw, Claude Code, Letta) make different choices, but converge on the same patterns. This is the most striking finding of the comparative analysis, not the differences, but the degree of agreement.

🔵 6 patterns ALL four harnesses converged on

  • All hard-cap file reads (lines / bytes / tokens)
  • All support offset/limit pagination
  • All cap tool result sizes
  • All isolate sub-agent sessions
  • All run LLM-powered compaction
  • All estimate context usage and detect pressure
Context Management Convergence: 4 Harnesses Pi OpenClaw Claude Code Letta File Cap 2,000 lines / 50KB 2,000 lines / 50KB 256KB gate / 25K tok 10MB reject / 2,000 lines Tool Result Budget — 16K chars / 30% window 50K chars / tool 30K (bash) / 10K (grep) Compaction Trigger token > window − 16,384 history > 50% window token > window − 13,000 server-side + 25 msg threshold Truncation Strategy head-tail split (keep ~20K tok) multi-pass staged LLM + chunk drop 9-section LLM + 5-file re-attach server LLM + reflection subagents Pagination offset/limit ✓ offset/limit ✓ offset/limit ✓ offset/limit ✓ Sub-agent Isolation new process, in-memory fresh isolated session blank conversation 7 subagent types, isolated ✦ ALL 4 CONVERGE: hard-cap reads · offset/limit pagination · tool result caps · sub-agent isolation · LLM compaction · context pressure estimation "The most striking finding is not how different they are. It is how much they agree."
Fig. 2: Context management convergence: comparing Pi, OpenClaw, Claude Code, and Letta. Green highlights convergent features: all four harnesses independently arrived at the same solutions.
Table 3. Context management: 4-harness comparison
DimensionPiOpenClawClaude CodeLetta
File read line cap2,0002,0002,000 (default)2,000
File read byte cap50KB50KB256KB gate + 25K tok10MB stat reject
Line char truncation——2,000 chars2,000 chars
Tool result budget—16K chars / 30% window50K chars/tool, 200K/msg30K bash, 10K grep
Oversized tool result——2KB preview + disk persist—
Bootstrap file caps—12K/file, 60K total——
Compaction triggercontext − 16,384 tokhistory > 50% windowcontext − 13,000 tokserver-side + 25 msg
Compaction methodLLM head-tail (+~20K tok tail)Multi-pass staged LLM + chunk drop9-section LLM + 5-file re-attachServer LLM + reflection subagents
Token estimation———4 bytes/token heuristic
Tool result cache TTL—5 minutes——
Sub-agent contextFresh process, in-memoryFresh isolated (fork mode exists)Blank conv (fork path)7 built-in types, isolated
Deduplication——✓ idempotent reads—
"50 years of computing taught us that the best memory management is the kind the program never thinks about. Registers, cache lines, page tables, swap. Each layer managed by the system, each invisible to the layer above."
— Aparna Dhinakaran, Arize

🟠 Context management: the key tradeoff

The central design question: how much context management does the harness do, and how much does the model do. The winners (Claude Code, Hermes) delegate decisions to the model: what to keep, which files are important, when to compact. The harness provides scaffolding; the model works within it. But this is a tradeoff: more model autonomy = more tokens spent on meta-reasoning.

§3. Session compaction: LLM summarization across 4 harnesses

"The goal is not to show the model everything. It is to give it the right working set at the right time and allow it to dynamically make decisions to manage its own context."
— Aparna Dhinakaran, Arize

Compaction policy determines whether a long-running agent remains coherent or gradually degrades. Four harnesses demonstrate a spectrum of approaches, from simple head-tail split (Pi) to multi-stage staged summarization with reflection subagents (Letta).

Pi established the baseline pattern: LLM summarization, head-tail split (truncating old messages), token-based trigger. OpenClaw added a second layer: bootstrap caps + tool result budgets + multi-pass staged summarization. Claude Code introduced pre-query optimization (tool results to disk, 2KB previews) and a 9-section structured compaction prompt with re-attachment of up to 5 recently read files. Letta moved compaction server-side and added reflection subagents with a budget of 16,000 tokens.

Table 4. Compaction: 4-harness comparison
ParameterPiOpenClawClaude CodeLetta
Triggertoken > window − 16,384history > 50% windowtoken > window − 13,000 (~167K for 200K-model)server-side + 25 messages
Tokens retained~20,000 tailmulti-stage: remnants per pass9-section summary + up to 5 filesreflection summary (budget: 16,000 tok)
Summarizer modelSame LLMSame LLM (staged)Same LLM (9-section prompt)Same LLM + reflection subagent
Tool call safetyPre-compaction flushPre-compaction flushPre-compaction flush + file re-attachServer-side state preservation
Post-compact recoverySeed: summary + tailSeed: summary + bootstrap + cacheSeed: summary + 5 recent filesSeed: summary + MemFS + reflection
Fallback—Chunk dropOldest 20% API-group drop—
Budget modelFixed reserveWindow share (50%)Fixed buffer (13K)Step-count (25) + server-side

🟢 Convergence: all 4 harnesses do pre-compaction flush

A critical safety pattern: before compaction, all pending tool calls must be completed (flush). You cannot safely summarize a session while a tool call is in flight. This is another example of convergent design, an engineering necessity, not a choice.

Compaction in Hermes: lineage chain

Hermes implements a unique approach. Instead of repeatedly rewriting one transcript, on each compaction:

  1. The current session row in SQLite is closed
  2. A child session is created, seeded with the summary (seed: summary)
  3. Session ID is rotated
  4. Parent-child lineage is recorded

Summary budget: ~20% of compressed content, with a floor of 2,000 tokens and a ceiling of 12,000 tokens. The result, a lineage chain instead of one repeatedly rewritten transcript. This is unique relative to other architectures.

"If a long conversation compresses multiple times, you get a lineage chain instead of one repeatedly rewritten transcript. This is pretty unique relative to other harness architectures we've reviewed."
— Aparna Dhinakaran, Arize (on Hermes)

🔴 Sub-agent context management: unsolved problem

No harness solves the problem of long-lived subagents whose context grows independently of the parent. When a subagent runs for hours, its own compaction policy must be independent of the parent's. This is an open problem: coordinated compaction in the agent tree.

§4. Sub-agents and isolation

Sub-agents are the fourth component of the harness model. Patterns of spawning, isolation, and context inheritance differ, but the foundational principles are convergent.

Table 5. Sub-agent patterns
PatternPiOpenClawClaude CodeLettaHermes
Spawn (fresh)✓ new process✓ fresh session + session key✓ blank conversation✓ 7 built-in subagent types✓ delegate_task
Fork (inheritance)—✓ fork mode (copies transcript)✓ fork path exists✓—
Tool restrictionsRestricted setPer-subagent allowlistsRestricted setPer-type allowlistsDangerous commands → deny in delegated context
Workspace inheritanceIsolatedIsolated (fork = copy)IsolatedIsolated + MemFSUnder parent call path
LifetimeUntil task completeDurable (session key, run ID, registry)Until task completePersistent via MemFSWithin session
SteeringBlock → returnSteer, interrupt, kill, cascadeBlock → returnBlock → returnTask ID + structured return

Letta: 7 sub-agent types

Letta stands out with the richest set of built-in sub-agent types (7). Each type has isolated context, a specific tool allowlist, and a token budget. The reflection subagent is the most interesting: it runs every 25 messages, analyzes history, and updates the agent's persistent memory in MemFS.

Claude Code: 2 paths

Claude Code offers two paths for sub-agents: blank conversation (clean spawn) and fork (copying the parent transcript). The fork path is critical for tasks where the sub-agent needs the parent's context, for example, continuing a refactoring in the same codebase.

Hermes: delegate_task with future headroom

Hermes implements delegate_task with task ID and structured returns. Recursion is capped (configurable depth). But steering is block → return. Durable child-run control (run IDs, external steering, cleanup after parent exits) is an explicitly identified gap and "the most natural next architectural step."

🟠 The key question: who owns the sub-agent after spawn?

In the delegation model, the parent. In the swarm model, the runtime. This distinction determines everything: can the sub-agent outlive the parent, can it be addressed externally, who is responsible for cleanup. OpenClaw is the only harness that answers this question in favor of the runtime.

§5. Swarm Management: delegation vs orchestration

"One thing has become clear: swarm management is the next real systems problem in AI. Not single agents. Not one-off tool calls. Managing swarms of long-running agents."
— Aparna Dhinakaran, Arize

Delegation is not swarm management. Most frameworks can spawn sub-agents. That is the beginning of the problem, not its end. The real question: what happens after the child agent is created? Where does it live? Who owns it? Can it be addressed? Can it be steered? Can it complete after the parent has gone?

OpenClaw is the best example of swarm management in the ecosystem. Its sub-agents become gateway sessions with durable session keys, run IDs, lifecycle records, parent-child lineage, cleanup policy, and push-based completion.

Push-based Swarm Completion (OpenClaw) Parent Session sessions_spawn() Child Session Created agent:parent:subagent:uuid Child Runs tool loop Registry Waits lifecycle events · retry timers · grace windows task_completion Event type, source, childSessionKey, status, result Route to Requester Deliver / Queue / Retry "Completion is a routing problem, not a return value."
Fig. 3: Push-based Swarm Completion (OpenClaw). Parent spawns → child session is created with session key → registry waits → task_completion event → routing to the requesting session. Parent may be active, idle, restarted, or terminated.
Table 6. Swarm Management: Delegation vs Orchestration
DimensionDelegationOrchestration / Swarm Management
QuestionHow does one agent split work?How does the runtime own many agents over time?
ModelParent → Child, block → returnIdentity, addressing, steering, recovery
CompletionReturn valueRouting problem (push-based event)
OwnershipParent owns childRuntime owns all agents
LifecycleTied to parentIndependent (session key, run ID)
SteeringSpawn onlySteer, interrupt, kill, cascade
CleanupGC on parent exitSweeper: reconciliation state machine
QueuesNoneStrict ordering per session, parallelism across sessions
RolesNoneOrchestrator vs leaf, enforced at tool level
ImplementationMost harnessesOpenClaw (gold standard)
"They treat completion as a return value. In a swarm manager, completion is a routing problem."
— Aparna Dhinakaran, Arize

🟢 OpenClaw swarm machinery checklist

  • Session keys: agent:<targetAgentId>:subagent:<uuid>, unique address for each agent
  • Run IDs: each run gets an identifier
  • Registry: persistent on-disk registry, restores runs on startup
  • Lifecycle events: structured events at every stage
  • Push-based completion: task_completion event → routing → requester session
  • Queue policy: lanes (main, subagent, cron) with separate concurrency limits
  • Steering: steer (redirect), interrupt, kill, cascade (tree)
  • Sweeper: reconciliation active runs vs session state, expiry, retry stuck states
"Every swarm manager eventually becomes a cleanup system."
— Aparna Dhinakaran, Arize

🔴 Gap: Hermes needs orchestration

Hermes has excellent delegation (delegate_task with task ID), but lacks durable child-run control: run IDs, external steering, independent lifecycle management, and cleanup semantics that survive parent termination. This is "the most natural next architectural step", explicitly identified in article 4.

§6. Hermes: architectural deep-dive

"Hermes is one of the best open-source harnesses in the ecosystem right now."
— Aparna Dhinakaran, Arize

Hermes implements all 9 components of the harness model, and adds three additional subsystems: messaging gateway, profile system, and cron as a first-class subsystem. The details are in how the components are implemented, and in what lies beyond this framework.

Hermes: 3-tier System Prompt Assembly Tier 1: STABLE (immutable) SOUL.md Tool guidance · Skills index Environment hints Never changes during a session. Defines agent identity. Tier 2: CONTEXT (project-level) AGENTS.md CLAUDE.md .cursorrules Injection scanning Files from cwd. Scanned at startup. Change on working directory switch. Tier 3: VOLATILE (dynamic) Memory snapshots User profile Timestamps Changes every turn. Memory snapshots, long-term memory slices via session_search. ▲ Bottom-up assembly: Stable → Context → Volatile. Each tier has a token budget.
Fig. 4: Hermes: 3-tier System Prompt Assembly. Stable (SOUL.md, tools, skills) → Context (AGENTS.md, CLAUDE.md, .cursorrules) → Volatile (memory, profile, timestamps). Tiering is explicit in code: invariants are easier to verify.
Table 7. Hermes: 9 components + 3 additional subsystems + Gap Analysis
ComponentHermes ImplementationRating
1. Outer Iteration LoopProvider abstraction via transport adapters: Chat Completions, Anthropic Messages, Codex, Bedrock✓ Strongest in open source
2. Context ManagementFull compression path with lineage chains. session_search for focused recall.✓ Unique lineage approach
3. Skills / ToolsCentral registry at import + exposed toolset, scoped by platform/scenario✓ Registration and exposure separated
4. SubAgent Managementdelegate_task with task ID, structured returns, recursion cap✓ Strong delegation
5. Built-in SkillsFile operations, shell, search, web✓
6. Session PersistenceSQLite + FTS5 + WAL journaling (with fallback). Compression lineage.✓ Advanced
7. System Prompt Assembly3-tier composition: stable, context, volatile. Explicit in code.✓ Transparent tiering
8. Lifecycle Hooks2 surfaces: plugin lifecycle (in-process) + filesystem gateway (out-of-process shell/Python)✓ Two trust models
9. Permission & SafetyHierarchy: read-only → workspace-write → full-access. Dangerous commands → deny in delegated contexts.✓
+ Additional Subsystems
Messaging GatewayTelegram, Discord, Slack, WhatsApp and others✓ Multi-platform
Profile SystemIsolated agent roots: "Two profiles on one machine = two different agents"✓ Unique
CronFirst-class: durable, gated permissions, isolated per profile✓ Unique
▸ Gap Analysis
Swarm OrchestrationGAP: No durable child-run control (run IDs, external steering, cleanup after parent). The most natural next step.
Sub-agent ForkGAP: No fork mode for parent transcript inheritance (unlike OpenClaw, Claude Code, Letta).
"Hermes already has excellent execution quality and a strong systems foundation for an open harness. It is probably one of the best open model harnesses in the ecosystem."
— Aparna Dhinakaran, Arize

🔵 Hermes's unique architectural decisions

  • Compression lineage: SQLite row → child session (seed: summary) → session ID rotation → parent-child lineage. Chain instead of overwrite.
  • Provider abstraction: One runtime → Chat Completions, Anthropic Messages, Codex Responses, Codex app-server, Bedrock. Normalization via transport adapters.
  • Tool registration vs exposure: Separate concerns. Tools are registered centrally; exposed scoped by platform.
  • Profile isolation: Two profiles on one machine behave as two different agents.
  • Cron as first-class: The task scheduler is not a plugin, but a subsystem with its own permissions and per-profile isolation.

§7. iii Worker Model (Mike Piccolo)

"A harness is not a thing you install. A harness is a set of jobs your system has to do for an agent to run durably, safely and observably."
— Mike Piccolo, Founder & CEO, iii

Mike Piccolo argues: the traditional harness form is wrong. It's not one thing, it's 10-12 different things bundled together. Every long-running agent team eventually rewrites their harness from scratch because frameworks ship it as a monolith. iii's bet: workers on a shared bus, each replaceable, each independently versioned.

The model: 15 jobs (tasks a production harness must perform) → 11 workers (independent processes) on a WebSocket bus. Each worker registers functions and triggers. Every layer is reachable via 1-2 function IDs on the bus.

iii Worker Model: 15 Jobs → 11 Workers on WebSocket Bus WebSocket Engine Bus register functions · triggers · events · state turn-orchestrator provider-anthropic provider-openai auth-credentials policy-engine approval-gate session branching tree persistence llm-budget hook-fanout context-compaction models-catalog harness-meta
Fig. 5: iii Worker Model: 11 workers on a WebSocket bus. Each worker is an independent, replaceable, versionable process. Each layer reachable via 1-2 function IDs. Fail-closed: worker unavailable or 5s timeout → deny.
Thin-to-Thick Slider THIN 4 workers MEDIUM 8 workers THICK 14+ workers, custom turn-orchestrator + provider + auth + meta Minimal, CLI agent + session + budget + compaction + policy-engine + hook-fanout Team-level deployment + Slack approval + OTel + custom workers (any lang) Enterprise production Same wire protocol · same trace shape · config change, not a rewrite
Fig. 6: Thin-to-Thick Slider: moving along the slider is a config.yaml change, not a harness rewrite. Thin (4 workers: turn-orch + provider + auth + meta) → Medium (8) → Thick (14+ with custom). Same wire protocol at every position.
Table 8. iii: 15 Jobs → 11 Workers Mapping
#JobWorkerFunction ID
1Accept turn request + persistharness-metaharness::accept_turn
2Resolve credentialsauth-credentialsauth::get_token
3Look up model capabilitiesmodels-catalogmodels::get_capabilities
4Drive per-turn state machineturn-orchestratorturn::orchestrate
5Load/serve skill bodiesharness-metadirectory::skills::get
6Assemble system promptharness-metaprompt::assemble
7Stream tokens to clientprovider-*provider::stream
8Check tool calls vs policypolicy-enginepolicy::check_permissions
9Pause + route approvalapproval-gateapproval::resolve
10Track LLM spendllm-budgetbudget::record
11Run hooks before/after toolshook-fanouthook::fanout
12Persist session (branching tree)sessionsession::persist
13Compact session historycontext-compactioncontext::compact
14Emit event stream for UIharness-metaevents::emit
15Carry OTel traceharness-metatrace::propagate

Turn FSM: 7 states

The turn finite state machine has been collapsed from 11 to 7 states in the production version:

provisioning → assistant_streaming → function_execute → function_awaiting_approval → steering_check → (loop back or finishSession)

5 policy replacement examples (policy engine)

The policy engine is a replaceable worker. Any can be swapped without changing the rest of the system:

  1. OpenAI safety classifier, worker calling the moderation endpoint
  2. OPA (Open Policy Agent). Rego rules integrated via policy::check_permissions
  3. Cedar (AWS), declarative access policies
  4. Human-in-the-loop via Slack, approval-gate worker with Slack integration
  5. Budget-aware routing, llm-budget worker decides which model to use
"That's the property the composition gives you: a major internal rewrite of one worker is a self-contained change because every neighbour talks to it through bus-level function ids."
— Mike Piccolo, Founder & CEO, iii

🟠 iii: key numbers

  • 15 jobs, the number of tasks a production agent harness must perform
  • 11 workers, in the default iii production stack
  • 7 FSM states, collapsed from 11
  • 5 seconds, timeout for policy::check_permissions; fail-closed → gate_unavailable
  • ~500ms, saved per function call via subscriber-presence cache
  • 3 policy outcomes: allow | deny | needs_approval
  • 3 OTel span tags: iii.session.id, iii.message.id, iii.function.id
  • 2 terminal states: stopped (clean exit) and failed (unexpected throw)
"You don't adopt the iii harness. You install the workers you want, write the ones you need, and end up with a harness shaped exactly like your system."
— Mike Piccolo, Founder & CEO, iii

§8. Sandboxes: from disposable evals to long-running swarms

"The harness is the application. The sandbox is the server."
— Aparna Dhinakaran, Arize

The harness-to-sandbox relationship is the same as application-to-server. The harness reasons and calls tools; the sandbox provides isolated execution. They can be swapped independently. Sandbox evolution proceeds in two phases:

Table 9. Sandboxes: from evals to swarms
DimensionEvals (Phase 1)Long-Running (Phase 2)Swarms (Future)
LifecycleDisposable: spun up, thrown awayPersistent: hours of executionFleet: hundreds of parallel runs
StateNo persistent stateFilesystem state preservedDistributed state
ArtifactsEvaluation results onlyTrajectory + local dataTrajectory + data + lineage
RestartabilityImpossible (no state)From trajectory + filesystemFrom trajectory (Claude Code, Cursor already can)
ScaleDozens of runsHundreds of runsThousands of runs across providers
Who owns stateLab (eval framework)Split: lab / enterpriseCritical market question
ExamplesDaytona, E2B (disposable mode)Stripe Minions, BrowserbaseOpenClaw swarm + sandbox fleet

The two artifacts of restartability

Two things make a harness restartable:

  1. Trajectory, the full record: questions, tool calls, decisions. The most valuable artifact.
  2. Local data (filesystem), everything created/modified in the sandbox.

Anthropic frames this as "decoupling the brain from the hands." Brain = harness. Hands = sandbox. The session log lives outside both.

🟠 Who owns state: labs vs enterprise

The key divide: labs (AI providers) want to control the trajectory because it's data for model improvement. Enterprise customers cannot allow labs connectivity to production infrastructure. Hence the tension: where does the swarm control layer live, in the customer's infrastructure or inside the labs?

"The sandbox becomes cattle."
— Aparna Dhinakaran, Arize (disposable infrastructure)

Sandbox market players

§9. The market and battle lines

"The ones who own the swarm management layer and the trajectory data will define this market."
— Aparna Dhinakaran, Arize

The agent harness market is defined by three battle lines:

1. Labs vs Customer Infrastructure

Where does the control layer live? If at labs (Anthropic, OpenAI), they control the trajectory, model, observability, and upgrade path. If at the enterprise customer, the customer controls data, security, and compliance. This is a fundamental tension: enterprises cannot give labs access to production, but labs need data for improvement.

2. Swarm Control Layer

Who manages the agent swarm? OpenClaw shows that swarm management is a system inside the runtime. But who will manage cross-runtime swarms? Agents distributed across different harness instances, different organizations, different clouds? This is still an open problem.

3. Trajectory Ownership

Trajectory is the most valuable artifact. It makes work reproducible, auditable, and improvable. Control over trajectory = leverage in the future AI market. Current state: Claude Code and Cursor can restart from their own trajectories, but not from others'. There is no standard trajectory format.

"Control of the swarm and control of the trajectory state are the battle lines."
— Aparna Dhinakaran, Arize

🔴 Who defines the market?

  • Labs (Anthropic, OpenAI): want to control harness, trajectory, and upgrade path. Claude Code with remote-tunable feature flags, an example of this approach.
  • Open-source harness (Hermes, Letta, Pi): control is with the user. But the infrastructural burden is also with the user.
  • Worker-based (iii): middle path. User chooses workers; infrastructural burden is distributed.
  • Sandbox providers (Daytona, E2B, Browserbase): control the execution environment. Whoever owns the environment, owns the data within it.

🔵 Inevitable convergence

Just as with the 9 harness components, the market is moving toward convergence on several patterns: trajectory as a standard artifact, push-based completion for swarms, policy engine as a replaceable component, and sandbox as cattle (disposable infrastructure). The differences are in who controls these components.

§10. Cross-sectional synthesis: what we know and what's next

"The next generation of tough technical problems in artificial intelligence are AI engineering systems problems."
— Aparna Dhinakaran, Arize
Full-Stack Agent Infrastructure Application Layer Business logic · domain-specific agents · workflows · user-facing features Swarm Manager Orchestration · identity (session keys) · push-based completion · recovery · sweeper Harness Loop · tools · context · compaction · system prompt · hooks · permissions Sandbox Isolation · execution · filesystem · network · cattle (disposable infrastructure) ← Business value ← Control plane ← Agent runtime ← Compute substrate ✦ All four layers independently converged, the convergence across the ecosystem is unmistakable
Fig. 7: Full-Stack Agent Infrastructure: 4 layers (Sandbox → Harness → Swarm Manager → Application). All four layers independently converged across the ecosystem.

8 convergent patterns

  1. Outer while-tool loop, all 6 harnesses: Act → Observe → Adjust
  2. File read hard caps, 2,000 lines de-facto standard (Pi, OpenClaw, Claude Code, Letta)
  3. LLM-powered compaction, all 6 harnesses; token-based triggers
  4. Sub-agent session isolation, all 6: fresh or fork, but always isolated
  5. Offset/limit pagination, all 4 analyzed in detail
  6. System prompt assembly, multi-level (3-tier in Hermes, 3-layer in iii)
  7. Permission/safety layer, read-only → workspace-write → full-access hierarchy
  8. Session persistence, all 6: SQLite, JSONL, MemFS, or key-value store
Table 11. Convergence Matrix: 27 features × 6 harnesses
FeaturePiOpenClawClaude CodeLettaHermesiii
Outer while-tool loop✓✓✓✓✓✓
File read caps (lines/bytes)✓✓✓✓✓—
Offset/limit pagination✓✓✓✓——
Tool result size caps✓✓✓✓✓—
LLM-powered compaction✓✓✓✓✓✓
Token-threshold trigger✓✓✓✓✓✓
Context usage estimation✓✓✓✓✓—
Sub-agent isolation✓✓✓✓✓—
System prompt assembly✓✓✓✓✓✓
Permission/safety layer✓✓✓✓✓✓
Session persistence✓✓✓✓✓✓
Lifecycle hooks—✓——✓✓
Built-in pre-packaged skills✓✓✓✓✓✓
Sub-agent spawning✓✓✓✓✓✓
Tool-call/result boundary safety✓✓✓—✓—
Forked sub-agent transcripts—✓✓✓——
Pre-compaction state flush—✓✓✓——
Deduplication of idempotent reads——✓———
Remote-tunable feature flags——✓———
Multi-provider model abstraction————✓✓
Messaging gateway—✓——✓—
Cron / first-class scheduling————✓—
Profile/workspace isolation————✓—
OpenTelemetry tracing—————✓
Worker-level replaceability—————✓
Durable child-run control (swarm)—✓————
Push-based completion routing—✓————

Identified gaps: what's next?

  1. Swarm orchestration beyond delegation. Hermes gap: no durable child-run control. OpenClaw, the only one with full swarm management.
  2. Standardized inter-harness communication. No cross-vendor protocol for agent-to-agent messaging.
  3. Trajectory portability. No standard format for export/import of trajectories between harnesses.
  4. Federated swarm management. Cross-runtime agent coordination between organizations/clouds.
  5. Long-term memory beyond the session. Letta MemFS, the most ambitious approach, but the problem is unsolved.
  6. Swarm-level cost optimization. Budgeting is individual (iii llm-budget), but not swarm-level.
  7. Trajectory data security. No one has proposed a specific security model for trajectory (encryption at rest, access control, audit trails).
  8. Sandbox standardization. Daytona, E2B, Stripe Minions, iii-sandbox, no common interface.
  9. Observability and debugging for swarms. Understanding why agent #7 in a tree of 40 got stuck, an unsolved problem.
  10. Governance. Hooks and permissions handle safety, but governance (who can spawn swarms, audit trail for decisions) is absent.

Data Compendium: all numbers

Token / Line / Byte Budgets
ParameterValueSystem
File read line cap2,000 linesPi, OpenClaw, Claude Code, Letta
File read byte cap50 KBPi, OpenClaw
File read byte gate (pre-open)256 KBClaude Code
Post-read token gate25,000 tokClaude Code
File read stat reject10 MBLetta
Line character truncation2,000 charsClaude Code, Letta
Bootstrap file char cap12,000 chars/fileOpenClaw
Bootstrap total char cap60,000 charsOpenClaw
Bootstrap split ratio75% head / 25% tailOpenClaw
Tool result char budget16,000 chars / 30% windowOpenClaw
Tool result (bash/subagent)30,000 charsLetta
Tool result (grep)10,000 charsLetta
Per-tool cap50,000 charsClaude Code
Per-message aggregate cap200,000 charsClaude Code
Oversized tool result preview2 KBClaude Code
Tool result cap (Alyx)10,000 tokAlyx (Arize)
Reflection subagent budget16,000 tokLetta
Policy engine timeout5 secondsiii
Compaction Numbers
ParameterValueSystem
Compaction reserve tokens16,384Pi
Keep recent tokens~20,000Pi
Compaction trigger (history share)50% windowOpenClaw
Compaction trigger (buffer)13,000 tokClaude Code
Effective compaction (200K model)~167K tokClaude Code
Post-compaction file re-attachup to 5 filesClaude Code
Compaction prompt sections9 sectionsClaude Code
Fallback head-dropoldest 20% API groupsClaude Code
Compression summary ratio~20%Hermes
Compression summary floor2,000 tokHermes
Compression summary ceiling12,000 tokHermes
Compression trigger (Alyx)50,000 tokAlyx (Arize)
Reflection trigger25 user messagesLetta
Token estimation heuristic4 bytes/tokenLetta, Alyx
Tool result cache TTL5 minutesOpenClaw
Architecture / State Machine Numbers
ParameterValueSystem
Harness components9Dhinakaran Model
Harness jobs15 (13-15)Piccolo / iii Model
iii production workers11iii
iii FSM states (current)7 (from 11)iii
Prompt tiers3 (stable, context, volatile)Hermes
Policy outcomes3 (allow, deny, needs_approval)iii
Hook surfaces2 (plugin + filesystem)Hermes
Letta subagent types7 built-inLetta
Run modes3 (plan, ask, agent)iii
OTel span tags3 (session, message, function)iii
Latency saved per function call~500msiii
Sandbox deployment scale100s-1000s runsEval industry
Restart artifacts2 (trajectory + local data)General

All authors and companies

Authors: Aparna Dhinakaran (Arize, articles 1, 2, 3, 4, 6), Mike Piccolo (iii, article 5).
Harnesses: Pi (pi-mono / earendil-works), OpenClaw, Claude Code (Anthropic), Letta (Letta Code), Hermes (Nous Research), iii (iii.dev).
Sandboxes: Daytona, E2B, Stripe Minions (Steve Kaliski), Browserbase (Kyle Jeong).
Tools: GrowthBook (feature flags Claude Code), Arize (observability, Alyx).
Contrast: LangChain, LangGraph, CrewAI, AutoGen, OpenAI Agents SDK, OPA, Cedar.
Products: Cursor, Windsurf, Codex.