Skip to main content

Production checklist

View as Markdown

Check each item before launch. Each item links to the page with the details. In Dex Cloud, Super Durable runs the server; the Worker, Step retry, code-change, and database items still apply.

Before you launch

ItemWhat to doDetails
Authentication and TLSAuthentication is off by default and the API is plaintext gRPC: configure an authenticator, and put TLS in front or keep the port private.Authentication, TLS
Payload encryptionTurn it on when the server and its storage must not read your values.Payload encryption
TopologyRun one active node; add a hot standby for fast failover.Self-host Dex Server, Lease, hot standby, and step down
Storage and backupVersion or replicate the bucket prefix, and practice a restore.Backup and restore
RetentionKeep closed runs longer than your longest client retry; copy data you need longer to your own database.Retention, Entity Flow with Attribute Sync
MonitoringServe metrics; alert on a node that is not serving and on failed lease renewals.Metrics and alerts
WorkersSize task slots, and stop Workers gracefully in a deploy.Size Worker slots
Step retriesStep retries end after a time limit, and then the Step's failure policy applies; by default the Flow fails. Set a retry policy or a failure route.Limits
UpgradesRead each release's notes before you upgrade.Upgrades, Agent release notes
Code changesKeep old Step types and RPCs while active runs or approved Time Travel can reach them.Deploy Code Changes
Your databaseMake writes from Steps safe to repeat: upsert by Flow ID.Idempotency keys
Search backendUse PostgreSQL or ParadeDB for heavy search.Search backends
KubernetesRun the server as a StatefulSet with graceful shutdown.Kubernetes deployment
CapacityStart small and watch the server's CPU.Size a server node, Find the bottleneck

Size Worker slots

A Worker's task slots cap how many Steps and RPCs it runs at once. I/O-bound handlers, such as model calls, HTTP, and database queries, need many slots. CPU-bound handlers need about one slot per allocated CPU. In containers, set the slot count and the floor explicitly, because the CPU count can show the whole host. Choose the slot count gives the defaults.

Minimal configuration

This configuration runs one Dex Server node on Amazon S3, with authentication on:

YAML
cluster:
nodeId: dex-zd
objectStore:
region: us-east-1
bucket: BUCKET
prefix: PREFIX
localStorage:
directory: /var/lib/dex-server-zd/store
lease:
duration: 60s
retention:
closedFlowDuration: 7days
metrics:
listen: 0.0.0.0:9090
auth:
authenticators:
- kind: staticTokens
file: /etc/dex-server-zd/tokens.yaml

Replace BUCKET and PREFIX with your bucket and key prefix. The token file lists SHA-256 hashes of the bearer tokens; Authentication shows its format and the JWT option. The 60-second lease suits one node; with hot standbys, keep the default. Install and configure server-zd explains every key.

Give each Worker and Client its token through the SDK's credential option. A file credential rereads its file, so a rotated token needs no restart. See Send credentials from Workers and Clients.

Payload encryption

TLS and payload encryption protect different things.

  • TLS protects values on the network up to the TLS endpoint in front of the server. Dex Server receives plaintext gRPC from that endpoint.
  • Payload encryption encrypts values in your Workers and Clients, with your codec and keys, before they are sent. The server and its storage hold them as ciphertext and never hold the keys.

Use both when the server, its storage, or its operators must not read your data. These rules apply:

  • With a codec, the SDK encrypts eligible values, such as Step, Channel, Stream, and RPC values. Indexed and plaintext Attributes stay plaintext, and so do values stored before you enabled the codec.
  • Names and IDs stay plaintext: Flow types and IDs, Step types, RPC names, Attribute and index keys, Channel and Stream names, request IDs, and task queues. Keep sensitive data out of them.
  • Keep an Attribute plaintext when Dex must compare, index, or project its decoded value: Attribute-match waits, Action conditions, search, and typed Attribute Store columns. Indexed writes are plaintext automatically; declare every other such Attribute plaintext. Store sensitive values in other Attributes, which stay encrypted.
  • With a codec, the Client rejects an Attribute-match wait on an Attribute that it would encrypt, before it sends the wait. Always declare the Attributes that Action conditions use plaintext.
  • Every Worker and Client of the application uses an SDK with payload encryption, the same codec and keys, and the same plaintext declarations.
  • Make every reader able to decrypt before any writer writes ciphertext. A Worker that cannot decrypt a Step value fails that attempt.

The Payload encryption reference lists what the server can see, the setup for each SDK, codec servers for Dex Web and dexcli, rollout and key rotation, and the limits.

Agents

Agent sessions run on the same Dex Server as every other Flow, so the items above apply. These items are what agents add:

ItemWhat to knowDetails
CredentialsKeep model API keys and tool credentials in the Worker's environment or a secret store, never in session input or messages.Credentials
TranscriptsCopy transcripts you must keep to your own store, because Dex can purge a stopped session after the retention period.History and retention
Unknown outcomesDecide who reconciles a call recorded as outcome_unknown before anyone asks for the effect again.Reconcile outcome_unknown
UpgradesStop every older Worker gracefully before new ones start when a release is marked incompatible.Upgrades
Calls during a deployBack off while no Worker runs, because session RPCs need one. A send_user_message retried with a new request ID can queue the message again.RPCs during a deploy
WorkersSize Workers for parallel tool calls: each running model call, tool call, and RPC holds a task slot.Workers and timeouts
Session sizeKeep a session below the state limit with compaction and message retention where the harness has them.Session limits
Model spendCheck spend per account or API key around each model call in your own code.Spend limits
Approval deadlinesSet a deadline when a call must not wait forever for a person.Approval deadlines
StreamingSize the AgentEvents Stream for your traffic.AgentEvents Stream
TracingInstall an OpenTelemetry SDK and exporter to receive the spans that sessions emit for each model call and tool call.Tracing

Agent deployment

An agent app runs three kinds of process:

  • Web app replicas hold a Client. They start sessions, send messages, and stream replies. They register the session Flow's definition to encode calls, but never run a Step.
  • Worker processes run the session Flow: every model call, tool call, and approval wait. A small deployment can run the Worker in its web app process, as the web app example does.
  • Dex Server keeps every session. Workers connect out to it, so they need no inbound port.

Next