Data in the ledger
Images, redaction by name and by shape, PII, HIPAA.
Generated from the SDK's own source (
packages/durable-core/README.md) at build; edit there.
The ledger is immutable by design, which makes it the wrong place for anything a person may later have the right to erase. The rule, and what enforces it:
-
Images carry ids and versions, never subject data. A ledger row says
StockReservation 8f3a:SKU-1 { qty: 2, version: 4 }orAppointment a91 { status: "confirmed" }; the patient's name, the customer's address, the card's last four live in your tables, which you can delete. A step'sreadreturns the row it compares; the engine stores that row as the before image, soreadmust project, notselect *. -
No
Pii<T>marker (ADR-0046 §O's amendment, 2026-10-01: not taken). What stands is the projection rule above, held by review, and the redaction policy below, which drops a host's named keys at every depth and a value by its shape (an email address under any key, for one) before anything is stored. -
The redaction policy is yours:
withPolicy(DEFAULT_POLICY, …)adds your secret key names (secretKeys), the names the suffix rule must leave alone (keepKeys), keys dropped at every depth (omitEverywhere), your credential shapes by value (isSecretValue) and your client's shape (isClient) on top of the default: the key names any host has (password,token,secret,apiKey,authorization,cookie,pin, …), any key ending in a secret suffix (secret,token,password,passwd,passphrase,apiKey,privateKey,secretKey,signingKey,accessKey,credential(s): sowebhookSecret,STRIPE_SECRET_KEY,secretAccessKeyandGITHUB_TOKENare secrets with no list naming them) unlesskeepKeysnames it (the core keeps the pagination cursorsnextToken,pageTokenandcontinuationToken), a credential inside a URL's query or userinfo (?token=…andpostgres://u:p@hoststore with the credential blanked in place, the rest byte for byte), an HTTPBearer/Basiccredential by value, and the engine's own client slots (client,admin) dropped at every depth. A redacted step output cannot be replayed from its row (areadstep re-invokes every attempt; a non-read step is refused), so an identifier that ends in a secret suffix is kept by name, never stored redacted. The core knows no vendor's token and no client shape; the host does:redaction: withPolicy(DEFAULT_POLICY, { secretKeys: ["deviceToken", "insuranceMemberId"], keepKeys: ["qrToken"], omitEverywhere: ["patient", "dob"], isSecretValue: (_key, v) => typeof v === "string" && /^shpat_/.test(v), isClient: (v) => typeof (v as { graphql?: unknown })?.graphql === "function", });Redaction by key name is a safety net, not the design; a field that should never be stored should be marked or projected out.
-
Erasure. A subject's data is erased by deleting it from your tables; the ledger keeps the ids and the fact that a write happened. A host that must put subject data into an image (a regulated audit that needs the value itself) brings its own encryption: per-subject envelope encryption with a key the host can destroy (crypto-shredding), the image storing ciphertext and the key id, and
verifyhashing the ciphertext as it hashes any image. —ADR-0046§O records the design (aRedactionPolicy.envelope(subjectId)hook) and its amendment of 2026-10-01 says it is not built: no marker and no hook exist in the packages or the app; what stands is the projection rule and the redaction policy above. -
What
scrubcan and cannot do.scrub(ADR-0041 wave 1) is an operator workflow that rewrites the outputs and logs of runs after a token leaked into them. It cannot touch a ledger image and never will; that is the point of the chain. Since ADR-0076 FP-039 every image walks the redaction policy before the hash, as every other stored copy does, so a key the policy names never reaches a row in clear (the hash over the stored form, a row written before verifying as it was); what the policy admits and still reached the ledger is the envelope key's remedy, not an edit. Its one step is irreversible by declaration (FW-016): the plaintext the rewrite removed is gone, so nothing restores it and a failure after the step lands FAILED, never COMPENSATED. -
Peers receive payloads. A published fact's payload lands in every peer you published it to, redacted by the receiver's policy on landing, visible in that peer's console with its origin, retained 7 days after dispatch. Publish by name per peer and keep subject data out of payloads the same way you keep it out of images.
HIPAA and SOC 2 are answered under this section, not by "compliance is the host's": the controls the engine implements (redaction at every write, an immutable ledger with verification, an actor on every run, no credential crossing apps, a person in the loop for every failed run, no subject data in the ledger) are listed with their evidence on the compliance page. What the library does not give you: a BAA, access control on your console, encryption at rest; those are the host's and the platform's.