Isolating teams and environments with Temporal namespaces: when you need it
A self-hosted Temporal Service shared by several teams or environments needs a decision about where its security boundaries sit before workers and clients are connected. In Temporal terms, a namespace is the unit that groups workflow executions, their histories and task queues, and it is the level at which Temporal's security model assigns access. Teams usually need separate namespaces when their workflows hold different data, when a production workload must not be reachable from a development client, or when a team's changes should not be able to affect another team's executions. Separating development, staging and production into distinct namespaces is a common starting point, and a service boundary inside a single environment can justify its own namespace as well.
A namespace on its own does not protect anything. The default setup has no Authorizer configured, which means the noopAuthorizer allows every API request with no authentication or access control, so any client that can reach the frontend can read or change any namespace. Enforcement starts only when a ClaimMapper maps JWT or certificate claims to namespace roles and an Authorizer checks those roles on each request. Before you rely on the boundary, confirm in the self-hosted security documentation which roles and permissions the Authorizer model supports in your server version, and test that a credential scoped to one namespace is refused in another.
Plan the namespace map with the credential map in the same review. Each worker and client identity should have a documented list of namespaces and roles it needs, with production credentials kept separate from non-production ones. Confirm with your own threat model whether a shared database, the shared frontend and the operators who can change server configuration fall inside your trust boundary, because a namespace does not isolate those. Record which controls cover each gap, such as network restrictions, payload encryption with per-environment keys, and separate database credentials, so that auditors and your own security team can see where the boundary actually ends.
Where to draw namespace boundaries
Each pattern trades isolation against operating cost, and the right choice depends on what a compromised credential or a faulty deployment could reach. Read the cards together, because most teams combine two of them, such as one namespace per service in each environment.
One namespace per environment
Production, staging and development each get their own namespace, so workflow histories, workers and credentials for one environment cannot reach another. This is the baseline most regulated teams start from, because it keeps test traffic and test data out of production history. The cost is more namespaces to create, configure and monitor, and every environment needs its own credentials and role mappings. Check which settings, such as retention, are set per namespace in your deployment, so each environment is configured on purpose.
Self-hosted security docsOne namespace per service
Each bounded context or service gets its own namespace, so a worker credential compromised in one service reaches only that service's workflows. This pattern also makes ownership clear for on-call, quotas and upgrades. The cost is that calls between services need explicit design, and you must confirm which cross-namespace features your SDK and Temporal Server version support before you commit to the layout. Expect more role mappings to maintain as services are added or retired.
One namespace per team or tenant
Teams or customer tenants that must not see each other's executions get separate namespaces, so their histories, visibility records and workers are kept apart. This is the strongest logical separation short of separate clusters, and it suits multi-tenant products where one tenant's data must never appear in another's search results. The cost is capacity planning per tenant, per-namespace limits to confirm with your scaling design, and a growing number of namespaces that each need monitoring and access reviews.
Shared namespace for low-risk workloads
Internal, low-sensitivity workflows such as routine housekeeping or report generation can share one namespace, which keeps administration light. Teams accept that any worker or client with access to the namespace can see every workflow in it. Before using this pattern, confirm that no workflow in the namespace carries personal data or secrets in its inputs, results or search attributes, and that its authorization roles are no broader than necessary.
Environment and service combined
Many teams split first by environment, then by service, so a production namespace exists for each service that needs one. This gives the strongest practical boundary without losing separation between development and production. The cost is the largest namespace count of any pattern, which increases credential, role and monitoring work. Write down the naming convention and the owner of each namespace before creating them, so the inventory stays accurate during audits and upgrades.
How namespace-scoped credentials and Authorizer roles work
Namespace roles do not exist until you configure them. Self-hosted Temporal uses the default noopAuthorizer when no Authorizer is set, and that default allows every API request with no authentication or access control. Any credential that reaches the frontend can start, signal or read workflows in any namespace, so a namespace boundary on its own is only a naming convention. Before you rely on namespaces for isolation, confirm that your deployment sets an Authorizer and a ClaimMapper, and that unauthenticated calls to the frontend are rejected in a test environment.
The ClaimMapper turns the identity a caller presents into roles on specific namespaces. Temporal's self-hosted security documentation describes mapping JWT claims or certificate claims to those roles, and the Authorizer then decides whether each API call is allowed. Map identities so that a worker for one service receives a worker-level role on its own namespace only, and a client that starts workflows receives a client-level role there. Keep operator and administrator roles in a small, separately issued group. Confirm the exact claim fields and role names against the security documentation for your server version, because the mapping format is version-specific.
Grant each worker and client only the namespace roles its job requires, and review that list whenever a service is added, split or retired. A worker that polls one task queue in the orders namespace has no reason to hold rights in the payments namespace. Scoping works best when each service has its own identity, which keeps revocation narrow when one credential leaks. Testing that each role can do what it should and nothing more is a separate piece of work covered in the Authorizer and ClaimMapper topic, and the penetration testing topic covers how testers check namespace permissions from the outside.
How namespaces, roles and workers fit together
The request starts at a worker or client that presents a JWT or a client certificate. The ClaimMapper turns those claims into namespace roles, and the Authorizer decides, per namespace, whether the call is allowed. Only then does the frontend route it to that namespace's workflows. Check that the Authorizer is configured, since without one Temporal allows every request, and that the internal services and persistence sit behind the frontend trust boundary.
Requests pass the ClaimMapper and Authorizer at the frontend before reaching internal services and persistence.
Namespace layouts for dev, staging and production
When one production environment carries regulated data, the simplest defensible layout keeps that environment's namespaces apart from every other environment and limits who can reach them. Start by listing which workflows touch regulated data, then give those workflows their own namespace so that access reviews, retention rules and incident scope map to a single boundary. Non-regulated workflows can share a separate namespace in the same cluster, provided the Authorizer rules keep their credentials out of the regulated namespace.
- Dedicated regulated namespace: One namespace per regulated service, not one namespace for the whole company.
- Worker credentials scoped to one namespace: Each worker deployment holds a certificate or token that only grants access to its own namespace.
- Operator access split from worker access: Engineers who run the Web UI or CLI get a read-only or break-glass role, separate from the worker identities.
- No shared admin credential: Administrative roles are issued per person through your identity provider, so access can be revoked and logged individually.
- Separate payload keys per namespace: Where your key management plan allows, a namespace holds its own encryption key.
Confirm the layout with your compliance team and assessor before build, because the required boundary depends on the controls you are scoped to and how your evidence is collected.
A shared Temporal service for several product teams usually needs one namespace per team and service, plus a clear rule for who may create new namespaces. The platform team owns the cluster, the persistence layer and the Authorizer configuration, while each application team owns the workflows and workers in its namespace. This split keeps one team's workload, retention settings and credentials from affecting another team's data. Cross-namespace workflows need explicit design, since namespaces do not share their workflow histories.
- Namespace per team and service: Name namespaces so the owner and purpose are obvious in logs and audit records.
- Platform team holds namespace administration: Only the platform group can create or delete namespaces and change retention.
- Application teams hold worker roles only: Each team's identities can start, signal and query workflows in its own namespace and nothing else.
- Shared services in a dedicated namespace: Common utilities, such as notification or reconciliation workflows, get their own namespace with narrowly granted callers.
- Naming and ownership register: Keep a current list mapping each namespace to its owner, data class and credential holders.
Confirm with each team lead which workflows exchange data across namespaces, since those flows need the most careful review.
Development and sandbox setups prioritize speed for engineers, but they should not reuse production credentials or copy production data into a shared namespace. A common pattern is one namespace per developer or per feature branch in a non-production cluster, with synthetic data only. Because the default self-hosted configuration allows every API request, a sandbox that has no Authorizer must stay off any network that can reach real systems. Treat the sandbox as a place to test Authorizer and ClaimMapper rules before they reach staging and production.
- Namespace per developer or branch: Short-lived namespaces are easy to delete and limit the blast radius of a bad workflow.
- Synthetic data only: Engineers use generated test payloads, and production exports never land in these namespaces.
- Developer credentials with limited roles: Developers get write access to their own namespaces and no access to staging or production.
- Authorizer enabled even in development: Test the same role mappings used in production, so permission problems surface early.
- Network isolation from production: The sandbox cluster and its database should not share networks with production systems.
Confirm with your security team that the sandbox cannot reach production data stores or identity systems, and document how namespaces are removed when a project ends.
What Temporal namespaces do not isolate
A namespace is a logical boundary inside one Temporal Service, not a separate deployment. Namespaces do not give each team its own persistence database, its own History or Matching services, or its own Web UI. Every namespace on a self-hosted cluster shares the same persistence store and the same visibility store, so a database compromise, a backup exposure or a misconfigured database role reaches all namespaces at once. Before you design around namespaces, confirm with your database team which store holds each environment's data and who can read it, using the persistence and visibility documentation as the reference for which stores your chosen backend uses.
Namespaces also do not encrypt payloads or keep sensitive data out of histories. Workflow inputs, activity results, failure messages, search attributes and memo fields are stored by the server in the form your workers send them, and the namespace label does not change that. Payload protection comes from custom codecs and the keys behind them, which are covered in the sibling topics on encryption key management and running a Codec Server. Search attributes and histories are covered in the topic on keeping sensitive data out of them. Network exposure is a separate control as well: a namespace restricts what an authenticated caller can do, but it does not stop an unauthenticated caller from reaching the frontend if the Authorizer is still the default noopAuthorizer, or if the frontend is reachable from the public internet. Work through the sibling topic on restricting network exposure before you treat namespace boundaries as a security control.
Setting up namespace boundaries step by step
This sequence turns a namespace model agreed with security and compliance into working boundaries, with role mappings and per-namespace credentials that are tested to fail across namespaces. Each step closes with a check so the team knows the boundary holds before workers and clients go live.
Agree the namespace model with security and compliance
Security, compliance and platform engineering agree which namespaces will exist, such as one per environment and service, and which teams own each one. The output is a written table listing each namespace, its owner, its data classification and the roles allowed to act in it. Compliance should confirm that the table matches how they will assess separation. Done means every workflow type and task queue in the platform maps to exactly one namespace in the table.
Create the namespaces from the agreed layout
The platform team creates each namespace from the agreed table using the Temporal CLI or the admin tooling for the Temporal Server version you run. Confirm the exact namespace creation commands, retention settings and config keys against the self-hosted deployment docs for your chosen version before running them, because these change between releases. Done means a list of namespaces on the server matches the table one for one, with no extra or default namespaces left unreviewed.
Enable the ClaimMapper and Authorizer
Replace the default no-authorization setup by configuring a ClaimMapper that reads JWT or certificate claims and an Authorizer that decides whether each call is allowed. Confirm the plugin names and configuration keys in the security documentation for your version, since the default settings allow every request until this step is complete. Done means an unauthenticated request to the frontend is rejected, which you can test with a plain gRPC call from a host outside the trusted network.
Map identity claims to namespace roles
Write the role mappings that connect each identity provider group or certificate subject to a role in a specific namespace. Keep the mapping as code in version control so reviewers can see who can read, write or administer each namespace. Give worker identities only the roles their task queues need, and keep administrative roles separate from application roles. Done means each mapping in the file traces back to a row in the namespace table from step one, and no identity is mapped to more than one production namespace.
Issue per-namespace credentials to workers and clients
Issue a separate credential to each worker deployment and client application for each namespace it uses, using the identity provider or certificate authority already in your environment. Store the credentials in your secrets manager and inject them at runtime rather than baking them into images. Record the owner, namespace and expiry date for each credential. Done means every running worker and client authenticates with a credential whose claims name only its own namespace.
Test that a credential is denied in another namespace
Using a credential issued for one namespace, attempt a start, query and list operation against a different namespace, and attempt an admin operation with an application role. Each attempt should be rejected by the Authorizer, and the rejection should appear in the server logs with the caller identity. Repeat with a credential from a different environment to confirm environment separation. Done means every cross-namespace attempt in the test matrix is denied and recorded, and the matrix is saved with the deployment evidence.
Confirm and record the boundary for review
Compare the live configuration against the namespace table and the role mappings, then rerun the denial tests after any change to the Temporal Server version or the identity provider. Store the table, mappings, test results and log samples where your compliance team can retrieve them. Note what namespaces do not isolate, such as shared database, shared visibility store and shared server processes, so the risk owner accepts those limits explicitly. Done means the review record lists the boundary, the evidence and the accepted limits, signed off by the owners named in step one.
Namespace options and when each fits
This table compares four ways to draw Temporal namespace boundaries: one namespace per environment, one per service, one per team, and one shared namespace separated by roles. Read each column against your own risk model, since the strongest isolation usually brings the most namespaces, credentials and configuration to maintain. The main takeaway is that namespaces separate workflow histories and task queues, but the boundary only holds if authorization is configured for each namespace.
| Layout | Isolation strength | Operational overhead and credentials | When it fits |
|---|---|---|---|
| Per environment | Strong separation between production and non-production histories; a development mistake cannot touch production workflows | Moderate: one set of namespace credentials and roles per environment; retention and settings managed per namespace | Most regulated deployments, as a baseline layer that keeps production data apart from test and staging |
| Per service | Strong separation between business services; one service's workflows and task queues stay out of another's view | Higher: more namespaces, role mappings and worker credentials to rotate and audit as services grow | Teams with distinct data sensitivity or ownership per service, such as payments separated from reporting |
| Per team | Moderate: suits ownership boundaries, but a team namespace can still hold services with different sensitivity | Moderate: fewer namespaces, but team-level roles must be scoped carefully to avoid broad access | Organizations where team ownership is clear and services within a team share a similar risk level |
| Shared namespace with roles | Weakest: isolation depends entirely on Authorizer and ClaimMapper rules, and any misconfiguration exposes all workflows | Lowest namespace count, but role design, testing and review become the main ongoing work | Small, low-sensitivity deployments or early prototypes that will be split before production |
| Combined layers (environment, then service) | Strongest practical option: each service gets its own namespace inside each environment | Highest: the namespace count equals environments multiplied by services, so provisioning and credential automation are required | Regulated estates that need a clear evidence trail per service and per environment |
Security and operational considerations
Namespaces only isolate what the Authorizer, credentials and network layout enforce around them. The five controls below cover the settings that most often leave a self-hosted Temporal deployment open, and each one should be checked again after a server upgrade.
Keep the Authorizer enabled everywhere
Self-hosted Temporal runs the noopAuthorizer when no Authorizer is configured, and that default allows every API request with no authentication or access control. A namespace boundary means nothing if the default is still active in staging, a test cluster or a new environment built from an old template. Confirm the Authorizer and ClaimMapper are set in every environment's configuration, and treat a missing setting as a failed deployment check.
Self-hosted security docsScope and rotate worker credentials
Each worker process should hold credentials for one namespace and the task queues it serves, not a shared admin certificate or token. Issue credentials per service and per environment, then set a rotation schedule that your team can actually execute. Ask your team to show how a leaked worker credential would be revoked without restarting the frontend or affecting other namespaces.
Audit role assignments regularly
The ClaimMapper turns JWT or certificate claims into namespace roles, so the mapping rules are where access is actually granted. Over time, temporary grants for debugging or migrations tend to stay in place. Export the current claim-to-role mapping on a fixed schedule, compare it with the approved access model, and record who changed each mapping and why.
Keep Temporal services off the internet
Temporal's deployment guidance says the services should run on hosts that are not reachable from the public internet, with access limited to trusted internal networks. Place the frontend, internode traffic and the persistence database on private networks, and expose only what workers and approved operators need. Verify this from outside your network, not only from the configuration files.
Deployment docsReview namespace permissions during upgrades
Upgrades change the server, its schema and sometimes the Helm chart, so a working permission model can drift after one. Before each upgrade, record the current Authorizer, ClaimMapper and namespace settings, then test each role against the new version in a non-production environment. Upgrade one minor version at a time, moving to the latest patch of the current minor first, and confirm that namespace access still matches the approved model afterward.
- Upgrade step size
- 1 minor
Namespace isolation questions buyers ask
How much effort does a Temporal namespace model take to design and build?
The effort comes mostly from design decisions and the access rules that follow from them, not from creating namespaces themselves. Creating a namespace is a short administrative task, but deciding how many to run, how they map to environments and services, and how each one connects to identity and roles takes longer. Effort rises with the number of teams, the number of environments, and whether workflows must be separated by data sensitivity. Ask any partner to break the quote into design, authorization build, testing per role, and documentation, so you can see which parts repeat as you add services.
What does the work need from our own team?
Your team needs to supply decisions and access to systems that only your organization can provide. The main inputs are your list of teams, services, and environments, the roles each group should hold, and your identity provider, since roles are usually mapped from JWT or certificate claims. You will also need someone who can approve the mapping of people to roles and review who holds administrative rights. Plan for these reviews to run alongside the build, because they often set the pace more than the configuration does.
Is one Temporal namespace per environment enough for security?
One namespace per environment is a reasonable starting point, but it rarely isolates everything a security team cares about. Environment separation keeps production workflows apart from staging and development, which matters for credentials and data. Teams that run several services with different owners or data classes often also need a namespace per service or per sensitivity level. Whether that split is enough depends on who must not see whose workflows, and on whether your Authorizer roles enforce the boundary. Confirm the rule with your security team before building it.
Do we need a partner to set up namespace isolation?
You can do it yourself if your team already runs self-hosted Temporal, understands the Authorizer and ClaimMapper, and has time to test permissions for each role. A partner is most useful when the isolation model must be reviewed by compliance or security teams, or when the rules must be tested before production use. Most DeployOpen engagements are fixed-scope, so the scope, deliverables, and timeline are agreed in writing before work starts, and a quote follows from that written scope. Ask any provider to state whether testing per role and documentation for auditors are included.
How does namespace isolation relate to encryption and network controls?
Namespaces control which identities can reach which workflows through the API, but they do not replace the other controls. Transport encryption with mTLS protects traffic between services, payload encryption protects the data inside histories, and network restrictions limit which hosts can reach the frontend at all. Each layer covers a different risk, so a weakness in one is not fixed by another. Plan the four together, and confirm with your team which layer is responsible for each threat in your risk register.
What does a namespace boundary not protect against?
A namespace is a logical boundary inside one Temporal Service, so it does not isolate the underlying infrastructure. Workflows in different namespaces still share the same server processes, persistence database, and visibility store, which means an operator with database or host access can read data across them. Namespaces also do not stop personal data or secrets from appearing in search attributes, failure messages, or histories. Ask your team to confirm who holds infrastructure and database access, because that question sets the real isolation limit.
What drives the ongoing cost of namespace isolation?
Most of the recurring cost comes from role maintenance, not from running namespaces. Each new team, service, or environment adds mappings, and each change to the identity provider or permissions may require retesting. The cost also depends on whether you self-host or use Temporal Cloud, since Temporal documents pricing for Cloud on its pricing page, while self-hosted costs are your own infrastructure and staff time. When requesting a quote, ask what is one-time design work, what is ongoing support, and how changes to roles will be handled.
How DeployOpen scopes Temporal namespace isolation
DeployOpen starts namespace isolation work with a written scope agreed before any configuration changes. The scope names the Temporal Service being protected, the environments and services that will get their own namespaces, the teams and workers that need access, and the security questions the client needs answered. Because the scope is written down, the client knows which namespace layout, role mapping and test cases are included and which are left to their own team. The engagement stays inside the client's own infrastructure, so the Temporal Service, its persistence and visibility stores, and the identity provider that issues the client's tokens all remain under their control.
The design work covers the namespace layout and the role mapping that connects identities to it. DeployOpen works with the client's platform and security teams to decide where each namespace boundary falls, which identities or certificate claims map to which roles in each namespace, and how the Authorizer and ClaimMapper are configured so that a worker or operator credential can act only in the namespaces it was issued for. Clients should confirm with their own identity team which claims their provider emits and how often tokens are rotated, since those details shape the mapping. The result is a reviewable design document that the client's security team can challenge before anything is deployed.
Verification is where the design is proven. DeployOpen tests that a credential scoped to one namespace is denied reads, writes and workflow starts in another, and that the default noopAuthorizer is no longer in effect on the frontend. Each denied case is recorded with the request, the expected result and the observed result. Where the client wants independent confirmation, DeployOpen can retest the same cases through its security testing service, with findings and fixes delivered in a report. Clients should ask for the verification scope and retest terms in the written agreement, because the number of cases and the retest schedule are set in that scope and are not fixed in advance.

