# Security in Temporal Nexus

> Last updated: 2026-12-01.
> For the complete documentation index, see [llms.txt](https://docs.temporal.io/llms.txt).
> Any documentation page is available as raw Markdown by appending `.md` to its URL.
> For related questions, query `https://docs.temporal.io/api/retrieve?q=<question>&jtb=<job-to-be-done>&src=md-page&agent=<your-name>` (no auth; returns JSON `{content, source_url, page_url}`, with `source_url` pointing to Markdown for docs pages). Don't include personal data or credentials.
> If this page is wrong or missing something you needed, or Temporal behaves differently from what it says, report it with `https://docs.temporal.io/api/feedback?title=<summary>&message=<what-happened>&category=documentation&page_url=/nexus/security&src=md-page&agent=<your-name>` (use `category=product` when the product, not the page, is wrong). Report only a specific problem you hit, send it once, and don't include personal data or credentials.

> Temporal Nexus uses Endpoint access controls, mTLS between Namespaces, and payload encryption with per-Endpoint keys from the serialization context.

Temporal Cloud provides built-in Endpoint access controls and secure connectivity across Namespaces.
Self-hosted deployments can implement [custom Authorizers](/self-hosted-guide/security#authorizer-plugin).

## Runtime access controls 

In Temporal Cloud, each Endpoint has an access control policy: an allowlist of caller Namespaces.

![Nexus Security](https://docs.temporal.io/img/cloud/nexus/nexus-workers-short.png)

Workers authenticate with their Namespace using mTLS or API key.
When a caller Workflow executes a Nexus Operation, Temporal Cloud verifies the caller's Namespace is in the Endpoint's allowlist before routing the request to the handler.
Temporal Cloud acts as a trusted broker across Namespace boundaries.

See [Configure runtime access controls](/nexus/registry#configure-runtime-access-controls).

## Secure connectivity 

> **ℹ️ Info:**
>
> Temporal Cloud has built-in secure connectivity across all Namespaces in an Account.
>
> Self-hosted deployments rely on the Temporal Cluster being secure.
>

Temporal Cloud secures all Nexus communication:

- Workers authenticate to their Namespace using mTLS or API key.
- mTLS encrypts all cross-Namespace Nexus traffic (start, cancel, and completion callbacks) across cells and regions.
- Endpoints are only accessible from within a Temporal Cloud Account through the Temporal SDK - not externally accessible.

## Payload encryption and Data Converter 

Nexus uses the same Data Converter as Workflows and Activities - JSON, Proto, and binary payloads are all supported.
If you use a Codec for encryption, it also encrypts Nexus payloads.

Caller and handler Workers must have compatible Data Converters.
Payloads are encrypted by the sender (caller encrypts input, handler encrypts result).

### Nexus serialization context 

> **Pre-release** — Go, Java, Python, TypeScript, .NET
> Nexus serialization context is in Pre-release. APIs may change in backwards-incompatible ways before the stable release.

When the [Data Converter](/dataconversion) encodes or decodes a Nexus payload, it receives a Nexus serialization context with the Nexus Endpoint name, Service name, and Operation name.
A [Payload Codec](/payload-codec), [Payload Converter](/payload-converter), or [Failure Converter](/failure-converter) that supports serialization context can use these values, for example to select an encryption key for each Endpoint.

> **ℹ️ Info:**
> Server version requirement
>
> Nexus serialization context requires Temporal Server version 1.33.0 or later.
>

The Operation's own payloads, and the payloads that the handler's Workflows, Updates, and Standalone Activities return to the caller, get the Nexus context.
Inputs to those executions get the Workflow or Activity context:

| Payload | Serialization context |
| --- | --- |
| Operation input, synchronous result, and failure | Nexus |
| Result and closing failure of a Workflow started by the handler | Nexus |
| Input, Memo, Signals, and Queries of a Workflow started by the handler | Workflow |
| Result, failure, and rejection of an Update sent by the handler | Nexus |
| Arguments of an Update sent by the handler | Workflow |
| Result, failures, and Heartbeat details of a Standalone Activity started by the handler | Nexus |
| Input of a Standalone Activity started by the handler | Activity |

The Temporal Service stores the context with the Workflow Execution, Update, Standalone Activity, or Standalone Nexus Operation, and returns it to Clients that read results later.
A handle you get by ID later decodes the result with the same context the caller used.

To complete a Standalone Activity started by a Nexus handler [asynchronously](/activity-execution#asynchronous-activity-completion), read the Nexus serialization context from the Activity info and pass it to the Client that completes the Activity.
The completing Client has only the Task Token, so it can't get the context any other way.

> **⚠️ Warning:**
> Don't share IDs across Endpoints with `USE_EXISTING`
>
> Use Workflow IDs and Activity IDs that are unique to each Endpoint, and don't start executions with those IDs outside the Nexus handler.
>
> With `USE_EXISTING`, a Nexus handler reuses a running Workflow or Standalone Activity if one has the requested ID.
> The existing execution uses its original serialization context to encode the result, or no context if it didn't start from a Nexus handler.
> Calling through a different Endpoint doesn't change that context, so the caller's codec can pick the wrong key and fail to decode the result.
> Standalone Nexus Operations started with `USE_EXISTING` behave the same way.
>

### Choose a cross-Namespace encryption approach 

Use one of the following approaches to encrypt payloads that cross Namespaces.
Options 1 and 2 work with the standard Data Converter.
Option 3 needs a Payload Codec that uses serialization context.

#### Option 1: Same encryption key 

Both Namespaces share the same encryption key, so this approach needs no additional configuration.

#### Option 2: Pass KMS key ID in payload metadata 

Each Namespace uses its own encryption key, with the KMS key ID passed in Temporal payload metadata.
The receiver reads the key ID from metadata and decrypts using KMS IAM permissions.

This works in both directions: the caller encrypts input with the caller's key, and the handler decrypts using the key ID from metadata, then encrypts the result with the handler's key.
The Codec Server needs KMS decrypt permissions for all relevant keys.

See the [encryption sample](https://github.com/temporalio/samples-go/blob/main/encryption/data_converter.go) and the [reference-app-orders-go data converter](https://github.com/temporalio/reference-app-orders-go/blob/main/app/temporalutil/data_converter.go).

#### Option 3: Endpoint-specific encryption keys 

In your Payload Codec, use the [Nexus serialization context](#nexus-serialization-context) to select an encryption key for each Nexus Endpoint.
This encrypts Nexus traffic with a dedicated key, without sharing Namespace keys across teams.

Also record the key ID in payload metadata, as in [Option 2](#kms-key-id-metadata), so the Payload Codec can decode payloads encoded without context, such as payloads from executions that started before your Temporal Service supported serialization context.

See the Nexus serialization context samples for [Go](https://github.com/temporalio/samples-go/tree/main/nexus-serialization-context), [Java](https://github.com/temporalio/samples-java/tree/main/core/src/main/java/io/temporal/samples/nexusserializationcontext), [Python](https://github.com/temporalio/samples-python/tree/main/nexus_serialization_context), [TypeScript](https://github.com/temporalio/samples-typescript/tree/main/nexus-serialization-context), and [.NET](https://github.com/temporalio/samples-dotnet/tree/main/src/NexusSerializationContext).

## Nexus Registry security 

For more information on Nexus Registry security, see [Nexus Registry Roles and Permissions](/nexus/registry#roles-and-permissions).
