Give your agents an undo button
When an agent goes off the rails, Rewind snaps it back. Checkpoint the filesystem and message history together, let agents take risky shots, and instantly rewind to a clean state — with no memory of the failure.
from rewind_sdk import session, Verifier
with session("agent", workspace="./src", auto_commit=True) as sess:
# Snapshot filesystem + memory before risky work
sess.checkpoint("stable")
sess.auto_rollback(
"exception",
"test_failure",
to="stable",
verifier=Verifier(command="pytest"),
)
# Agent attempts a risky refactor
sess.write_file("auth.py", new_implementation)
try:
sess.run_tests() # FAIL → auto-rollback + RuntimeError
except RuntimeError:
pass # files + message history already at "stable"Transactions for agent execution
Everything you need to build agents that try risky things, fail safely, and resume from a clean state.
Atomic Checkpoints
Save filesystem and message state together as a single, consistent snapshot.
Instant Rollback
Restore to any checkpoint with one call. No cleanup, no state reconciliation.
Auto-Checkpoints
Automatically snapshot before every tool call, write, or command.
Auto-Rollback
Recover from exceptions and test failures without explicit error handling.
Persistent Memory
Full conversation history preserved and restored alongside disk state.
Docker Sandbox
Isolated execution environment backed by OverlayFS for true safety.
Three layers, unified
Rewind stitches together filesystem, framework, and memory into a single transactional execution boundary.
Filesystem Snapshots
Atomic disk isolation
Every write is captured against an immutable baseline. Rolling back discards changes instantly, restoring disk state to any checkpoint atomically.
- Instant snapshots
- Sub-100ms restores
- Zero residual state
Framework Adapter
Native execution hooks
wrap_langgraph() drops into your compiled graph to keep memory synced and auto-rollback on unhandled exceptions. A CLI and MCP server expose the same session operations.
- LangGraph adapter
- MCP server & CLI
- Framework-agnostic core
Memory Truncation
Context window protection
Message history is versioned alongside the filesystem. On rollback, the agent's memory truncates to the checkpoint — eliminating poisoned context from failed attempts.
- Versioned message log
- dict / LangChain / LangGraph
- Poison-free recovery
Drops into your stack
A context manager you already know. Wrap your agent loop and get transactional execution for free.
from rewind_sdk import session, Verifier, wrap_langgraph
sandbox = session("agent_sandbox", workspace="./my_codebase", auto_commit=True)
with sandbox:
sandbox.auto_checkpoint(trigger="before_tool_call")
sandbox.checkpoint("known_good")
sandbox.auto_rollback(
"exception",
"test_failure",
to="known_good",
verifier=Verifier(command="pytest"),
)
@sandbox.tool
def write_file(path: str, content: str) -> str:
sandbox.write_file(path, content)
return f"Wrote to {path}"
safe_agent = wrap_langgraph(base_agent, session=sandbox)
for event in safe_agent.stream({"messages": messages}):
passGive your agents a safety net
Install the SDK, wrap your agent loop, and ship autonomous systems that recover from failure instead of breaking on it.