Durable Wait-token security
A Wait token allows its holder to complete one specific Wait, but does not establish business or tenant permissions. Authenticate the caller and authorize the exact Run, then use completeWait(expectedRunId, token, result) to reject a token belonging to another Run. Protect the token like a password, both in transit and wherever it is stored: the Outbox and any application mapping between external jobs and Wait tokens.
Storage and delivery
Section titled “Storage and delivery”Wait tokens are generated from 256 bits of secure random data. The Wait record stores only the token’s SHA-256 digest; Durable has no Wait-token
signing key or keyring to rotate. An active WAIT_COMMITTED Outbox record retains the raw token until the delivery acknowledgement is committed or the Wait is completed, cancelled, or timed out. Retrying delivery after a lost acknowledgement can extend that retention period, even if the receiver has already received the token. The delivery must not be abandoned while its Wait authority is active.
Clearing the Outbox payload does not revoke a token for an active Wait or erase copies already held by a receiver, in-flight delivery, database backups or transaction logs. Apply access controls and retention policies to those copies as well.
Never put a raw token in logs, metric labels, browser-visible URLs, third-party metadata, or Workbench views.
Exposure response
Section titled “Exposure response”First block unauthorized completion requests at the application entry point, then inspect the committed Wait and Run state. Stopping notification delivery cannot invalidate a token that has already leaked.
If application policy permits cancelling the Run, call cancel(runId). A committed stop request revokes active Waits, even if the Run is not yet terminal. Inspect the returned Run and its termination evidence; an earlier committed stop request is preserved. Cancellation does not undo a committed Wait result, and Effects with unconfirmed results still need reconciliation. An identical canonical completion result can be accepted again only while both the owning Run and the completed Wait record remain queryable. Retention can remove the Wait record before the Run finishes; the token then becomes invalid. A different result is rejected. Do not invent a replacement result or new token for the same Wait occurrence.
The HTTP, RPC, or messaging adapter manages keys used by its request-deduplication, page-token signing, and payload-encryption protocols. Rotate those keys according to the adapter’s policy; doing so does not change a Wait token.
See the operations runbook.