Temporal Cloud API keys vs mTLS certificates: which should workers use?
Workers and automation that reach a Temporal Cloud namespace should usually authenticate with an API key issued to a service account, because that key carries role assignments that your platform team can manage centrally. Use namespace mTLS certificates when your security policy requires certificate-based workload identity, when your public key infrastructure (PKI) team already issues and rotates client certificates, or when you want a credential that works only for one namespace. An API key proves that a request comes from a specific user or service account and inherits that account's permissions. A client certificate proves possession of a private key that your certificate authority signed for a given namespace. Platform teams usually own service account keys. Security or PKI teams usually own certificates. Confirm in Temporal's current documentation which namespace and role combinations each credential supports on your plan.
The choice affects identity design, not only worker configuration. The Temporal Cloud pricing page lists SAML SSO on pay-as-you-go plans and SCIM provisioning on Enterprise and Mission Critical. SAML covers people signing in to the Temporal Cloud user interface, but automation cannot complete an interactive sign-in, so it needs a credential that outlives any one employee. If you do not have SCIM, group membership and the lifecycle of service accounts and their keys become manual tasks that someone must remember when people join, move teams or leave. Decide who approves each service account, which group maps to which namespace role, and how a departing engineer's access to automation keys is removed before you choose a credential type.
How API keys and mTLS certificates compare
This table compares Temporal Cloud API keys and namespace mTLS certificates across identity, access, rotation, automation and expiry failure. Read each row as a decision point: the right column depends on whether a credential represents a person, a service, or a worker fleet. Confirm role names, certificate limits and expiry settings in your own Temporal Cloud console before you commit to either method.
| Dimension | API keys | mTLS certificates |
|---|---|---|
| Who it represents | A user or a service account, depending on how the key was created | A workload or client that holds a certificate signed for a specific namespace |
| How access is granted | Tied to account and namespace roles assigned in Temporal Cloud RBAC (confirm exact role names in the console) | Scoped to the namespace the certificate was issued for (confirm the namespace-level permissions your plan supports) |
| Rotation | Create a new key, update consumers, then revoke the old key. Confirm whether overlap between keys is supported | Issue a new certificate, roll it out to workers, then retire the old one. Confirm certificate lifetime and CA upload steps in the docs |
| Fit with automation | Works well for CI jobs and tooling that call the API, and can be managed as code (confirm provider support for your key types) | Fits long-running workers that connect to a namespace, where certificate files are mounted from a secrets store |
| Audit trail | Key creation and changes appear in Temporal Cloud audit logs (confirm which events are recorded for your plan) | Certificate issuance and changes are managed outside the console, so record them in your own PKI or secrets tooling |
| What breaks on expiry | Calls fail with authentication errors until consumers receive a valid key; check how long workers retry before alerting | Worker connections fail at handshake once the certificate expires, so check certificate expiry alerts and rollout time before the date |
| Who must act during rotation | Platform or service owner updates secrets for each consumer that uses the key | Platform team coordinates certificate reissue with worker owners and restarts or reloads connections as your SDK requires |
| Questions to confirm with Temporal | Key lifetime options, maximum keys per account, and role permissions for each key type | Certificate lifetime, maximum certificates per namespace, and supported reload behavior in your SDK version |
How workers authenticate to the Temporal Cloud frontend
The flow starts with a worker or automation job that holds either an API key or a namespace mTLS certificate. Each credential reaches the Temporal Cloud frontend on its own path, and the frontend hands the identity to the namespace, where the role check decides what the caller may do. A human signing in through SAML SSO reaches the Cloud UI on a separate path and never sends a machine credential. Check that the machine path and the human path stay apart, and that the trust boundary sits where your network meets the managed service.
Machine credentials and human SSO reach the same role check on separate paths.
Choosing credentials by workload type
Workers that poll task queues run continuously and keep connections to Temporal Cloud open for as long as the process lives. The usual choice is a namespace-scoped mTLS client certificate, or an API key from a service account where your SDK and deployment model support it. Ownership usually sits with the platform team that runs the worker fleet, while application teams own the workflow code that runs on it.
- Rotation on a live fleet: Confirm how your SDK loads a replacement credential without a restart. A plan that needs every worker restarted at once will collide with your change windows, so stage rotation one deployment at a time.
- Blast radius: Decide whether one credential covers every task queue in a namespace or whether each service gets its own identity, since that choice limits what a leaked credential can reach.
- Expiry monitoring: Ask who receives expiry alerts for worker certificates or keys, and whether your monitoring reads the validity dates from the credential itself.
- Secret delivery: Settle where the certificate or key is stored and how pods or hosts receive it without writing it into images, environment dumps or logs.
- Network path: Confirm which connectivity option your workers use, because the path affects firewall rules and how identity checks are applied to traffic.
Before committing, have the worker team rotate a credential on a non-production fleet and record how long the change takes.
Pipelines and scheduled jobs start workflows, send signals or query executions in short bursts. The usual choice is an API key issued to a service account, stored in the CI system's secret store and scoped to the namespaces and actions the job needs. The identity should belong to the team that owns the pipeline, with a named owner recorded in the job's configuration, so that a job's access outlives the engineer who wrote it.
- Scope per job: Give each pipeline a service account limited to the namespaces and operations it uses, and document which permissions each job holds.
- Secret storage and logs: Confirm the CI secret store is encrypted and that masked variables cannot appear in build logs or artifacts.
- Untrusted branches: Decide whether pull requests from forks or unreviewed branches can read the secret at all, since these are a common leak path.
- Retirement: Settle who revokes the key when a pipeline or scheduled job is retired, and how that revocation is recorded.
- Rotation triggers: Ask whether rotation runs on a schedule, after an incident or after a staff change, and who carries it out when the original author has left.
Before the first key goes into a pipeline, check that every scheduled job has a named owner and that you have tested the revocation step on a throwaway key.
Infrastructure as code manages namespaces, users, service accounts and keys declaratively. The provider needs its own credential with enough rights to create and change the identities it manages, so the most common setup is a dedicated provider key held by the pipeline that runs apply. The identity owner is normally the platform or cloud team that owns the state and the change process, and the rotation burden lands on that same team because every generated key flows through code.
- Provider credential privilege: A key that can create and change identities is among the most powerful credentials in the account, so limit who can trigger apply and who can read the pipeline's secret.
- State and generated values: Confirm what the provider writes to state, including any key values it generates, and encrypt and restrict the state backend to match.
- Console drift: Decide whether console edits are blocked or detected on a schedule, so that code stays the source of truth for identities and keys.
- Separate provider credentials: Use distinct provider credentials for non-production and production accounts so a mistake in one cannot change the other.
- Downstream references: Confirm whether rotating a generated key forces an update in the workers and pipelines that consume it, and who makes that change.
Before the pipeline creates any credentials, confirm which identity runs apply, who approves changes, and where state is stored and encrypted.
People who use the Web UI or the CLI should normally sign in as themselves, through single sign-on from the organization's identity provider, rather than holding long-lived keys. The identity owner is the individual, managed through the identity provider, and the rotation burden is light per person because it shifts to role reviews and offboarding. The pricing page lists SAML single sign-on on pay-as-you-go accounts, and SCIM provisioning on the Enterprise and Mission Critical support tiers, so the plan you choose determines which of these controls you can use.
- Sign-in path for the CLI: Confirm how CLI users authenticate and how sessions expire, since command-line use is often where teams find gaps in the sign-in flow.
- SCIM availability: Ask whether SCIM provisioning is included in your agreement before designing automated joiner and leaver steps, because it is not part of every tier.
- Group to role mapping: Decide which identity provider groups map to account and namespace roles, and name the person who reviews those mappings.
- Personal keys in scripts: When someone needs a key for a script, move the key to a service account owned by the team so it survives that person's departure.
- Break-glass access: Settle how an operator gets in when the identity provider is unavailable, and who approves, records and reviews that path.
Before granting production access, confirm who approves role changes and test an offboarding from start to finish.
How API keys tie access to RBAC and service accounts
An API key in Temporal Cloud belongs to either a user or a service account, and the roles granted to that owner decide which actions the key can take in each namespace. The key itself carries no fixed permissions of its own, so the practical question is who owns the key and what that owner is allowed to do. For workers, schedulers and deployment pipelines, a service account is the right owner, because it is not tied to a person who may change teams or leave. A worker that starts and polls workflows usually needs only the namespace-level access to run those tasks, not account administration, so grant the narrowest role that covers its calls. Confirm the current role set and the namespace-level permissions available on your plan before you write the access design, since role names and granularity can change.
A key should not outlive the person or job that created it. Record an owner, a purpose and an expiry date for every key, and tie each key to one workload where possible so that a compromised or retired worker can be revoked without disturbing others. Avoid creating keys from an individual engineer's account for production traffic, because removing that person would break the workers that depend on the key. Plan rotation as a routine task: issue the replacement key, deploy it to the workers, confirm they connect, then revoke the old key. Check how your team's secret store delivers the key to workers so that rotation does not require a manual restart of every process.
Separate production and non-production namespaces with different service accounts and different keys, so that a test workload cannot reach production data by accident. Grant developers read access to production monitoring where needed, but keep write permissions on production namespaces to the service accounts and a small set of named administrators. Illustratively, a staging worker with a key scoped only to a staging namespace cannot start workflows in production even if its configuration is copied by mistake. Document this mapping in the same place as your key inventory, and review it whenever namespaces are added or a team changes ownership.
Setting up credentials for workers and automation
This sequence takes each caller from an inventory to a verified connection, so that every worker and automation job authenticates with the credential type and role it needs, and nothing more. The output is a documented credential map, stored secrets, working workers and a recorded check that out-of-scope access is denied.
Inventory every caller and its namespace
List each worker deployment, CI job, script, Terraform run and human operator that calls Temporal Cloud, along with the namespace and task queues each one uses and the environment it runs in. Include callers that only start workflows, since they need credentials too. Record the owning team for each entry. The output is a table with one row per caller, and you know the step is done when every namespace in the account appears in at least one row.
Choose a credential type for each caller
For each row, decide between a user or service account API key tied to RBAC roles and namespace mTLS certificates. Use the caller's automation needs, who operates it, how it is deployed and how you will rotate its credential as the deciding factors. Mark any caller that needs control plane actions, since those depend on API keys with roles. Record the decision and the reason next to each caller. The step is done when every caller has one type recorded and a named owner.
Create accounts with least-privilege roles
In the Temporal Cloud console, create one service account or user per caller group, not one shared identity for everything. Assign the narrowest namespace and account role that lets the caller do its job, and confirm in your account which roles are offered and what each one permits. For mTLS callers, confirm how certificates are attached to the namespace and who can upload them. The output is a list of accounts with roles, and you know it is done when no account has broader access than its row in the inventory requires.
Issue and store credentials in the secrets manager
Generate the API key or certificate and key pair, and write it straight into the team's secrets manager with a path that names the namespace and caller. Restrict read access to the workload identity that needs it. Confirm in your console whether the key value can be viewed again after creation, so you know whether the secrets manager is the only copy. The output is a secret entry per caller, and you know the step is done when no credential exists in a chat thread, ticket or repository.
Configure workers to read credentials at startup
Point each worker and automation job at its secret through environment variables or a mounted file, so the value never appears in images, manifests or logs. Set the Temporal Cloud namespace address and the authentication method the SDK expects for the chosen type. Check that the worker process starts without printing the secret in its logs. The output is a worker that reads its credential from the secrets store, and you know the step is done when a restart of the worker picks up the stored value without any code change.
Verify the connection and a test workflow
Start a worker on a dedicated test task queue, then run a trivial workflow from the same caller that will use the credential in production. Confirm the workflow completes and appears in the namespace's workflow list in the console. Repeat the check for each credential type in use. The output is a recorded workflow ID per caller, and you know the step is done when each caller completes its test workflow using only its own credential.
Confirm denied access outside the role
From each caller, attempt one action it should not be allowed to perform, such as starting a workflow in a namespace outside its inventory row or running an account-level change with a namespace-only role. Confirm the request is rejected and note the error returned. Then check the audit records in the console to confirm the denial appears where your team expects. The output is a dated test record per caller, and you know the step is done when every denied attempt fails and every expected error is documented.
Rotation practices for each credential type
Both API keys and mTLS certificates expire, leak and outlive the people who created them, so each needs a rotation routine before the first worker connects. The cards below cover the steps for each credential type and the controls that apply to both, including overlap windows, revocation, ownership and audit. Set rotation intervals against your own credential policy and the expiry options available in your Temporal Cloud account.
Rotating API keys
API keys are created for a user or service account and tied to that identity's namespace and account roles. Rotation means creating a new key with the same role scope, deploying it to workers and automation, confirming traffic uses the new key, and then deleting the old one. Confirm in your account whether keys can be set to expire automatically and whether the console or Terraform provider drives creation, so rotation does not drift from your recorded configuration.
Security docsRotating mTLS certificates
Namespace mTLS certificates are issued as client certificate and key pairs, and each one has a validity period that you set or accept at issuance. Rotation means issuing a replacement certificate from your certificate authority process, distributing the new key pair to workers, and checking the expiry date on every worker host. Record the certificate serial and expiry in your inventory, and confirm how your Temporal Cloud account handles certificate expiry notices before the first certificate is issued.
Overlap windows for zero-downtime switches
An overlap window keeps the old and new credential valid together while workers restart onto the new one. For API keys, both keys must remain active until every worker reports the new key in use. For mTLS, the old and new certificates should both be trusted for the same period. Size the window to your worker restart cycle and deployment pipeline, and test the switch in a non-production namespace first.
Revoking after a suspected leak
Treat any key or private key found in a repository, log, ticket or chat as compromised and revoke it immediately rather than waiting for the next scheduled rotation. Issue a replacement, roll it out to workers, then revoke the exposed credential and confirm that calls using it are rejected. Review which namespaces and workflows that identity could start, signal or read during the exposure period, and record the timeline for your incident file.
Ownership and expiry tracking
Every credential needs a named owner, the workload or team it serves, and a next rotation date in your inventory. Without that record, expired certificates and orphaned keys surface as worker outages during a release. Confirm which team receives expiry notifications for each credential, and review the inventory on a schedule that matches your policy. Keep the owner field current when people change roles.
Auditing who created and used credentials
Audit has two parts: who created, changed or deleted a credential, and which identity made calls with it. Control plane changes to accounts, API keys and certificates should appear in Temporal Cloud audit logs, which you can review for forensics. Check that your retention period covers your investigation window, and compare logged key creation events with your rotation records to find unexpected credentials.
What self-hosted Temporal security concepts carry over
Teams that already run self-hosted Temporal should not assume their server security settings apply to Temporal Cloud. Self-hosted Temporal offers mTLS with separate settings for internode and frontend traffic, a ClaimMapper that maps JWT or certificate claims to namespace roles, and an Authorizer plugin that decides what each request may do. The point that matters most is the default: if no Authorizer is configured, self-hosted Temporal uses the default noopAuthorizer, which allows every API request with no authentication or access control. A self-hosted cluster is only as restricted as the Authorizer and ClaimMapper someone has written for it.
Temporal Cloud handles these controls differently. Access to a Cloud account is managed through users, service accounts, API keys and namespace permissions in the Cloud control plane, and the server-side ClaimMapper and Authorizer you configure on a self-hosted cluster are not the mechanism you operate. Before you reuse a self-hosted runbook, confirm with Temporal which controls are fixed by the service, which you configure in the account, and which remain your responsibility in your own workers and clients. Do not copy a noopAuthorizer assumption or a frontend mTLS setting from a self-hosted file into a Cloud design.
For the self-hosted side, read the Temporal self-hosted security documentation directly and treat it as the reference for those controls. Use it to decide what your own cluster must enforce, then use the Cloud documentation and your Temporal account team to confirm what the Cloud service enforces on your behalf. Record the answer for each control so your security review can tell the two environments apart.
Security controls to plan around credentials
Credentials are only as safe as the places they are stored, the people who can change them, and the records that show how they are used. The five controls below map to decisions your team must make before the first worker connects, and each one can be checked in your own environment and confirmed with Temporal for the plan you buy.
Secrets storage in workers
Workers need the credential at runtime to connect, so they are where it is most exposed. Decide where each API key or certificate is loaded from, and keep it out of container images, source repositories, logs and workflow inputs. Check that secrets are injected at startup from a store your platform team controls, and that rotating one does not require rebuilding the worker image. Keep credentials out of images and logs.
Separate credentials by environment
Give development, staging and production their own credentials, tied to their own namespaces, so a leaked development credential should not be able to start or read production workflows. Decide whether each environment uses API keys or certificates, and record which identity runs each worker group. Confirm that no service account is shared across environments and that CI pipelines receive only the credential for the environment they deploy. One credential per environment.
Restrict who can manage credentials
Decide who may create, rotate, delete or view credentials in the Temporal Cloud account, and keep that group small. Separate it from the people who operate workflows day to day, and confirm which roles in your plan allow credential management. Ask who holds account administrator rights, because that person can change what every key and identity is allowed to do. Limit who can mint credentials.
Log and review credential use
Decide how you will tell which credential made a change and when each one was last used. Ask Temporal which audit records it keeps for API key and certificate changes, and whether data plane requests can be traced to a specific credential, since the answer determines what your investigations can prove. Schedule a review of active credentials and remove any with no recent use. Review active credentials on a schedule.
Human access through SSO and SCIM
People who open the Temporal Cloud console should sign in through your identity provider rather than with separate local access. SAML SSO is listed on the pay-as-you-go plan, and SCIM provisioning is listed with the Enterprise and Mission Critical tiers. Decide how leavers lose access, and confirm that deprovisioning removes console access as well as the group-based roles they held. SCIM is an Enterprise-tier feature.
Temporal pricingQuestions teams ask before choosing a credential type
Which credential is better for Temporal Cloud workers, API keys or mTLS certificates?
No single option fits every fleet. Teams that want worker identity to follow their existing user and service account model, with roles assigned in one place, usually start with API keys. Teams with mature certificate authorities, strict certificate policies, or a requirement to bind workload identity to a namespace often prefer mTLS certificates. Decide by answering three questions: how many namespaces and environments you run, whether your identity team already issues and rotates certificates, and whether your secrets platform can deliver credentials to every worker at startup. Confirm the current behavior of each method, including how roles apply, in Temporal's documentation before you commit.
How much does setting up each credential type cost?
Start with the platform cost, which is set by usage and support tiers, not by the credential method. The Temporal pricing page lists pay-as-you-go rates starting at 50 US dollars per million actions and support add-ons starting at 500 US dollars per month for Business. Ask Temporal to confirm whether the credential method changes any plan terms. The setup cost is mostly labor: creating service accounts, scoping roles, building rotation jobs, and connecting workers to your secrets tooling. Setup is one-time, while rotation, access reviews and onboarding of new workloads recur. Costs rise with the number of namespaces, workers, environments and teams that own credentials. Ask for any quote to list those counts and the deliverables in writing.
How long does it take to set up Temporal Cloud credentials?
The duration depends on scope more than on the credential type. One namespace with a single worker group and an existing secrets store is a small task. Many namespaces across several environments, with approval steps and separate teams, takes considerably longer. Plan time for role design, creating one identity per workload, storing credentials in your vault, configuring workers to read them at startup, testing in a non-production namespace, and writing the rotation runbook. mTLS adds certificate issuance and trust chain work if your public key infrastructure is not already in place. No timeline is given here because none was supplied for this topic. Ask for a schedule tied to a defined list of namespaces, workers and environments.
What do we need to provide before setting up Temporal Cloud credentials?
Provide an inventory of namespaces, workers, task queues and environments, with a named owner for each. Document who may create API keys or request certificates, which roles each workload needs, and who approves changes. For mTLS, provide your certificate authority, the issuance policy for client certificates, and the trust chain your workers must load. Share your secrets tooling and how workers currently receive secrets, plus your logging and change control requirements. Confirm your Temporal Cloud plan and whether SAML single sign-on and SCIM apply, since those govern human access. Missing items usually extend discovery and create rework after workers are already deployed.
Can our own team set up Temporal Cloud credentials without a partner?
Yes. A platform or security team with experience in identity and secrets can do this in-house, and Temporal's documentation covers the console and API steps. The difficult parts are rarely the clicks. They are designing roles so each workload receives only what it needs, delivering credentials to workers without exposing them in images, configuration files or logs, and rehearsing rotation before it is needed. You will need an owner for the worker code path and an owner for the secrets platform. DeployOpen can plan and implement this inside your environment under a fixed scope agreed in writing, or review a design your team has already drafted. Base the decision on how often your team has rotated credentials across a live fleet.
How does credential rotation affect a live Temporal worker fleet?
Rotation is safe when the new credential is valid before the old one is retired. Workers hold open connections to Temporal Cloud, so revoking a key too early can stop task polling until workers restart with the replacement. Use an overlap window, roll workers in batches, and watch task queue latency and authentication errors throughout. For API keys, the sequence is to issue a new key, update the secret store, roll workers, and then revoke the old key. For mTLS, add the new client certificate to the trusted set, roll workers, and then retire the old certificate. Rehearse each step in a non-production namespace and confirm the exact sequence against Temporal's current documentation.
Does single sign-on replace API keys or mTLS certificates for workers?
No. Single sign-on governs people who sign in to the Temporal Cloud interface, and the supplied pricing lists SAML SSO as available on every plan. Workers and automation do not sign in through a browser, so they still need API keys or certificates to authenticate their connections. The two layers work together: your identity provider controls who can administer accounts and roles, while the credential type controls which workload can connect. SCIM, which the pricing page lists with the Enterprise and Mission Critical support tiers, automates user provisioning but does not change how workers authenticate. Map identity provider groups to roles for people, and keep worker credentials under their own owners and rotation schedule.
How DeployOpen scopes Temporal Cloud authentication work
DeployOpen starts by mapping which workers, automation and people need to reach each Temporal Cloud namespace and under what identity. We then design the credential model, build it into your deployment and hand over runbooks for rotation and review. Engagements are fixed-scope, with the written scope agreed before work starts.
How we scope
- Inventory every worker, client and automation job that connects to each namespace, with its owner and deployment platform
- Decide per identity whether a user or service account API key or a namespace mTLS certificate fits its runtime and control needs
- Record the agreed scope, deliverables and timeline in writing before any configuration changes begin
How we build
- Configure service accounts, API key roles and namespace permissions so each identity holds only the access its workload needs
- Generate or import namespace certificates, store them in your secret manager and wire workers to load them without plaintext copies
- Test connection failures, expired credentials and permission denials in a non-production namespace before cutover
How we hand over
- Document the credential inventory, owners, scopes and expiry dates in a format your security team can review
- Deliver rotation runbooks for API keys and certificates, including overlap windows that avoid worker downtime
- Walk your operations and security staff through the runbooks and the recovery steps for a revoked or leaked credential
How we support
- Offer ongoing support for credential rotation, access reviews and new namespaces as a retainer
- Retest authentication settings after SSO, Terraform or worker platform changes that touch identity
- Agree the support scope and response expectations in writing, with any paid support tier confirmed with Temporal

