mistralM

Docs

Secrets

Bind workspace secrets to a managed deployment, available at build and at runtime.

Workers often need credentials, for example a token for an external API. Managed deployments read them from the workspace Secrets Manager: you bind a workspace secret to an environment variable, and the worker reads the value from its environment at boot. Only secrets from the deployment's workspace can be bound.

Bind a workspace secret to your deployment:

exclamationMark

Changing a secret's value does not restart the worker. The worker keeps the value it read at boot. To pick up a new value, restart the deployment.

Available at build and at runtime

A binding reaches the worker twice:

  • At runtime, as an environment variable, read when the worker boots.
  • At build time, as a Docker build secretarrowUpRight with the same name. Mount it in a RUN step, for example to install packages from a private registry:
RUN --mount=type=secret,id=UV_INDEX_USERNAME,env=UV_INDEX_USERNAME \
    --mount=type=secret,id=UV_INDEX_PASSWORD,env=UV_INDEX_PASSWORD \
    uv sync --frozen --no-dev

The secret is available to that RUN step only and never persists in the image's history or layers. For compatibility, the value is also passed as a build arg with the same name, so existing Dockerfiles keep building. But a matching ARG writes the value into the image's history, and the build log warns about it: drop the ARG and read the secret with the mount instead.