GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
RecentarXiv preprint

Shepherd: Enabling Programmable Meta-Agents via Reversible Agentic Execution Traces

Shepherd records an agent's run as a Git-like trace of actions and environment states that another agent can watch, fork, revert and replay. What that enables, and what its numbers do and do not show.

Breakdown by FDE Interviews · 13 min read · Updated

About the original · 2026
AUTHORS
Yu, Chong, Nandi, Soylu, Sun, Manning, Shi
FROM
Northeastern University, Stanford University
PUBLISHED
May 2026 · arXiv preprint
CITED BY
12Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 18% of this breakdown.

01

The paper in one minute

More and more agent systems contain an agent whose job is another agent: a supervisor that keeps parallel coding agents from colliding, an optimizer that rewrites a workflow after reading its failures, a training loop that branches rollouts to find which step mattered. The paper calls these meta-agents. Shepherd, from Stanford and Northeastern (first posted May 2026), is a Python runtime built so that a meta-agent can treat another agent's execution as an object it can hold and change.

It does that with four ideas from functional programming. An agent is a task: a typed function with a docstring, so agents can be passed around, substituted and generated. Every action is an effect, recorded first as an intent and then as an outcome in an immutable stream, so an observer can read what is about to happen without changing it. A scope forks the agent and its environment together, copy-on-write, and the fork can be merged back or discarded. The trace is a persistent, Git-like commit graph, so any earlier state can be checked out byte for byte and replayed.

The measurements fall into two kinds. The substrate numbers are concrete: a fork of a 5.8 GB container image takes 143 ms, about five times faster than docker commit, and replays reuse about 95% of the model provider's prompt cache. The three applications are framed by the authors as proofs of existence: each improves on its baseline in one setting, with one meta-agent design, and the paper says plainly that it does not claim the results could not be matched without Shepherd.

THE IDEA, VISUALLY
AN AGENT RUN AS A GIT-LIKE TRACE intent edit app.py outcome file written intent rm -rf build/ outcome blocked meta-agent reads the intent and discards it before the outcome exists SCOPES: FORK, THEN MERGE OR DISCARD main branch A: tests pass branch B: tests fail merge A, discard B Agent and filesystem fork together, copy-on-write. Discard leaves the parent byte-identical. REVERSIBILITY TIERS reversible: files, sandbox state compensable: database writes, via your handler irreversible: model calls, email; recorded only FORK A 5.8 GB IMAGE (TABLE 3) full copy 53,462 ms docker commit 725 ms BranchFS 280 ms Shepherd 143 ms log scale; revert times are similar (147 ms) COOPERBENCH PAIR PASS RATE (FIGURE 3) two agents, peer messages 28.8% + Sonnet 4.6 supervisor 45.3% + Opus 4.7 supervisor 54.7% one agent, both features 57.2% the supervisor closes 91% of the gap; solo still leads TERMINAL-BENCH 2.0 (TABLES 4 AND 5) MetaHarness 31.2% in 173 min CRO 35.2% in 73 min Qwen3.5-35B-A3B base 26.1 GRPO 34.2 Tree-GRPO 39.4 Nemotron-3-Super base 30.3 GRPO 33.8 Tree-GRPO 37.2 Tree-GRPO forks rollouts at a meta-agent-chosen turn and scores siblings that share a prefix.
Left: every model call, tool call and file change becomes a typed effect in a Git-like trace. An intent is recorded before its outcome, so a supervisor can stop a destructive action before it happens; a scope forks the agent and its files together and can be merged or discarded. Right: fork latency (Table 3), the CooperBench supervision result (Figure 3) and the Terminal-Bench 2.0 results for replay-based optimization and Tree-GRPO (Tables 4 and 5).
Research notes: the problem, approach and results
143 ms

fork of a 5.8 GB environment, against 725 ms for docker commit (Table 3)

28.8% to 54.7%

pair pass rate of two coding agents with an Opus supervisor, CooperBench (Figure 3)

35.2% in 73 min

replay-based optimizer on Terminal-Bench 2.0, against 31.2% in 173 min (Table 4)

THE PROBLEM

Agents that supervise, repair or train other agents need to watch, pause, branch and undo a running agent, but agent runtimes expose only transcripts and environment snapshots.

THE IDEA

Treat a run as data: typed effects in an immutable stream, copy-on-write scopes that fork agent and environment together, and a persistent commit graph you can check out at any point.

THE RESULT

Forks in about 140 ms regardless of image size, and three meta-agents built on it: a runtime supervisor, a replay-based workflow optimizer and a tree-search RL trainer, each improving on its baseline.

02

Why it matters to an FDE

Customers deploying coding agents and back-office agents ask the same three questions sooner or later. Can we stop it before it does something destructive? Can we undo what it did? Can we try a different approach without starting over? Most agent stacks answer with logs and container snapshots assembled by hand. Shepherd is a clear design for answering all three with one mechanism, and its vocabulary (intent before outcome, scopes that fork agent and environment together, reversibility tiers) is useful even if you never install it.

The paper is also honest about where the mechanism stops. Some effects cannot be undone: a model call has happened, an email has been sent. Shepherd marks these as irreversible and can only record them. Database writes can be rolled back only through compensation handlers you write. That three-way split (reversible, compensable, irreversible) is the right way to talk to a customer about undo, and it maps directly onto the sagas and sandboxing conversations you already have.

The project is early. Its repository describes it as alpha (version 0.3.1 at the commit we read, MIT licensed), with operating-system enforcement on macOS and Linux and none on Windows. Treat it as a reference design and a research tool today, not a production dependency.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 297 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>2 runnable code blocks
  • ▦3 results tables
  1. 03Key takeaways

    Six points on reversible traces, supervision results and what the cost model leaves out

    Free account
  2. 04How it works

    Follow a supervisor that forks a worker before a risky write and keeps only the passing branch

    Premium
  3. 05The numbers that matter

    The substrate benchmark and three applications, with what each comparison controls for

    Premium
  4. 06Try it yourself

    Recompute the paper's ratios from its tables, then model what replay from a fork point saves

    Premium
  5. 07Where it breaks

    Irreversible effects, cost of strong supervisors, weak baselines, platform limits and maturity

    Premium
  6. 08Using it on a deployment

    Where reversible traces help in a customer deployment, a worked example and what to measure

    Premium
  7. 09Interview angles

    Questions on undo, supervision and reading a meta-agent result against the right baseline

    Premium
Back to the paper library →