acceptodds
Published as a conference paper at NeurIPS 2026

Shepherd: A Runtime Substrate Empowering Meta-Agents with a Formalized Execution Trace

Simon Yu, Derek Chong, Ananjan Nandi, Dilara Soylu, Jiuding Sun, Christopher D Manning, Weiyan Shi

Abstract

As LLM-based agentic systems grow more complex, they increasingly rely on meta-agents: higher-order agents that act on other agents, much like managers supervise employees. Yet existing agentic runtimes expose execution only as static environmental states, limiting the kinds of live and post-hoc interventions a meta-agent requires. To unlock these capabilities, we introduce Shepherd, a functional programming model that formalizes meta-agent operations on target agents as functions, with core operations mechanized in Lean. Shepherd records every agent–environment interaction as a typed event in a principled Git-like execution trace where any past state can be cheaply forked and replayed. Even at scale, Shepherd forks the agent process and its filesystem 5x faster than Docker, with >95% prompt-cache reuse on replay. We exemplify Shepherd's versatility in three use cases: (1) runtime intervention, where a live supervisor improves pair coding pass rate from 28.8% to 54.7% on CooperBench; (2) counterfactual meta-optimization, where a meta-agent branches to explore alternative paths, beating MetaHarness and GEPA across four benchmarks by up to 11 points with up to 58% lower wall-clock; and (3) Tree-RL training, where a meta-agent forks rollouts at chosen turns, lifting TerminalBench-2 from 34.2% to 39.4% on Qwen3.5-35B-A3B. These use cases show Shepherd is a performant and efficient substrate for programming meta-agents; we open-source it to advance future research.

Keywords:
Sydney, Main Track

Reviews

Among:
Shape:
123456this paper, Top 24%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.67 over 3 reviews, above 76% of the others.
Reviewer_4ep2OpenReview ↗
Rating
5
Clarity
3
Confidence
4
Originality
3
Quality
3
Significance
3
Read review
Summary

The paper introduces SHEPHERD, a runtime substrate that treats an LLM agent's execution as a first-class, version-controllable object so that a higher-order "meta-agent" can observe, rewind, branch, merge, and rewrite it. The design is framed through four functional-programming primitives: tasks, effects, scopes, and a Git-like execution trace.

Strengths and weaknesses

Strengths S1 — Clean, well-motivated conceptual framing. The "execution-as-a-first-class-value" lens and the emit/fork/merge/discard ↔ git mapping are elegant and easy to follow, and the "one substrate, three lifecycle applications" narrative is genuinely appealing. The paper makes a coherent case that meta-agents deserve a dedicated runtime.

S2 — The coupled fork is a real and useful systems insight. Coupling the worker process, filesystem, and LLM prefix so that revert is exact and the prompt cache survives replay is the right primitive for making branch-heavy meta-agent workloads affordable. This is the paper's most defensible technical contribution.

S3 — The substrate core is a substantial, competently engineered implementation. The released code/agentic (~60k LoC) has a deliberate modular architecture and a genuine multi-backend device abstraction (Table 10). The OverlayFS device layer handles the unglamorous hard parts correctly (whiteout markers, lower/upper-dir ordering, Linux/macOS-VM/FUSE paths), which is evidence of real systems expertise.

S4 — Notable candor in parts of the writeup. Appendix B ("proof envelopes" and the explicit "Non-claims") is unusually precise about the narrow scope of the formal claims, and Appendix A frames each result honestly as a proof-of-existence rather than a head-to-head superiority claim. The trajectory-compression appendix (D) is an underrated result and includes a sensible best-of-N control.

S5 — Broad evaluation: five optimization benchmarks, two base models for RL, CooperBench, and microbenchmarks across five sandbox backends.

Weaknesses

I inspected the accompanying code release. Several headline contributions could not be verified against it; some directly contradict it. I have framed these as "not present in / not reconcilable with the submitted archive," since the README defers the substrate library to a separate (unavailable) repository.

W1 — The CRO meta-optimizer (§5.2), one of three headline applications, is not in the submission.

W2 — The Tree-RL section (§5.3) is internally inconsistent and not reconcilable with the code.

Training framework: the main text (§5.3) says tinker; Appendix F.6 gives a detailed SkyRL + FSDP2 configuration (Adam, lr 5e-7, etc.); the code README states SLIME was used and that "the SkyRL / verl experiments were removed because the FSDP2 path was unstable" and "we intentionally skip the Tinker / OAT adapters." Appendix F.6 thus documents in detail a setup the authors say they abandoned. Model scale: the reported models are Qwen3.5-35B-A3B and Nemotron-3-Super-120B-A12B, but the actual SLIME training scripts target qwen3.5_9b / qwen3_8b. The launch script named in F.6 (experiments/a4-reversible-rl/modal_smoke_train.py) does not exist; the RL README is marked "(WIP)" and refers to this section as "§6." The checklist (Q8) claims LoRA fine-tuning (rank/lr/KL), but F.6 describes full FSDP2 and never mentions LoRA.

Given these, it is unclear which configuration produced Table 4, and the headline RL result cannot be taken at face value.

W3 — Possible distillation confound in Tree-GRPO. The fork-turn and the injected branch commands are produced by a stronger model (Opus 4.7) than the policy being trained, while only the continuations are sampled on-policy from πθ (Algorithm 2). It is not established that Table 4's gains come from finer-grained credit assignment rather than from injecting a stronger model's actions into the data distribution (an off-policy/distillation effect). No on-policy-only fork-selection ablation is reported.

W4 — Several headline comparisons are framed favorably.

"5× faster than Docker" is against docker commit; the relevant O(1) baseline BranchFS is only ~2× slower (Table 2), and the 192× figure is against full-rootfs copy (a strawman). Appendix C.1 also notes the fork is in-container while docker commit spawns new containers, so part of the gap reflects "no new container," not faster forking. CooperBench: the Opus-4.7 meta-agent (54.7%) still does not exceed the single-Haiku solo ceiling (57.2%). The 28.8%→54.7% headline is recovery from a self-induced coordination penalty using a stronger/more expensive supervisor; the genuine benefit (parallel wall-clock) is undersold. The intro states the RL gain as 26.1%→39.4% (vs. untrained base) while the abstract uses 34.2%→39.4% (vs. Flat GRPO). The latter is the meaningful comparison.

Questions

Q1 Where is the CRO optimizer implementation (run_counterfactual_batch, the proposer loop, _cbo_tools.py/_cbo_validators.py/_cbo_metagit.py)? Is §5.2 reproducible from released code, or only re-plottable from precomputed artifacts? Q2 Which framework actually produced Table 4 — tinker, SkyRL, or SLIME? Were the trained models 35B-A3B/120B-A12B or the 9B/8B in the scripts? Please reconcile F.6 (SkyRL+FSDP2, no LoRA) with the checklist (LoRA) and the README (SLIME; SkyRL removed). Q3 Please add an ablation isolating the source of the Tree-GRPO gain: on-policy-only fork selection (no stronger-model intervention) vs. the reported Opus-4.7-guided setup. Without this, how do you rule out distillation from the meta-agent? Q4 Please report per-pair token/dollar cost for each arm, and the result when the supervisor is the same model class (Haiku) as the workers. As reported, the method uses a stronger model and still trails the solo baseline. Q5 Does the ~95% reuse claim hold for self-hosted vLLM/SGLang during RL, where the policy changes every optimizer step and intra-step prefix sharing is already provided by the engine — or is it specific to the Anthropic billed prompt cache? What is the realized benefit beyond the engine's existing prefix caching?

Limitations

The paper does include a dedicated Limitations section (Appendix A.1) that honestly addresses the proof-of-existence framing, supervision/proposer cost, the weak-coupling assumption of counterfactual replay, and sandbox-backend caveats — this is a real positive.

Paper formatting concerns

N/A

Final justification

The work is solid and the rebuttals solves my concerns

Reviewer_Db6ROpenReview ↗
Rating
5
Clarity
3
Confidence
4
Originality
4
Quality
3
Significance
4
Read review
Summary

The paper introduces Shepherd, a functional programming model for meta-agents, higher-order agents that act on other agents. The core idea is to treat an agent and its execution as a first-class object, like a function another function can hold, call, copy, and rewrite. Shepherd records every agent-environment interaction as a typed event in a Git-like execution trace, so any past state can be forked and replayed cheaply. Every action is a commit, every fork a branch, and replay is exact. The core operations are mechanized in Lean through a small algebraic effect calculus that gives a semantic contract for the typed traces. The authors report that Shepherd forks the agent process and its filesystem 5x faster than Docker with over 95% prompt-cache reuse on replay, and they demonstrate three use cases: runtime intervention (a live supervisor improves pair coding pass rate from 28.8% to 54.7% on CooperBench), counterfactual meta-optimization (beating MetaHarness and GEPA across four benchmarks by up to 11 points with up to 58% lower wall-clock), and Tree-RL training (lifting TerminalBench-2 from 34.2% to 39.4% on Qwen3.5-35B-A3B).

Strengths and weaknesses

This paper was a fun read and has an interesting, clear idea in it. Treating the agent and its execution as a first-class object that you can fork, replay, and rewrite is the right abstraction for meta-agents, and the functional programming framing gives it clean properties. Observations don't perturb the worker, branches don't leak into the parent, rewinds are exact. The Git-like execution trace is a good fit. Every action is a commit, every fork a branch, and you get exact replay for free. The performance numbers back it up too, 5x faster forks than Docker and over 95% prompt-cache reuse. Also, the runtime intervention result on CooperBench, 28.8% to 54.7%, is a strong jump. Beating MetaHarness and GEPA on counterfactual optimization with lower wall-clock matters, and the Tree-RL result shows the substrate is general.

The framing is dense and needs unpacking. "Existing agentic runtimes expose execution only as static environmental states" is the central motivation, but I had to read it several times to understand what it means and why it limits a meta-agent. Spend more space up front on what a meta-agent actually needs that current runtimes can't give it.

The Lean mechanization is interesting but its role is underexplained. I want to know what the proofs actually guarantee and whether that guarantee makes a difference in practice, or whether it's a formal nicety on top of a system that would work the same way without it.

The appendix is very long. Some of what is in there should be pulled into the body, and it's not always clear what is core versus supplementary.

Questions
  1. What does "static environmental states" mean, and why does it limit a meta-agent?

  2. What exactly does the Lean mechanization prove, and does it matter in practice?

  3. What in the appendix is core and should be in the body?

Limitations

Yes, the paper is upfront about its scope. The properties it claims (non-perturbing observation, branch isolation, exact rewind) are tied to the functional grounding and the authors are clear about that.

Paper formatting concerns

None.

Final justification

I read the rebuttal and the reviewer and AC discussion. The sibling-fork clarification resolves my concern about parent continuation. The on-policy Tree-GRPO ablation isolates an effect beyond Opus guidance, and the matched-supervisor control makes the CooperBench result easier to interpret. I have no remaining blocking concerns and retain my rating of 5, Accept.

Reviewer_JUAqOpenReview ↗
Rating
4
Clarity
3
Confidence
4
Originality
3
Quality
3
Significance
3
Read review
Summary

This paper introduces SHEPHERD, a runtime substrate that formalizes meta-agent operations on target agents through a functional programming model grounded in algebraic effects and mechanized in Lean. SHEPHERD records every agent–environment interaction as a typed event in a Git-like execution trace, enabling meta-agents to read (observe effect streams), rewind (restore prior states), branch (fork agent + filesystem atomically via OverlayFS), and modify (rewrite task definitions) worker agents. The implementation achieves image-size-independent fork in 134–143ms (5× faster than Docker commit) and >95% LLM KV-cache reuse on replay. Three use cases demonstrate the substrate's versatility: (1) a live supervisor on CooperBench raises pair pass rate from 28.8% to 54.7%, closing 91% of the curse-of-coordination gap; (2) a counterfactual replay meta-optimizer (CRO) beats MetaHarness and GEPA on 4/5 benchmarks with 27–58% lower wallclock; and (3) a Tree-GRPO trainer lifts Terminal-Bench 2.0 from 34.2% to 39.4% on Qwen3.5-35B-A3B. The code is open-sourced.

Strengths and weaknesses

Strengths

  • The four core abstractions, tasks (typed functions over agentic execution), effects (typed append-only event streams with reversibility tiers), scopes (isolated execution regions with fork/merge/discard), and execution traces (persistent Git-like commit graphs), provide a unified functional-programming foundation for meta-agent operations. This is not ad hoc plumbing: the Lean mechanization gives formal guarantees for non-perturbation (observation doesn't affect the worker), isolation (branches don't leak into the parent), and replay soundness, even if coverage is limited to the core semantics.

  • The OverlayFS-based fork achieves 134–143ms regardless of image size (42 MB to 5.8 GB), compared to 658–725ms for Docker commit and 5–53 seconds for full copy. The >95% KV-cache hit rate from K=2 onwards means replay pays only the suffix generation cost. These claims are backed by detailed measurement protocols (Appendix C), mutation-size sweeps, scaling-depth studies, cross-backend portability checks (Docker/E2B/Modal/Daytona/Prime Intellect), and per-task per-depth cache tables.

  • The live supervisor, counterfactual optimizer, and tree-RL trainer span the full agent lifecycle (during/after/training execution) and all use the same primitives without per-application runtime modifications. Each produces meaningful empirical gains: 91% coordination gap closure, 4/5 benchmark SOTA with wallclock savings, and +3–5% RL improvement over Flat GRPO. This breadth is the strongest evidence that the substrate abstraction is well-chosen.

  • Open-source code submission, detailed appendix covering measurement protocol, agent-turn latency reference, cross-backend validation, context-inflation verification (0 extra tokens from supervision), and honest reporting of cost tradeoffs (supervision token cost can exceed worker's for short tasks).

Weaknesses

  • The fork model structurally precludes parent-child parallel execution. After scope.fork(), the parent worker cannot continue running — only child(ren) execute from the checkpoint while the meta-agent observes. This means the natural pattern of "let the worker keep running on its current path while speculatively exploring an alternative branch" is not directly expressible. The meta-agent must choose: either checkpoint and let only the child proceed, or fork multiple siblings from the same point. The paper does not sufficiently discuss this expressiveness limitation or its practical impact. For example, a supervisor that wants to tentatively try an alternative fix without pausing the main worker would need to fork two children (one replaying the current path, one trying the new path), incurring replay cost on the "continue as-is" branch.

  • Each use case is proof-of-existence with limited depth. Live supervision is tested only on CooperBench with a single worker model (Haiku 4.5). CRO relies on GPT-5.4 as meta-optimizer — a very strong model — and compares primarily against MetaHarness and GEPA, which are themselves recent and only partially comparable (different search strategies). Tree-GRPO compares only against Flat GRPO but not against the tree-search RL methods explicitly cited as motivation — Treerl [10] and Ji et al. [12]. Since the paper's core argument is that these methods cannot handle real-filesystem environments and SHEPHERD enables them, a direct comparison (or at minimum a clear explanation of why comparison is infeasible) would substantially strengthen the contribution.

  • Lean mechanization covers a narrow core, leaving a large gap to the production runtime. Appendix B explicitly states the proof envelope does not verify arbitrary Python control flow, provider SDK behavior, model outputs, shell commands, filesystem mutation correctness, Docker/sandbox implementations, scheduling, cancellation, or multi-branch replay. The mechanized object is a "small algebraic-effects trace machine" — while valuable as a formal reference, it leaves unclear what actionable safety guarantees a meta-agent developer actually obtains from the Lean proofs when building on the production Python framework.

Questions
  • When a meta-agent needs to "let the worker continue its current trajectory while simultaneously exploring a speculative alternative," how is this expressed in the current model? Must it fork two children (one replaying the current path, one diverging), thereby paying replay cost on the continuation branch? If so, how significant is this overhead in practice, and are there plans to support a "fork without pausing the parent worker" primitive?

  • Tree-GRPO is motivated by the limitation that Treerl [10] and Ji et al. [12] cannot handle real-filesystem state forking. Could the authors clarify why no direct comparison is provided? If their benchmarks are stateless (pure text reasoning), could Tree-GRPO be evaluated on those same stateless benchmarks to isolate the RL algorithm contribution from the substrate contribution?

  • For agent tasks involving irreversible effects (external API calls, database writes, sent messages), the meta-agent's rewind/branch capabilities become fundamentally limited. How does SHEPHERD handle mixed trajectories where some effects are irreversible? Is the compensation handler mechanism (§3.2) exercised in any of the three use cases, or is it currently theoretical?

Limitations

Yes.

Paper formatting concerns

N/A

Final justification

Thanks for authors' detailed rebuttal. The clarification of the fork semantics resolves my main concern, and the additional ablation and explanations adequately address my other questions. I will maintain my original rating of 4.

Comments on the paper

1 comment
Meta-review

The paper proposes a functional programming model for meta-agents providing git-like execution traces that enable past states to be forked and replayed. The reviewers are overall positive about the paper and I tend to agree with them. During the discussion it would be good to hear the authors' thoughts on the weaknesses pointed out, especially around the 1) limitation of the fork model [JUAq], 2) gap between Lean and production runtime [JUAq], 3) runtime intervention result on CooperBench going from 28.8% to 54.7% [Db6R], 4) the inconsistencies and confound pointed out by 4ep2

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.