# AI Harness Durability

Persist workflow progress, state, context checkpoints, leases, and workspace files.

---
Canonical: /harness/durability/
Source: web/src/data/harness-markdown.ts
Format: Markdown for agents
---

Durability is optional and adapter-based.

Use `localDurableExecution({ root })` when a workflow must survive process restarts without adding external infrastructure immediately. The bundle wires a SQLite state store, durable runtime, context checkpoint store, local workspace store, and host-directory sandbox under one root.

## What Gets Persisted

- Session state, messages, runs, and run events.
- Durable workflow checkpoints and leases.
- Context checkpoints written through `ctx.checkpoints`.
- Workspace files for active runs and checkpoint snapshots.

## Production Rule

Checkpoint only deterministic boundaries. External writes should be idempotent and recorded before the workflow commits the next durable checkpoint.
