Skip to content
agentvfs ★ GitHub
intermediate 10 minutes

Checkpoint and roll back a task

Checkpoints let an agent take risks safely. Save a rollback point, run the risky command, and restore if it goes wrong — or let policy auto-checkpoint for you.

  1. 1

    Save a checkpoint

    Create a rollback point in the vault before doing anything destructive.

    avfs checkpoint save --vault task-1 pre-migrate
  2. 2

    Run the risky command

    Execute through the boundary. Commands the policy grades risky can auto-checkpoint via allow_with_checkpoint, so this step is often automatic.

    avfs proxy exec --vault task-1 --json -- ./migrate.sh
  3. 3

    Restore if needed

    If the ChangeSummary shows the wrong mutation, snap the workspace back to the checkpoint.

    avfs checkpoint restore --vault task-1 pre-migrate

Forks vs checkpoints

  • A fork isolates a whole task into its own vault — good for parallel experiments.
  • A checkpoint is a rollback point inside one vault — good for undoing a single risky step.
  • Use them together: fork per task, checkpoint before each risky command.

More guides in the index, or read the architecture to see what the boundary is doing.