One email each morning — yesterday's AI, sortedGet it in your inbox

METAL LAB

Shepherd, open-source runtime for rewinding agent execution unveiled

Northeastern and Stanford researchers unveil a Python runtime that branches, replays, and recovers agent execution like Git

이미지: METAL LAB 생성

Summary

  • Researchers from Northeastern University and Stanford University have released Shepherd, an MIT-licensed Python runtime
  • It records agent-environment interactions as Git-like execution traces, allowing forking to and returning from past states
  • The team reported fork speeds 5x faster than Docker and prompt cache reuse rates above 95%
개발 기관
노스이스턴대학교, 스탠퍼드대학교
라이선스
MIT, PyPI 설치 가능(pip install shepherd-ai), Python 3.11+ 필요
포크 속도
Docker 대비 5배 빠름
캐시 재사용률
95% 이상 프롬프트 캐시 재사용
성능 사례
CooperBench 페어코딩 성공률 28.8%→54.7%, TerminalBench-2 34.2%→39.4%

Researchers from Northeastern University and Stanford University have released Shepherd, an open-source Python runtime that can record and rewind the state of long-running AI agents. In cases like a coding agent misinterpreting an error and rewriting a file that was actually fine, the only previous options were to patch forward or restart from scratch. Both approaches carried significant token costs, and nondeterminism meant the same execution often couldn't be reproduced.

Shepherd records every interaction between an agent and its environment as typed events, building a Git-like execution trace. Each interaction is treated like a commit, but unlike Git, it captures not just files but also the agent process and filesystem state using a copy-on-write approach. This makes it possible to return to a specific point in time with a single fork command.

The research team said Shepherd can fork agent processes and filesystems 5x faster than Docker, and because the prompt prefix up to the branch point remains unchanged, replay reuses more than 95% of the prompt cache.

Intervention through meta-agents

Because forking is possible, it also becomes feasible to implement higher-level agents that observe execution traces and intervene before a problem gets committed. The team reported that applying real-time supervision to pair coding raised the CooperBench success rate from 28.8% to 54.7%. Branch-search-based counterfactual optimization also delivered up to 11 points higher performance than existing methods across four benchmarks while cutting execution time by up to 58%. In Tree-RL training, which branches rollouts at chosen points, the TerminalBench-2 score rose from 34.2% to 39.4%.

Shepherd supports OS-level permission enforcement via Seatbelt on macOS and Landlock on Linux (within privileged containers), and it is currently reported to be in an early alpha stage, not yet suitable for production environments.