Most agents will require access to sensitive information, such as API keys, passwords, and other secrets.
To keep this information secure, we recommend using Pipecat Cloud’s secret management feature.Secrets are created as “sets” of key-value pairs, and defined at the user / organization level.
This means that secrets can be shared across all agent deployments within the same user workspace or organization.To access secrets, your deployment must specify the secret set to use.
pipecat cloud secrets set my-secrets SECRET_NAME secret-value SECRET_NAME_2 secret-value-2
This command will create or modify the secret set with the name my-secrets, and add or update the key-value pairs SECRET_NAME and SECRET_NAME_2.You can add additional secrets to the set by specifying more key-value pairs.
pipecat cloud secrets set my-secrets SECRET_NAME_3 secret-value-3
Whenever a secret is added or updated in an existing set, any deployments
using that set will need to be redeployed to access the new values.
Creating or updating a secret set is asynchronous. The CLI/API returns
immediately (HTTP 202 Accepted) once your values have been stored, but the
set is then provisioned into the target region in the background. Provisioning
typically completes within a few seconds.Each secret set has one of three readiness states:
Status
Meaning
pending
The secret has been accepted but is not yet provisioned in the target region.
ready
The secret is fully provisioned and safe to bind to a deployment.
failed
Provisioning could not complete. Re-create the secret or contact support if the problem persists.
Readiness is included in GET /v1/secrets (list) and GET /v1/secrets/{setName}
(single) responses on the REST API.
Deploys, updates, and any other operation that binds a secret set to an agent
are gated on the ready state — a request to deploy with a pending or
failed set is rejected with HTTP 409 Conflict rather than failing later
when the agent starts.
In an automated pipeline that creates a secret immediately before deploying
(e.g., CI), poll GET /v1/secrets/{setName} until status is ready before
triggering the deploy. The window is usually only a few seconds, but guarding
the deploy avoids a transient 409.
Secret sets are created in a specific region. By default, secrets are created in us-west if no region is specified.
pipecat cloud secrets set my-secrets SECRET_NAME secret-value --region us-east
Secret set names are globally unique, but each secret set exists in only one
region. Secrets must be in the same region as the agents that use them. For
multi-region deployments, create separate secret sets for each region (e.g.,
my-secrets-us-west, my-secrets-us-east).
Running this command will prompt you for account credentials.
The CLI accepts credentials as username:token and base64-encodes them before
storing the image pull secret. If you create an image pull secret through the
dashboard or API, the auth value must already be base64-encoded.Like regular secret sets, image pull secrets are region-specific. Specify the region with the --region flag:
To update an image pull secret’s credentials, simply re-run the
image-pull-secret command with the same name. Image pull secrets must be in
the same region as the agents that use them.
Secrets are mounted as environment variables in your agent process.For example, if you define a secret with the key MY_SECRET, you can access it in your agent code like so:
If you prefer to manage secrets outside of Pipecat Cloud, you can use environment variables or other secret management tools.You could, for example, set environment variables in your Dockerfile:
FROM dailyco/pipecat-base:latest# Enable bytecode compilationENV UV_COMPILE_BYTECODE=1# Copy from the cache instead of linking since it's a mounted volumeENV UV_LINK_MODE=copy# Set the secret as an environment variableENV MY_SECRET=secret-value# Install the project's dependencies using the lockfile and settingsRUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --locked --no-install-project --no-dev# Copy the application codeCOPY ./bot.py bot.py
We recommend using Pipecat Cloud’s built-in management for the most secure and versatile method of managing secrets.