Time-travel recording
Capture ordered JSONL frames for nodes, model calls, tools, errors, and checkpoints. Inspect any boundary, compare states, or fork a run.
Recording guideOpen source · Python 3.9–3.13
Record every step. Roll back state and files together. Reuse verified runs without another model call.
pip install ai-agent-vcr
Agents do more than return text.
A trace can explain the failure. Agent VCR gives you a boundary you can actually restore.
One recovery layer
Use the recorder alone, or combine it with workspace rollback, replay, and CI as your agent becomes more consequential.
Capture ordered JSONL frames for nodes, model calls, tools, errors, and checkpoints. Inspect any boundary, compare states, or fork a run.
Recording guideRestore Git-tracked work and eligible pre-existing local files to the same savepoint. Modified or deleted ignored files such as .env come back byte-for-byte.
Return reviewed outputs on a complete identity match, then compare candidate recordings against versioned expectations before merge.
Replay and CI guideThe hard part is the filesystem
Agent VCR creates an isolated Git branch for the transaction and pairs every savepoint with a private local-file snapshot.
.git/vcr-escrow, outside Git objects and VCR recordings..., and resolved-parent symlink escapes are rejected.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
Create a portable execution artifact while the agent runs.
Return memory and workspace state to the selected boundary.
Patch the prompt, context, tool output, code, or policy.
Reuse verified work only when the full identity still matches.
Compare the candidate recording with reviewed expectations in CI.
Meet agents where they run
Start with your current framework. For custom runtimes, map lifecycle events to the recorder boundary.
Clear boundary
Agent VCR can restore recorded state and repository-local files. It cannot undo email, payments, database writes, or arbitrary external APIs. Put consequential tools behind approvals and explicit compensation.
Start local
No hosted account or model key is required for the core recorder, player, workspace rollback, or CI gate.
pip install ai-agent-vcr
python examples/basic_usage.py
vcr tui .vcr/<session-id>.vcr