Open source · Python 3.9–3.13

The undo button for coding agents.

Undo anything your coding agent did — even rm -rf. Record and rewind your own agents. Replay verified runs without another model call.

$pip install ai-agent-vcr
~/code/myapp airbag armed
01
Snapshottaken before every agent tool call
saved
02
Agent runs rm -rfcode, .env and .git deleted
failed
03
vcr undofiles, .env and git history back
restored
04
Replay and gateverified identity hit, then Agent CI
passed
Result The fix ships. The failed world does not.

Agents do more than return text.

They edit repositories, call tools, mutate state, and fail halfway through.

A trace can explain the failure. Agent VCR gives you a boundary you can actually restore.

One recovery layer

From “what happened?” to “put it back.”

Use the recorder alone, or combine it with workspace rollback, replay, and CI as your agent becomes more consequential.

02

Record + roll back your own agents

Capture every step as JSONL frames, jump to any one, fork and resume — and roll back state and files together with ACID savepoints, .env included.

Recording and rollback guides
03

Ghost Replay + Agent CI

Return reviewed outputs on a complete identity match, then compare candidate recordings against versioned expectations before merge.

Replay and CI guide

The hard part is the filesystem

Rollback means the files, too.

Agent VCR creates an isolated Git branch for the transaction and pairs every savepoint with a private local-file snapshot.

  • Tracked contentRestored from Git savepoint commits.
  • Ignored and untracked contentEligible pre-existing files are escrowed under .git/vcr-escrow, outside Git objects and VCR recordings.
  • Safe final commitChanges made after the last savepoint are finalized on the transaction branch before it is merged.
  • Fail-closed pathsAbsolute paths, .., and resolved-parent symlink escapes are rejected.
Read the transaction contract
workspace.py
from agent_vcr.integrations.openhands import ACIDWorkspace

tx = ACIDWorkspace("/repo")
tx.begin("task-42")

tx.savepoint(
    {"plan": "refactor auth"},
    node_name="planner",
)

# Agent edits code and local files.
tx.rollback(to_frame_index=0)

# Or accept all final work, including
# changes after the last savepoint.
tx.commit()

A tighter debugging loop

Recover the run. Prove the fix.

  1. 1
    Record

    Create a portable execution artifact while the agent runs.

  2. 2
    Rewind

    Return memory and workspace state to the selected boundary.

  3. 3
    Correct

    Patch the prompt, context, tool output, code, or policy.

  4. 4
    Replay

    Reuse verified work only when the full identity still matches.

  5. 5
    Gate

    Compare the candidate recording with reviewed expectations in CI.

Meet agents where they run

Native adapters. A small core API.

Start with your current framework. For custom runtimes, map lifecycle events to the recorder boundary.

Clear boundary

Local recovery, not magic.

Agent VCR restores your project — files, .env, local SQLite and .git — and recorded agent state. It cannot undo email, payments, server-side database writes, or cloud deletions; the airbag spots those commands and makes a human confirm first.

Start local

Add an undo boundary in minutes.

No hosted account or model key is required for the core recorder, player, workspace rollback, or CI gate.

pip install ai-agent-vcr

vcr airbag install
python examples/basic_usage.py
vcr tui .vcr/<session-id>.vcr