Secrets

Store API tokens and Slack credentials on a deployed box, so skills use them by name instead of hardcoding them.

Secrets are named values, such as an instrument's API token or your Slack credentials, stored on a deployed box. A skill asks for a secret by name, so the value never appears in skill code, in a workflow, or in the project. Secrets are not the Zeon API tokens the CLI signs in with.

Secrets exist on a deployed box only. The cloud app has no Secrets entry, and in the cloud a skill that reads a secret gets nothing back.

Managing secrets

Open the header menu (the vertical dots) and choose Secrets. The dialog lists the secrets stored on this box.

To add one, fill in Name and Value under Add secret, then press Save.

  • Name: UPPER_SNAKE_CASE (capital letters, digits and underscores, starting with a letter), at most 64 characters, for example INSTRUMENT_API_TOKEN. The field upper-cases what you type.
  • Value: at most 8192 bytes. Leading and trailing spaces are removed.
  • A box holds at most 100 secrets.

A stored value is never sent back to the browser. Each row shows the name, the last four characters (••••abcd; values shorter than 8 characters show •••• only), and who last set it and when. To change a value, press Replace… on its row and enter the new one. The trash button deletes a secret after a confirmation; skills that use it stop working until it is set again.

Who can change a secret

Anyone signed in on the box can see the list and add a secret under a new name. Replacing or deleting an existing secret is limited to the person who created it and to admins (organization admins and Zeon administrators). Anyone else gets "<NAME> was created by <owner> -- only they or an admin can change it." The creator stays the owner when an admin replaces the value.

Every skill run on the box can read every secret, so anyone who can change a skill there can read the secrets from it.

Using a secret in a skill

Two calls of the skill runtime API read a secret by name:

  • api_request(url, ..., auth_secret="NAME") sends the secret as a bearer token.
  • get_secret("NAME") returns the value, or the default you pass when the secret is not set.
result = api_request(
    "https://instrument.example/api/v1/readings",
    method="POST",
    auth_secret="INSTRUMENT_API_TOKEN",
)

A changed value is used from the next call on; nothing needs a restart.

Values are not masked in skill output. Do not print a secret with print_log, send it to Slack, write it to a file, or put it in a URL.

Slack credentials

The Slack helpers of the runtime API read their credentials from Secrets under these names:

NameUsed for
SLACK_WEBHOOK_URLText messages
SLACK_BOT_TOKENFile and image uploads, and ask_user_slack prompts
SLACK_APP_TOKENask_user_slack prompts
SLACK_DEFAULT_CHANNEL_IDThe channel used when a call names none; ask_user_slack needs it set to post to Slack

When a name is missing, the helper skips Slack. An ask_user_slack prompt still appears on the run screen. See The Workflow Editor.


Did this page help you?