Introduction
ReplaySafe is the Execution Memory & Side-Effect Control Plane for AI agents. It ensures that every external operation - payments, emails, API calls, database writes - happens exactly once, even when agents retry, crash, or run concurrently.
Why ReplaySafe?
AI agents are inherently unreliable. They retry on failure, run concurrently, and operate on external systems that don't guarantee idempotency. ReplaySafe gives your agents a durable execution ledger - a complete record of every side effect, its lifecycle state, and provider-native proof of what actually happened.
Core Capabilities
01. Execution Ledger
Full state machine lifecycle: INTENDED → EXECUTING → COMMITTED → VERIFIED. Timestamps at every transition. Provider receipts stored as proof. The system always knows what happened.
02. Provider Verification
When an operation times out, ReplaySafe asks the provider (Stripe, SendGrid, GitHub) if it actually succeeded. Built-in verifiers for 8+ providers with automatic failure classification.
03. Recovery Engine
guard.resume() computes a minimal safe continuation plan - skip verified effects, retry transient failures, block semantic failures for human approval. No more restarting from scratch.
Quick Start
Install the SDK and wrap your first side effect in under 5 minutes. ReplaySafe operates on an execution memory model - every side effect is tracked from intent to verification.
pnpm add @replaysafe/guard-sdk# Then wrap your side effect:
const result = await guard.effect({
type: 'STRIPE_OPERATION',
target: 'stripe-charge',
input: { orderId, amount: 2999 },
execute: () => stripe.charges.create({ amount: 2999, currency: 'usd' }),
receipt: (r) => ({ chargeId: r.id }),
})