Keeping sensitive data out of Temporal search attributes and histories

Temporal stores workflow inputs, results, failures and visibility fields in ways that can be read by anyone with access. This page explains which fields leak, which controls keep personal data and secrets out, and what to confirm in your deployment.

On this page

Why sensitive data in Temporal search attributes and histories needs its own rules

A team building durable workflows that touch personal data or credentials needs to know exactly where that data is persisted before the first production workflow runs. In a self-hosted Temporal deployment, workflow inputs, activity results, failure messages, memo fields and search attributes are all stored by the service and can be read by anyone with access to the Web UI, the CLI or the visibility store. Event history holds the inputs and results that the workflow and its activities exchange, so a value passed as a plain argument is recorded in history unless it is protected before it reaches the service. Search attributes and memos are designed to be queried, which makes them the surface most likely to be read by operators who never needed the underlying record.

Payload encryption and visibility hygiene are separate controls, and a team needs both. A custom payload codec can encrypt the payloads stored in event history, but it does not decide what goes into a search attribute, a memo or a failure message, and it does not stop a workflow author from writing an email address into a visibility field. The reverse is also true: keeping values out of visibility does not encrypt the history. The Temporal self-hosted security and visibility documentation describes each of these surfaces, but it does not impose a default rule for which fields are safe, so the team has to write those rules for its own data. Ask the workflow owners to list every input, result, memo and search attribute, and confirm with your security team which fields count as personal data or secrets.

Plan this work during design and again at security review, not after go-live. Before the first production workflow, agree a written rule set that covers allowed search attribute names, a prohibition on personal data and credentials in memos and failure messages, and a review step for new workflow types. During the security review, have a tester or engineer run a workflow with known test values and search the Web UI, the visibility API and the database for those values. Changing a search attribute schema or a stored history later is far harder than setting the rules first, so treat this check as a release gate.

Where workflow data is persisted and who can read it

The diagram starts at the client that starts a workflow, which calls the Temporal frontend. The frontend writes event history and the visibility record to separate stores, and payload codecs apply only to the payload fields. Search attributes and memos pass through the visibility path in plaintext, so they need rules rather than encryption. Check both the history store and the visibility store, and who can open the Web UI and CLI.

Data paths from workflow start to storage and operator reads.

Which fields commonly leak personal data and secrets

Temporal records workflow inputs, activity arguments, results, failures and metadata in its event history and visibility store, and several of those fields are readable by anyone with Web UI or CLI access. The cards below list the fields teams most often populate with sensitive values, the risk each one carries, and the control category that addresses it.

Workflow inputs and results

Workflow start arguments and return values are written to event history as payloads. A customer record, account identifier or document reference passed as a workflow input is stored in that history for the life of the execution and any retention period that follows. Payload codecs are the main control here, since they encrypt the payload before it is persisted. Check whether every input and result type passes through the codec, and whether operators without decryption rights can still see the history.

Security docs

Activity inputs and outputs

Activities often carry the most sensitive data because they call external systems with tokens, personal details and bank identifiers. Their arguments and return values are recorded in history as well, so a field that is safe in a workflow can still leak once it is passed to an activity. Payload codec coverage should match the activity boundary, and teams should confirm that activity results containing personal data are minimized before they return to the workflow.

Failure messages and stack traces

Exceptions thrown inside activities or workflows often include the failing request, a rejected value or a connection string, and that text is stored with the failure in history. Error handling is the control category here: catch exceptions at the boundary, replace raw values with stable error codes, and avoid logging full request bodies in the error path. Test failure paths deliberately, because they are exercised less often than success paths.

Memo fields

Memos attach free-form metadata to a workflow execution and are returned in workflow description responses. Because they are not designed for indexing, teams sometimes place a name, email address or reference that they would never put in a search attribute. Treat memos as visible metadata, apply the same naming and value rules used for search attributes, and review memo writes in code review so that personal data does not enter through a convenience field.

Custom search attributes

Custom search attributes are indexed and stored in plaintext in the visibility store, and they are queryable by anyone who can list workflows. A customer email used as a filter key is therefore exposed to every principal with visibility access. Naming and value rules should define an allowlist of attribute names, use opaque identifiers instead of personal values, and confirm with your team which attribute types are approved for each namespace.

Logs and exported histories

Event history can leave the cluster through worker logs, observability pipelines, exports and backups, and an encrypted payload stays encrypted only while the codec is applied consistently. Decrypted payloads shown in a codec server, or logged by a worker that decodes them for debugging, create a second copy. Ask where histories are exported, who can read those exports, and whether logging configuration redacts payload fields.

Which control fits each kind of data

Payload codecs transform the data that workflow inputs, activity inputs and results carry before it is stored in event history. A custom codec can encrypt those payloads with a key your team controls, so someone with read access to the persistence database sees ciphertext instead of personal data or credentials. The protection covers payloads only. It does not change what the Temporal server indexes for visibility, so values placed in search attributes, memos or failure text remain readable through other paths.

  • Covered data: workflow and activity inputs and outputs, as long as the codec is applied to them by every worker and client.
  • Not covered: search attributes, memo fields, workflow IDs, task queue names and failure messages, which the server handles outside the payload path.
  • Key handling: the codec depends on keys loaded into your environment, so key rotation and per-environment keys must be planned before data is written.
  • Operator access: people reading histories in the Web UI or CLI need a codec server, which adds its own access and authentication decisions.
  • Version behavior: confirm in the server and SDK versions you run how codecs are configured and that every language SDK in use applies the same codec.

Before go-live, check that a history sample from the persistence store contains ciphertext for every field you classified as sensitive.

Options for keeping sensitive values out of visibility and history

This table compares five ways to keep personal data and secrets out of Temporal search attributes, memos, failure messages and event history. Read each row for what it protects, what it still exposes, and which effort driver sets the cost, because most teams need more than one option.

OptionWhat it protectsWhat it leaves exposedEffort driverWhen it fits
Pass references instead of valuesKeeps raw personal data and secrets out of workflow inputs and activity results, so history stores only IDs such as a customer referenceLookup keys and any metadata that can identify a person; the external store must be secured separatelyNumber of call sites that pass data, and how many activities need to fetch records themselvesMost workflows, as the default design for personal data
Payload codec with a codec serverEncrypts payload bytes in event history so the stored data is not readable as plaintext in the databasePayload sizes, workflow and activity types, task queues, and any search attributes or memos that are not encryptedKey management setup, codec server hosting and access control, and testing of decryption for operatorsPayloads that must stay in workflow inputs or results and need encryption at rest in history
Search attribute allowlist with reviewLimits which fields are indexed in visibility, so personal values are not stored in the visibility storeAny value that is allowed onto the list, plus the workflow ID and run ID that visibility always recordsSize of the allowlist, the review step for new attributes, and checks in code before upsertsTeams that use visibility queries and need a fixed, reviewed set of indexed fields
Memo restrictionsBlocks free-form notes that often receive contact details or ticket text from developersMemo contents that are permitted, which are stored and returned in plaintext unless encrypted by a codecNumber of memo writers and how strictly the team enforces a schema or type ruleWorkflows where operators read memos in the Web UI and a short, typed set of fields is enough
Failure message sanitizationStops exception text with account numbers, tokens or payloads from reaching failure details in history and logsError type, exception class and any fields that were not removed, so tests must confirm what remainsNumber of error paths, shared error-wrapping code and tests that inspect failure outputAny activity that calls a third-party API or database and can echo request data in errors

How to classify fields and put controls in place

This sequence takes every value Temporal records and decides whether it can stay plain, must be removed, or needs encryption, then proves the controls hold with canary values. The output is a field inventory, a set of search attribute and codec rules, and test evidence you can show a security review.

  1. Inventory every workflow data path

    List each workflow input, activity input, workflow and activity result, memo, search attribute, signal payload and failure path, and record which workflow type and namespace each belongs to. Include values that flow in from upstream systems and values that workflow code derives from them. Done means every path appears in one table with an owner from the application team, so nothing is left to be found later in the Web UI.

  2. Classify each field as personal, secret or neutral

    Label every inventoried field as personal data, secret (credentials, tokens, keys, signed URLs), or neutral (identifiers that carry no meaning outside your systems, status codes, counts). Have the data owner and your privacy or compliance lead confirm the personal data labels, since the classification drives every later decision. Done means each row has one label and a named reviewer.

  3. Minimize and replace sensitive values with references

    For each personal or secret field, decide whether the workflow needs the value at all. Where it does, pass an opaque reference such as an internal record ID or a secret manager path, and let activities fetch the value at execution time. Where it does not, drop the field before it reaches the workflow. Done means no secret remains in a workflow or activity input, and each personal field has a recorded reason for its presence.

  4. Configure the payload codec and key handling

    For fields that must stay in histories, put them behind a custom payload codec that encrypts payloads before they are sent to the Temporal Service, and load keys from your own key management in each environment. Confirm that the codec covers the payload types your SDK uses, and that a codec server, if you host one for operators, runs inside your network with authentication. Done means a raw history read through the CLI shows ciphertext for the test fields, and the key source is documented.

  5. Write search attribute naming and value rules

    Define which search attributes are allowed, their names and types, and the value formats they may hold. Search attributes are indexed and stored in the visibility store as plaintext, and the Temporal visibility docs describe the store options you run, so only neutral identifiers, statuses and timestamps should qualify. Write the rule set as a short document and enforce it in code review and in the workflow start helper. Done means every registered search attribute maps to an approved neutral field.

  6. Sanitize memo fields and failure messages

    Review memo contents and every error path, including application errors, activity failure messages, stack traces and retry details, since these are stored in histories and can echo input values. Wrap or redact messages before they are raised, strip personal values from error details, and keep full diagnostic data in your logging system with restricted access. Done means a forced failure with a canary value produces an error message that contains no canary.

  7. Test with canary values across every surface

    Write a test workflow that carries unique canary strings in personal, secret and neutral fields, runs through success, retry, failure and cancellation, and then search the results. Inspect the Web UI, the CLI history output, the search attribute listing and the visibility store directly, and confirm that no canary appears in plaintext where the rules forbid it. Done means a written test record lists each surface, the canary values checked and the pass result, and you rerun it after every codec, schema or workflow change.

Questions teams ask before hiring help with Temporal data handling

Is a payload codec alone enough to keep personal data out of Temporal?

No. A payload codec encrypts workflow and activity payloads before they are stored in event history, but it does not cover everything Temporal writes. Search attributes and memo fields are stored for visibility queries, and failure messages, stack traces and log lines can carry values too. A codec protects the payload bytes, so the remaining work is deciding which fields should never reach those other places in the first place. Confirm with your team which fields are sent through search attributes, memos and error text, since a codec does not change any of them.

Can search attributes hold personal data safely?

Generally, search attributes should hold only the values operators need to filter and find workflows, such as a status, a tenant identifier or a case type, and never names, account numbers or contact details. Visibility records live in the advanced visibility store, which is separate from the payload encryption path, so a value written there is readable by anyone who can query that store. Confirm the exact visibility backend you run (Elasticsearch, OpenSearch, MySQL, PostgreSQL or SQLite), who can read it and how long records are retained, because those settings decide the exposure.

How much effort does a field inventory take, and what drives it?

The effort depends mainly on how many workflow and activity types exist, how many distinct payload shapes they use, and how many teams own them. Each input, output, signal, query, memo, search attribute and error message needs a classification: keep, encrypt, replace with an identifier or drop. Teams with many older workflows, shared libraries or unowned code paths usually need more time because the inventory must reach code that nobody currently owns. Ask any partner to scope the inventory by workflow type and to state which sources they will review.

Can our own team do this work internally?

Often yes, provided the team has someone who knows the workflow code, someone who understands the data classification rules and time to review both. The work is mostly reading code and agreeing rules, not new infrastructure, so the main risks are gaps in ownership and rules nobody enforces after launch. An internal team usually needs a written rule set, a review step in code review and a test that fails when a sensitive field reaches a search attribute. Partners are often used to supply an outside review of the inventory and the test design. DeployOpen plans and delivers this work in client infrastructure under a written scope, so the team can compare its own capacity against that scope.

What does the work need from engineers and security staff?

Engineers need to supply workflow and activity code, examples of real payload shapes with sensitive values removed, and the search attribute and memo calls already in use. Security and privacy staff need to agree the classification rules, the retention periods for visibility and history data, and who may read the Web UI and CLI output. Platform staff need to confirm the visibility backend, the access paths to it and the logging settings. Ask for a named owner on each side before the work starts, because decisions about what counts as personal data cannot be made by the engineering team alone.

How do codec keys interact with rotation?

Payload encryption keys need a rotation plan that keeps older histories readable. A codec must be able to decrypt payloads written under previous keys while new payloads use the current key, so rotation adds key versions rather than replacing one key in place. The plan must also cover where keys are loaded from, who can read them and what happens to a Codec Server during a rotation. Confirm the key store, the rotation procedure and the test that proves an old workflow still replays before any key change goes live.

Which Temporal security pages should we read before scoping this work?

Start with the self-hosted security documentation, which describes the payload encryption path through custom codecs and the Codec Server, and with the visibility documentation, which explains which store holds search attributes. Those two references set the boundaries for this topic. Then review how your team controls access to the Web UI and CLI, since operators reading decoded values is a common exposure route. Confirm any version-specific behavior against the release you run, because Temporal Server releases change between minor lines.

Security and operational checks after the controls are live

Once redaction rules and codecs are in place, the remaining risk sits in who can read what, what gets exported, and what changes over time. These cards cover the access, review and testing routines that keep sensitive values out of Temporal visibility and history after launch.

Restrict who reads the Web UI and CLI

Temporal's default Authorizer is noopAuthorizer, which allows every API request, so anyone who can reach the frontend can read execution inputs, results and failure text. Map operator roles through a ClaimMapper and Authorizer so read access to workflow history is granted per namespace and per role. Check that support staff who need status but not payloads cannot open full histories. Confirm the exact role model with the Authorizer topic before writing policy.

Temporal security docs

Control codec server access

If operators read decrypted payloads through a Codec Server, that server becomes a decryption point for every history it serves. Require authentication for each caller, restrict CORS to the Web UI origin, and log who decrypted which workflow. Keep the codec keys in your environment and not in the server image. Review these controls against the codec and key management topics, and confirm how your chosen codec server handles access logging.

Handle logs and exports carefully

Visibility data, workflow histories and failure messages often flow into application logs, metrics labels, tracing spans and data exports. A search attribute that was safe in the database can still leak once it reaches a log aggregator or an export file. Audit logging config in workers and the Temporal services, and confirm that any export or archive copies carry the same redaction as the source. Ask each log and export destination which retention and access rules apply to it.

Review new search attributes in change control

Every new custom search attribute, memo field or upsert is a new place where a value can be stored in plaintext. Require a named reviewer to approve each addition, recording the attribute name, its type, the source field and whether the value is an identifier or personal data. Keep a registry of approved attributes next to the workflow code so changes are visible in code review. Ask the security team which attribute classes need a privacy review before they are added.

Test failure messages in CI

Failure messages, error details and stack traces are recorded in history and may echo inputs such as account numbers or tokens. Add tests to the workflow and activity suites that raise representative failures with realistic-looking test data and assert that the recorded message contains no sensitive fields. Run these checks on every change that touches error handling. Confirm with your SDK team which error types carry payload data in your language.

Audit visibility stores for leaked data

Controls added after launch do not clean up data already written. Run a scheduled query against the advanced visibility store, using the attribute names in your registry, to look for patterns that match personal data or secrets in indexed fields. Treat any hit as an incident with a defined owner, then correct the source and plan removal from the store. Confirm with your Elasticsearch, OpenSearch or SQL visibility vendor how deletion and re-indexing work in your version.

When to minimize data and when to encrypt it

Start by asking whether the sensitive value needs to enter Temporal at all. Remove personal data from workflow arguments wherever a reference or lookup key will do. Pass a customer ID, case number or record key, and let the activity fetch the personal fields from the system of record at the moment it needs them. This keeps names, account numbers and contact details out of event history, which Temporal stores for every execution and which many operators can read through the Web UI and CLI. Note that activity inputs and results are still recorded in history, so a lookup key only helps if the activity itself does not return the sensitive data as its result.

Where a sensitive value must travel through a workflow, such as a payment token that a later step needs, encrypt it with a payload codec before it is stored. The codec is the only control here that protects the stored payload itself, so it belongs in the design from the start. Keep anything that must be searched, such as a status, region or tenant identifier, in a form that does not reveal the underlying value. Use an opaque code or a hashed identifier in search attributes instead of the raw value, and confirm with your security team that the hashing approach meets their standard for low-entropy identifiers.

The boundaries come from your own compliance and privacy teams, not from Temporal. Ask them how long workflow histories and visibility records may be retained, who may read them, and which data classes are prohibited in them. Those answers decide which fields are removed, which are encrypted and which may appear in plain text, and they should be written down before the first workflow type is designed. Confirm with your team how retention is applied to the visibility store and to histories, since the two are configured and purged separately in your deployment.

How DeployOpen works on this

DeployOpen starts by inventorying what your Temporal workflows write into visibility and event history, then sets rules for search attributes, memo fields and failure messages. The controls are built and tested inside infrastructure you control, and the handover leaves your team with the rules, code and evidence to keep them working.

How we scope

  • Inventory every workflow type, search attribute, memo field and failure message that reaches visibility or event history.
  • Classify each field by sensitivity with your privacy, security and compliance owners before any code changes.
  • Agree the written scope, deliverables and timeline in writing before work starts, as engagements are fixed-scope.

How we build

  • Write search attribute allowlists and workflow input rules that keep personal data and secrets out of plaintext visibility.
  • Design and implement a payload codec for sensitive payloads, with keys held in your environment and not in code.
  • Test each rule with sample workflows, including failure paths, and confirm what visibility and history actually store.

How we hand over

  • Document each search attribute, memo and codec decision, with the data class it protects and the owner who approves changes.
  • Provide the test cases and replay checks your engineers can rerun after workflow code or SDK changes.
  • Walk your platform and security engineers through the controls so they can review new workflows against the same rules.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the initial handover.
  • Retest visibility and history after Temporal Server upgrades and new workflow releases, and update the rules where needed.
  • Confirm with your team which access paths to the Web UI and CLI can see decoded payloads before support begins.

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.