让智能体沙箱恢复更准更快,只存有用状态。
Crab: A Semantics-Aware Checkpoint/Restore Runtime for Agent Sandboxes

- 用eBPF分析每轮操作的系统影响,决定是否需要保存状态。
- 恢复正确率从8%提升至100%,检查点流量减少87%。
- 适合高并发智能体部署,对性能影响小于2%。
自主智能体通过沙箱容器和微虚拟机运行,其状态涉及文件系统、进程和运行时资源。检查点与恢复(C/R)对容错、突发执行、强化学习回溯分支和安全回滚至关重要。现有方法要么仅保留应用层状态(如聊天记录),遗漏操作系统影响;要么每轮都做完整检查点,成本过高。根本原因是智能体框架与操作系统之间存在语义鸿沟:智能体看到工具调用,但看不到其系统影响;操作系统感知状态变化,却缺乏回合级上下文判断恢复相关性。这导致大量冗余检查点——超过75%的智能体回合不产生可恢复状态。Crab(Agent SandBoxes的检查点与恢复运行时)是一种透明的主机级运行时,无需修改智能体或检查点后端。基于eBPF的检测器分类每轮的系统可见影响,决定检查点粒度;协调器将检查点对齐回合边界,并与LLM等待时间重叠执行;主机级引擎在共置沙箱间调度检查点流量。在命令行密集和代码修复负载下,恢复正确率从8%(仅聊天)提升至100%,检查点流量减少最高达87%,且执行时间仅比无故障情况慢1.9%。
原文摘要 · Abstract (English)
Autonomous agents act through sandboxed containers and microVMs whose state spans filesystems, processes, and runtime artifacts. Checkpoint and restore (C/R) of this state is needed for fault tolerance, spot execution, RL rollout branching, and safe rollback-yet existing approaches fall into two extremes: application-level recovery preserves chat history but misses OS-side effects, while full per-turn checkpointing is correct but too expensive under dense co-location. The root cause is an agent-OS semantic gap: agent frameworks see tool calls but not their OS effects; the OS sees state changes but lacks turn-level context to judge recovery relevance. This gap hides massive sparsity: over 75% of agent turns produce no recovery-relevant state, so most checkpoints are unnecessary. Crab (Checkpoint-and-Restore for Agent SandBoxes) is a transparent host-side runtime that bridges this gap without modifying agents or C/R backends. An eBPF-based inspector classifies each turn's OS-visible effects to decide checkpoint granularity; a coordinator aligns checkpoints with turn boundaries and overlaps C/R with LLM wait time; and a host-scoped engine schedules checkpoint traffic across co-located sandboxes. On shell-intensive and code-repair workloads, Crab raises recovery correctness from 8% (chat-only) to 100%, cuts checkpoint traffic by up to 87%, and stays within 1.9% of fault-free execution time.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。