Operate

Secrets

Quick Answer

Use this guide to declare secret slots, bind secret values, rotate credentials, and wire secret refs into triggers and steps.

This guide covers secret slots, secret refs, bindings, rotation, and how secrets
are consumed by triggers and steps.

Core concepts

ConceptMeaning
Secret refSecret value stored under a :secret-ref key.
Secret slotDeclared in :requires with :type :secret.
Binding contractBindings map slot to :secret-ref; secret value is stored separately.
Source control ruleFlow definitions must never embed secret values.

Deploy-key guard secret (release control)

Deploy-key guard uses a separate server-side secret for release protection.

AspectValue
What it protectsGuarded flow release/promotion paths (flows release, flows promote, and disabling :deploy-key-required).
Where it is definedBreyta environment secret BREYTA_FLOW_DEPLOY_KEY (configured by platform/admin).
How CLI provides it--deploy-key "<value>" or local/CI env BREYTA_FLOW_DEPLOY_KEY when running release commands.
Storage modelGlobal Breyta deployment secret, not a flow :requires slot, bindings secret, or connection.
Flow opt-in switch:deploy-key-required true in flow definition metadata.

Notes:

  • Enabling :deploy-key-required true fails unless BREYTA_FLOW_DEPLOY_KEY is configured for the Breyta environment.
  • Keep this secret in CI/runtime secret manager and inject it per job/session.

Declare a secret slot

Always set an explicit :secret-ref on secret slots.

{:requires [{:slot :webhook-secret
             :type :secret
             :secret-ref :webhook-secret
             :label "Webhook Secret"}]}

Provide a secret value (configure)

Set the secret on the draft target:

breyta flows configure <slug> --set webhook-secret.secret="YOUR_SECRET_VALUE"

Generate a new secret value

Use :generate to create a secret value server-side:

{:bindings {:webhook-secret {:secret :generate}}}

Secret Lifecycle (CLI)

StageCommand / actionResult
Bind valuebreyta flows configure <slug> --set <slot>.secret="VALUE"Stores secret under slot :secret-ref.
Generate valuebreyta flows configure <slug> --set <slot>.secret=:generateServer generates and stores secret value.
RotateRe-run flows configure with updated secret valueReplaces value under same :secret-ref.

Rotate a secret

  1. Apply the new secret value with flows configure.
  2. Re-run to store the new value under the same :secret-ref.
  3. Update external systems to use the new secret.
breyta flows configure <slug> --set webhook-secret.secret="NEW_SECRET_VALUE"

Using secrets in webhook auth

Auth configs reference secrets via :secret-ref:

{:auth {:type :api-key
        :header "X-API-Key"
        :secret-ref :webhook-secret}}

Service account JSON secrets (Google APIs)

Some integrations need a full JSON service account key (not a single token string). Store the entire JSON payload as a secret value and reference it via :secret-ref.

Declare the slot:

{:requires [{:slot :google-drive-service-account
             :type :secret
             :secret-ref :google-drive-service-account
             :label "Google Drive service account JSON"}]}

Bind the value (prod):

{:bindings {:google-drive-service-account {:secret "<SERVICE_ACCOUNT_JSON>"}}}

Use it in an HTTP step auth block:

{:auth {:type :google-service-account
        :secret-ref :google-drive-service-account
        :scopes ["https://www.googleapis.com/auth/drive.readonly"
                 "https://www.googleapis.com/auth/drive.metadata.readonly"]}}
{:auth {:type :hmac-sha256
        :header "X-Signature"
        :secret-ref :webhook-secret}}
{:auth {:type :basic
        :username "webhook-user"
        :secret-ref :webhook-basic-password}}

Common mistakes

MistakeConsequence
Omitting :secret-ref on secret slotValidation/runtime binding failures.
Putting secret values in flow definitionsSecret leakage risk in source and review surfaces.
Mismatching trigger :secret-ref and slot :secret-refAuth checks fail at runtime.

Related

As of Feb 17, 2026