Crash-safe remediation playbook

Make AI agent quarantine remediation replay-safe

Keep workflow retries from duplicating repair, releasing stale intent, or repeating the customer action that quarantine was meant to protect.

Why replay safety matters

A remediation retry must never become a second business action.

Quarantine protects an intended action during uncertainty. Remediation restores its dependencies. Those are linked operations, not the same operation.

A common failure begins when an automation workflow receives a quarantine event, runs a CRM repair, and reports success. If the workflow crashes after repair but before acknowledgement, the platform retries. Without stable remediation identity and idempotent repair, it may create another CRM record, repeat a backfill, open another ticket, or emit another release request.

The risk grows when teams conflate process completion with action authority. A remediation workflow can finish while backfill remains partial, a cache is stale, customer intent has changed, approval expired, or the original follow-up was canceled. “Workflow succeeded” should trigger verification, not direct resume.

Start with four durable identities: the source incident, the proposed customer action, the remediation request, and each workflow run or attempt. Repeated delivery reuses the same remediation request. A new attempt may execute, but its side effects use stable external keys and converge on one logical repair.

Keep handoffs durable. When the gate creates quarantine, write an outbox event in the same transaction or use equivalent guarantees. When automation accepts a remediation request, persist external identity before starting side effects. When repair completes, publish evidence through an outbox rather than acknowledging first and hoping publication succeeds.

The gate owns release. It verifies destination identity, count, mapping, authority, event time, backfill, and the exact read surface the agent will use. It reevaluates the proposed action and approval. If still appropriate, it issues a short-lived receipt bound to one action.

Replay safety is therefore a system property across state stores, queues, APIs, workflows, and agent workers. This guide defines the identities, transitions, failure boundaries, and tests needed to make the whole loop converge.

The durable model

Four identities, one safe outcome.

Proposed action identity

The exact message, booking, browser submit, or CRM change being protected. It owns intent, approval, quarantine, cancellation, supersession, and release.

Rule: repair never replays this action.

A

Remediation request identity

One logical request to repair dependencies affected by an incident and action scope.

Rule: repeated events reuse the request.

R

Workflow run identity

Each execution attempt has its own run ID while side effects use stable external keys derived from remediation identity.

Verification identity

Each evidence result records mapping, destination, read surface, policy, and observed time without inventing another repair.

Release receipt identity

One scoped, expiring authorization binds verified evidence to one still-current proposed action.

State and retry table

Define what every replay is allowed to do.

Replay pointRequired behaviorForbidden outcome
Quarantine event delivered twiceUpsert one remediation request by stable external keyDuplicate ticket or repair
Crash after ticket createFind existing ticket on retry and attach IDSecond ticket
Crash after CRM upsertRead destination by external key before another writeDuplicate CRM record
Backfill job times outInspect job and data coverage before resubmissionConcurrent duplicate backfill
Completion event delivered twiceUpsert one verification requestDuplicate release request
Completion arrives out of orderApply monotonic remediation lifecycleRegression from verified to running
Gate crashes after verificationReuse stored verification evidence on retryRepeat customer action
Receipt created before queue ackReturn same receipt identity on replayMultiple active releases
Action canceled during repairKeep terminal state; close remediation as no release neededRevive canceled intent
Action supersededReplacement gets new identity and fresh dependenciesTransfer old release silently
Release expires before commitReevaluate dependencies and issue a new receiptUse stale authorization
Worker retries after commitRead committed action receipt and closeRepeat external action
Crash-safe sequence

Persist intent before side effects and evidence before acknowledgement.

Every retry should discover durable state and converge.

Gate

Create quarantine and outbox event atomically

Persist action blocker, incident reference, dependency overlap, remediation key, and outbound event in one transaction. A publisher can retry delivery without recreating quarantine.

Automation

Claim one remediation request

Upsert request by external key before side effects. Runs acquire a lease or compare-and-set transition. Expired leases allow recovery; they do not create a new logical repair.

Repair

Make every external step idempotent

Tickets, CRM upserts, backfills, and notifications use stable external references. Ambiguous responses trigger destination reconciliation before retry.

Verify

Publish evidence through a durable handoff

Store repair result and outbox event together. The gate verifies current destination and agent read state rather than trusting workflow status.

Release

Reevaluate and issue one expiring receipt

Confirm action is not canceled or superseded, approval remains valid, and dependencies are current. The commit worker consumes the receipt idempotently and records the external result.

Failure injection

Crash at every acknowledgement boundary.

Repair succeeded, response lost

Make the CRM upsert succeed and then time out. The retry should search by remediation-derived external key, discover the record, and continue verification without another create.

Check destination cardinality and audit one repair attempt history with one logical result.

Workflow completion duplicated

Deliver completion repeatedly and concurrently. The gate should create one verification job and one eventual release. Duplicate evidence observations may remain in audit but cannot multiply authority.

Cancellation races with release

Cancel the proposed action while verification runs. Use transactional or compare-and-set terminal state so release cannot overwrite cancellation. A replacement action needs new identity.

Commit succeeded, worker crashed

Complete the external customer action and crash before queue acknowledgement. On replay, reconcile by action identity or provider reference and close from the existing receipt instead of acting again.

Also inject expired leases, queue redelivery, unavailable evidence stores, stale read caches, out-of-order callbacks, and partial backfill. Run concurrent workers deliberately. Replay safety that is tested only sequentially is not proven.

Measure duplicate logical repairs, duplicate business actions, time to lease recovery, reconciliation success, verification retries, receipt multiplicity, and terminal-state violations. The target for duplicate customer actions is zero.

Implementation details

Use monotonic state and explicit invariants.

Define terminal states for action and remediation separately. A canceled action remains canceled even if remediation succeeds. A completed remediation can later receive more evidence without becoming running again. Reopened source incidents create a new evaluation or remediation generation instead of mutating history ambiguously.

Protect transitions with database constraints or compare-and-set versions. Unique constraints can enforce one remediation per action, incident, dependency set, and generation; one active release per action; and one destination external key per logical repair. Application checks alone can race.

A lease is not an identity. Leases expire so another worker can continue the same request. Store attempt count, heartbeat, worker reference, and last error for operations, but never derive a new logical remediation merely because the worker changed.

Separate event time from processing time. A backfill can arrive now for an older customer event. Verification should reconstruct business order and determine whether the proposed follow-up is still appropriate. Current ingestion does not make old intent current.

Keep user explanation close to durable state. The person should see what action is blocked, which dependency is uncertain, what repair is running, whether human input is needed, and what evidence allowed release. Replay should update one explanation thread rather than create repeated alerts.

Persistence contract

Store enough state to resume without guessing.

The proposed action record should retain customer scope, purpose, content or change version, required dependencies, approval reference, current state, state version, quarantine reasons, terminal result, and timestamps. The remediation record should retain stable request key, incident and action references, dependency generation, desired repair, lifecycle, lease owner and expiry, attempt count, external side-effect references, last evidence, and outbox state.

Verification should be its own durable result. Store which destination objects, associations, field authorities, mapping version, event window, backfill coverage, and read surfaces were checked. Include observed time and evidence digests. A release can then cite immutable verification results instead of relying on mutable current rows.

The release receipt should contain action identity and version, verified dependency references, policy and mapping versions, actor or system authority, issue and expiration time, exception scope if any, and consumption state. The commit worker uses a unique consumption key so repeated receipt delivery returns the same external action result.

Use an append-only transition or audit table even if current state is materialized for speed. During incident review, teams must reconstruct which observation led to quarantine, which attempt repaired state, which verification cleared each blocker, and why release remained valid at commitment time.

Set operational acceptance criteria before launch: no duplicate logical repairs under concurrent delivery, no duplicate customer action after any injected crash, bounded lease recovery, one active release, monotonic terminal state, and a user explanation that remains coherent across retries. Anything less leaves correctness dependent on timing luck.

Applied workflows

Replay safety protects visible customer actions.

Text messaging

Repair reply projection without ever resending the original message or duplicating follow-up.

Text-message AI assistant
T

Browser operations

Reconcile ambiguous submissions and workflow retries through stable action identity.

Computer-use cache
B

Personal operations

Super can keep one evolving quarantine and release receipt near the user.

Explore Super
S
Launch checklist

Prove convergence before production

Action, incident, remediation, run, verification, and receipt identities are distinct.
Stable external keys protect every side effect.
Quarantine and outbound event persist atomically.
Remediation claims use recoverable leases.
Ambiguous writes reconcile before retry.
Completion evidence publishes durably.
Verification is idempotent and current.
Terminal states resist late events.
Release is unique, scoped, and expiring.
Commit worker reconciles after crash.
Backfill preserves event-time order.
Concurrent worker tests are included.
User explanation updates one thread.
Metrics detect any duplicate logical outcome.
Implementation FAQ

Questions about replay safety

Is queue deduplication enough?

No. A worker can crash after a side effect but before acknowledging the queue. Stable business identity, destination reconciliation, constraints, and idempotent consumers are still required.

What is the difference between a retry and a new remediation?

A retry is another attempt to complete the same logical remediation request. A new remediation represents a new generation, scope, incident reopening, or materially changed dependency set and receives new identity.

Can workflow completion release the action?

It should request verification. The gate confirms destination state, agent read state, current intent, approval, and terminal action status before issuing release.

How are concurrent workers controlled?

Use leases or compare-and-set transitions for ownership plus unique business constraints for invariants. A lease prevents ordinary concurrent work; constraints protect correctness when races still occur.

What if release is created twice?

Enforce one active release per action and release generation with a unique constraint. Replays should return the existing receipt. The commitment worker also records consumption idempotently.

How should users see retries?

Show one remediation with current state, attempt history, last evidence, and next step. Do not send a new user notification for every internal queue retry unless the risk or required user action changes.

Primary references

Technical foundations

These references establish idempotency, integrity, event identity, and observability. The remediation pattern is an applied implementation guide for personal-agent operations.

Retries should converge, not multiply consequences

Repair once. Verify once. Release one action.

Replay-safe remediation lets automation recover aggressively without turning infrastructure uncertainty into duplicate customer behavior.

Explore Super