Encryption key management for Temporal payloads

Temporal payload encryption depends on keys you load, separate and rotate yourself. This page explains the key decisions, the rotation pattern that keeps old histories readable, and what to confirm before go-live.

On this page

Encryption key management for Temporal payloads starts with who holds the keys

The team that needs encrypted workflow payloads in self-hosted Temporal has to answer one question first: who can read them. Temporal stores workflow inputs, results and failure details in its event history, and anyone with access to the persistence database, the Web UI or the CLI can see that data unless it is encrypted before it leaves the worker. Temporal does not manage those keys for you. Payload encryption runs through custom codecs that your team writes or configures, and a codec server that your team hosts so that authorized operators can decode payloads in the Web UI and CLI. Key generation, storage, access, and rotation are therefore the customer's responsibility, and the design has to be settled before the first production workflow starts.

You need this design when regulated data passes through workflow inputs, results or failures. Typical examples include personal identifiers in a payment or onboarding workflow, patient references in a clinical process, or account details passed between services. Search attributes and memo fields are not covered by payload encryption in the same way, so they need their own rules, which are covered in a sibling topic. Before you start, confirm which data classes your workflows carry, which teams need to read decoded values, and whether your security and compliance teams expect keys to sit under a separate control from the Temporal cluster itself. Those answers decide the key hierarchy, the number of keys, and who is named as a key custodian.

Key storage and scoping options compared

This table compares where Temporal payload encryption keys can live and how widely each key is shared across environments and namespaces. Read each row as a trade-off: the option that is easiest to run often gives the widest blast radius if a key leaks. Confirm the licensing and tier of any external secrets manager before you commit to it.

OptionWhen it fitsMain trade-offWhat to confirm
Key file loaded at worker startSmall teams with one environment and a simple rotation windowKeys sit on worker hosts, so anyone who can read those hosts can read payloads; rotation means redeploying workersWho can read the file system and container images on worker hosts
Environment variable loaded at worker startContainerized workers where the platform already injects secretsValues can appear in process listings, crash dumps and deployment logs if handled carelesslyWhether your orchestrator masks the variable in logs and restricts who can inspect pods
Key fetched from an external secrets managerRegulated teams that need central access logging and separation of dutiesAdds a runtime dependency and an access path to manage; a secrets manager outage can stop workers that need keys at startupWhether OpenBao fits your needs (covered in its own pillar) and that Vault licensing and tiers are confirmed before choosing it
One key per environmentTeams that keep development, staging and production apart and want a simple modelA leaked production key exposes every namespace in that environmentWhether each environment has its own worker deployment and secrets path
One key per namespaceOrganizations that separate teams or data classes through namespacesMore keys to create, rotate and track; mistakes in key-to-namespace mapping are easy to makeOwnership of each key and a written mapping of namespace to key ID
Single shared key across all environmentsProofs of concept or throwaway test clusters onlyAny exposure affects all histories, and rotation touches every environment at onceWhether this key is ever reused outside a test setting

Choosing a symmetric AES algorithm and key size

Payload encryption for Temporal is only as strong as the cipher, mode and key handling behind it. The decisions below set what the codec does with every payload and what your security and compliance reviewers will ask about. No algorithm details were supplied for this topic, so each choice must be confirmed against the codec library your SDK uses and your compliance baseline before anything is encrypted.

Authenticated mode versus raw AES

Confirm whether the codec uses an authenticated mode such as AES-GCM, which detects tampered ciphertext, or an unauthenticated mode that only hides content. Unauthenticated encryption is the decision reviewers most often reject. Check the exact mode name in the library documentation, since a codec that calls itself AES may not authenticate the payload at all.

Key length and its trade-offs

Ask which AES key sizes the codec accepts and which one is configured by default. Longer keys raise the cost of brute force but add no practical protection against key theft, which is the more likely failure. Your compliance baseline may name the permitted key sizes, so record the chosen size and the reason for it in the design document.

Nonce uniqueness and handling

Authenticated modes depend on a nonce that is never reused under the same key. Confirm whether the library generates nonces randomly, from a counter, or leaves the choice to the caller, and how many encryptions one key can safely perform under that scheme. Nonce reuse can expose plaintext and break authentication, so test it explicitly in the codec test suite.

Key derivation and key material format

Decide whether the key is a random value stored as-is or derived from a passphrase or a master secret with a key derivation function. Random keys of the required length are simpler to reason about. If derivation is used, confirm the function, its parameters and how the salt is stored, and ensure the derivation inputs never appear in Temporal histories or logs.

FIPS-validated implementation requirement

Establish early whether your organization must use a FIPS 140 validated cryptographic module. Many SDK codec libraries are not validated by default, so the answer may force a different library or runtime. Ask the library maintainers for their validation status in writing, and do not assume that an AES cipher is compliant simply because the algorithm is standard.

Confirm against the SDK and baseline

Verify each decision against the codec implementation in the SDK your teams use, because the same algorithm name can map to different defaults across languages. Record the library version, mode, key size and nonce scheme in the design record, and have your security and compliance leads sign off on that record before any production workflow carries encrypted payloads.

Rotating keys without breaking old histories

This sequence lets you move Temporal payload encryption to a new key while every existing workflow history stays readable, and it ends with the old key retired only after nothing still depends on it.

  1. Inventory every decrypting consumer and key location

    Your platform or security team lists every component that encrypts or decrypts Temporal payloads: SDK data converters in each worker service, any codec server, and any tooling that reads histories through the CLI or Web UI. For each one, record where the current key is loaded from and who owns the deployment. The step is done when the list matches your deployment inventory and each owner confirms they can change that component's key configuration. Gaps found here are the most common cause of decode failures later.

  2. Add the new key as decrypt-capable everywhere

    Your engineers update the codec configuration in every worker and codec server so both the old and new keys are loaded for decryption, while encryption still uses the old key. Keys are loaded locally from your secret store and never written into workflow code or Temporal configuration. Roll the change out through your normal deployment pipeline. The step closes when every worker instance and codec server reports healthy after restart and a test workflow with a payload encrypted under the old key completes.

  3. Confirm workers decode both keys

    Your team runs a test workflow whose input is encrypted under the old key and another whose input is encrypted under the new key, then checks that each completes and that the codec server renders both payloads in the Web UI and CLI. Run the checks against each environment and namespace that uses the codec. Record the results and the worker versions tested. Do not switch encryption until every consuming component has passed both decode checks, because a worker that lacks the new key will fail on any history written after the switch.

  4. Switch encryption to the new key

    Your team changes the encrypting key in the data converter so new workflow inputs, results and signals are written with the new key, while the old key stays loaded for decryption. Apply the change to one namespace or environment first where your process allows, then widen it. The step is done when new executions show payloads encrypted under the new key in your test environment and production workflows complete without decode errors in worker logs.

  5. Keep the old key until histories have aged out

    The old key remains loaded in every decrypting component for as long as any workflow that used it can still be open, replayed, or viewed. Your team confirms the retention window configured for each namespace, checks for open executions that predate the switch, and reviews how long completed histories remain visible. Retention values and history lengths must be confirmed in your own environment with your Temporal operators, because they vary by deployment. The step closes when a query for executions started before the switch returns none that are still open.

  6. Verify no remaining payloads use the old key

    Before removing the old key, your team runs a sample of open and recently closed executions through a replay or read test and confirms that any payload still encrypted under the old key decodes through the retained key. Keep the evidence, including the list of namespaces, the sample size and the test results, in your change record. The step is done when the review shows the old key is no longer needed for any execution still in retention.

  7. Retire the old key and record the change

    Once the retention check passes, your team removes the old key from decrypt configuration on all workers and codec servers, redeploys, and reruns the decode tests on the new key only. The old key is then revoked or archived according to your key management policy, with the change ticket linking the verification evidence. The step closes when the retired key is absent from all configurations, every test workflow still completes, and the record shows who approved each stage.

How keys move between workers, the codec server and Temporal Server

The diagram starts where workflow code and workers encode payloads with the current key, so Temporal Server only ever stores ciphertext. The codec server and operator tools decode with keys loaded from a trust boundary you control, never from Temporal Server itself. The rotation branch adds a new key alongside the old one, and the old key is retired only after no history still needs it. Check that every decoding path reads from the same boundary and that retirement is gated on history checks.

Workers encode payloads, Temporal Server stores ciphertext, and keys stay in your trust boundary.

Separating keys per environment and namespace

Use a separate payload encryption key for each environment, at minimum development, test and production, and consider a further key per namespace where data classes or owning teams differ. The reason is blast radius: if a key leaks from a development worker or a CI job, it should not decrypt production workflow inputs, activity results or failure details. Separate keys also let you rotate or revoke one environment without touching the others, and they make it clear in an audit which key protected which history. Keep the key identifiers visible in your key register so that operators can match a workflow's codec configuration to the environment it runs in.

Namespaces are a separate control from encryption and they do not isolate data by themselves. Temporal namespaces scope workflow executions, task queues and, when an Authorizer is configured, the roles a caller holds, but a worker or codec server that has been given a key for one namespace may still be able to read payloads it is connected to by other routes. Confirm in your own design which credentials can reach which namespaces, which codec server instances hold which keys, and whether any shared Web UI or CLI profile can decrypt payloads from several environments at once. Pair each key boundary with a namespace boundary and with Authorizer roles that grant only the operations each team needs, then test that a developer identity cannot read production payloads through the codec server.

Questions buyers ask before outsourcing key management

What drives the cost of outsourcing Temporal payload key management?

The cost follows the written scope: how many namespaces and environments need keys, whether a codec server is in scope, how many workers and languages must be changed, and how many rotation cycles are planned. Part of the work is one-time (design, key loading, codec wiring, rehearsed rotation). Part recurs (rotation runs, reviews, key audits, and any retainer for ongoing support). A quote should split these lines and state who holds the key store and who runs each rotation. No public price is published, so ask for a fixed-scope quote with those components itemized.

How far ahead should a key rollout be planned in our change calendar?

Plan it as a multi-step change, not a single event. A rollout usually needs a design decision, a staging rehearsal against a copy of production histories, a window for workers to load the new codec, and a retirement step after old executions finish. The total calendar time depends on how long your longest workflows run and how many worker fleets must be redeployed. Ask for a timeline in the written scope that names each change window and the rollback point, and confirm the freeze periods your change board enforces.

What does our security and platform team have to provide?

Expect to provide named owners, access to the key store or KMS account, network paths from workers and the codec server to that store, and a decision on who may decrypt payloads in the Web UI and CLI. The platform team supplies deployment pipelines, worker images, secret injection and namespace names. Security reviews the key hierarchy, access logs and break-glass procedure. Confirm these responsibilities in the scope before work starts so that approvals are not discovered late.

Can an internal team manage Temporal payload keys without a partner?

Yes, if the team has engineers who know the Temporal SDK codec interface, can run a worker rollout safely, and can operate the key store. The hard parts are rotation without breaking old histories and proving that every worker and codec server uses the same key set during the transition. Many teams do this successfully in-house. A partner is most useful when the team lacks that cross-skilled capacity or needs an independent rehearsal before production. Compare the internal effort against the written scope, not against an assumed price.

What does DeployOpen deliver for key management work?

DeployOpen delivers work in your own infrastructure: a documented key hierarchy with separate keys per environment or namespace where the design calls for it, codec wiring for the workers and any codec server in scope, a tested rotation procedure that keeps older histories readable, and the runbook your team operates afterward. Deliverables are fixed in a written scope before work starts. DeployOpen does not issue audit reports or certifications, so evidence is prepared for your assessors to review.

Which symmetric encryption algorithm should we choose for Temporal payloads?

Choose a well-reviewed symmetric algorithm such as AES in an authenticated mode, and confirm the exact choice with your cryptography owners and your SDK's codec examples. Key length, nonce handling and key derivation matter more than the brand of the algorithm. Keys should be generated by a cryptographically secure source, loaded at worker start from a store your team controls, and never written into workflow code, images or histories. Verify these choices in the design review before any production data is encrypted.

How do we rotate keys without breaking old workflow histories?

Keep every key version that can still decrypt an open or retained execution, and make the codec able to decrypt with any of them while encrypting only with the current one. Rotation then becomes a staged rollout: add the new key to all workers and codec servers, switch encryption, and retire the old key only after no execution depends on it. Confirm retention periods with your Temporal namespace settings, and rehearse the full cycle on a copy of realistic histories before production.

Security risks to design out of key handling

Payload encryption protects history only as long as the keys stay controlled. The five risks below are the places where keys most often leak, drift or become impossible to account for. Each one is a design decision to make before the first encrypted workflow runs, not a cleanup task for later.

Keys leaking into logs and dumps

A key loaded from an environment variable can appear in container inspection output, crash dumps, debug logs, CI job logs and process listings. Once a key is copied into any of these, encryption of stored payloads gives less protection than the team expects. Check that worker startup code never logs its configuration, that environment dumps are restricted, and that secrets scanning runs on build output. Illustrative example: a verbose startup log prints the full worker config, including the key, into a log store readable by many engineers.

Codec server with broad operator access

A codec server decrypts payloads so operators can read workflow inputs and results in the Web UI and CLI. If any signed-in user can reach it, the codec server becomes a decryption service for the whole organization. Decide which roles may decrypt which namespaces, and treat the codec server as a sensitive service with its own access rules. Confirm how its access is authenticated and logged before operators are onboarded. Authorization design for this is covered in the Temporal security group pages on the codec server, mTLS and Authorizer.

Keys stored beside the Temporal configuration

When the encryption key sits in the same repository, Helm values file or configuration bundle as the Temporal server settings, anyone who can read the deployment configuration can also read the key. This is a common result of treating key material as ordinary configuration. Keep keys in a dedicated secrets store, load them only into the worker or codec process that needs them, and confirm that access to the secrets store is separate from access to the Temporal configuration repository.

Missing audit trail for key use

Encryption keys are used silently every time a payload is written or read, so a compromised key or an unauthorized decryption leaves no obvious trace. Ask which component records key retrieval, which identity requested it, and where those records are kept. Self-hosted Temporal does not decide this for you, so the logging of the codec server, the secrets store and the worker runtime must be designed and tested together.

Workers unable to decrypt history after rotation

Rotation replaces the active key, but workflow histories written under the old key still exist and must be read during replay and by the Web UI. A worker that receives only the new key will fail on older executions, sometimes long after the rotation looked successful. Keep retired keys available for decryption until no open or retained history depends on them, and test replay of an execution written under the previous key before retiring it.

Setting up payload keys with verification checks

This sequence takes payload encryption from a key scope decision to a documented rotation runbook, with a check at each step so that encrypted payloads round-trip in a test namespace and only permitted operators can read decrypted data.

  1. Decide the key scope per namespace

    The security lead and the Temporal platform owner decide which boundaries get their own key: typically one key per environment, and where a namespace holds data from a different owner or classification, one key per namespace. Record the mapping from namespace to key identifier in the design document, along with who approves key creation. The check is a written table that lists every production and non-production namespace and its key identifier, with no namespace left without an owner. Confirm the scope against your namespace design before continuing.

  2. Choose the symmetric algorithm profile

    The security engineer selects one symmetric algorithm profile, such as AES in an authenticated mode, and documents the key length, nonce or IV handling and the library used by the codec. Confirm the chosen profile against your organization's cryptography standard and any assessor requirements before implementation. The check is a signed decision record that names the algorithm, key length and implementation, and that is reviewed by someone outside the team that wrote the codec.

  3. Provision keys in the chosen store

    The platform team generates the keys in the store your organization already operates, such as a secrets manager or a cloud key service, and grants read access only to the workers and codec server identities that need each key. Keep key material out of workflow code, container images and the Temporal database. The check is an access listing for each key showing that only the named service identities can read it, and that a test identity without grants is denied.

  4. Wire the codec into workers and the codec server

    The developers configure the payload codec to load the key for the namespace at startup, and deploy the same codec configuration to every worker and to the codec server that serves the Web UI and CLI. Verify that each process reads the key identifier it was assigned and fails closed when a key is missing. The check is a startup log or test run in each process that confirms the loaded key identifier matches the namespace mapping from step one.

  5. Test round trips with sample payloads

    In a non-production namespace, the developers run a test workflow with sample payloads that contain clearly fake personal and secret-like values, then read the stored event history directly from the persistence layer. Check that the stored bytes are not readable, then decode the same payload through the codec path and confirm the original values return unchanged. The check is a recorded test run showing encrypted history, successful decryption and a failed decryption attempt with a wrong key.

  6. Verify operator visibility of decrypted data

    The security team signs in as each operator role and opens the Web UI and CLI with and without access to the codec server. Confirm that only roles approved for the namespace see decrypted payloads, that the codec server requires authentication, and that access is logged. The check is a table of role, namespace, expected view and observed view, with every mismatch resolved before production use. Confirm the exact codec server authentication and access logging options against the current Temporal documentation for your version.

  7. Document the rotation runbook

    The platform team writes the rotation runbook covering how a new key is added alongside the old one, how workers begin encrypting with the new key, how decryption continues for histories that still reference the old key, and when the old key can be retired. Include the rollback steps and the owner for each action. The check is a tabletop walkthrough in the non-production namespace, where the team rotates the key, replays an older workflow and confirms that it still decrypts, and the walkthrough result is filed with the runbook.

Choosing a key store under changing Vault licensing

Teams often keep Temporal payload keys in a secrets manager instead of on disk, and HashiCorp Vault is a common choice. Before you build on it, confirm the license. HashiCorp announced in August 2023 that future releases would move from MPL-2.0 to the Business Source License 1.1, and the Vault LICENSE file applies that license to Vault 1.15.0 and later. The license names IBM as licensor, bars competitive hosted or embedded offerings, and converts each version to MPL-2.0 four years after publication. IBM completed its acquisition of HashiCorp on February 27, 2025, so the licensor and commercial terms now sit within IBM's portfolio. Have legal review the license text against your intended use, including whether you run Vault inside a product you ship.

Vault is also offered in several editions, and the features you need decide which one fits. Vault Enterprise features such as performance replication, HSM support through PKCS#11, seal wrapping, FIPS compliance and namespaces require a license applied to the cluster. HashiCorp does not publish Vault Enterprise prices, so ask for a written quote tied to the features you named. Confirm which Vault version, edition and storage backend your key-loading method supports, because HashiCorp lists integrated storage (Raft) and Consul as the officially supported backends.

OpenBao is an MPL-2.0 community fork of Vault, managed by the Linux Foundation's OpenSSF, and it is a credible alternative if license terms are a blocker. Its migration guide, however, was tested only against Vault 1.14.1 Community Edition, not Vault Enterprise or later releases. If you run Enterprise features or a newer Vault, treat the migration path as unproven and run your own test. Before committing, confirm three things in writing: the license that governs your intended use, the features your payload key workflow depends on in each candidate product, and the support model you will have when a key-loading issue hits production.

How DeployOpen scopes and delivers Temporal key management

DeployOpen plans and builds payload encryption for self-hosted Temporal inside infrastructure you control. The work covers key selection, local key loading, separation between environments or namespaces, and a rotation procedure that keeps existing histories readable. Engagements are fixed-scope, with the codec, key handling and evidence agreed in writing before build work starts.

How we scope

  • Inventory which workflows, namespaces and environments carry sensitive payloads and need a codec.
  • Agree the key boundaries in writing, such as one key set per environment or per namespace.
  • Record who may hold key material, where keys are loaded from, and who approves a rotation.

How we build

  • Implement the payload codec and key loading so keys stay in your environment, not in workflow code.
  • Test encryption and decryption across workers, replay and a sample of old histories before release.
  • Rehearse a key rotation in a non-production namespace, confirming that previously encrypted histories still decode.

How we hand over

  • Deliver the written configuration, codec design, key ownership map and rotation runbook.
  • Document the verification steps and the evidence you can give an internal or external reviewer.
  • Walk your platform and security teams through rotation, recovery and access review procedures.

How we support

  • Offer ongoing support as a retainer for key rotation cycles, upgrades and codec changes.
  • Retest encryption behavior after Temporal Server upgrades, SDK changes or new namespaces are added.
  • Confirm with your key management provider and Temporal release notes before each planned change.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.