Skip to main content

Manage secrets and credentials

You can keep provider keys out of your policy config. A provider target refers to its key with secret_key_ref. Use verdictan secret to manage the secret records of your organization, including provider keys. Use verdictan secrets to store a key in the OS keyring of your computer and to check which targets can resolve their keys.

For a first local gateway, an environment variable is sufficient.

Key locationReference in the policy configHow the gateway gets the key
Provider key saved in the Consolesecret_key_ref: { store: "<name>" }A connected gateway asks the control plane for the provider key of the target's provider. The agent must have access to the key.
OS keyring, from verdictan secrets addsecret_key_ref: { keychain: "<name>" }The gateway reads the OS keyring on the same computer.
Environment variablesecret_key_ref: { env: "<VARIABLE_NAME>" }The gateway reads its own environment.

For a store reference, the control plane selects the key by provider, not by <name>. When the organization has no provider key for the provider, and the target does not set required: true, the gateway uses the variable VERDICTAN_<name> or <name> from its environment, if one is set. To save a provider key and give agents access to it, see Save a key and grant agent access.

verdictan secret calls the API. verdictan secrets does not.

Needs: an API credential with secrets:read or secrets:write for verdictan secret, or an OS keyring for verdictan secrets add (details).

verdictan secret​

verdictan secret lists, creates, changes, and deletes the secret records of your organization. list and get include the provider keys saved in the Console. The commands do not accept a secret value as a flag. They read it from an environment variable, an OS keyring entry, or standard input. They send the value to the API, which stores it encrypted.

create makes records of the kind secret. A gateway does not use these records as provider keys. To add a provider key, use the Console. To replace the value of a provider key, use update.

Usage​

verdictan secret list [--json]
verdictan secret get --secret-id <id> [--json]
verdictan secret create --name <name> (--env-var <VAR_NAME> | --keychain <service:account> | --stdin) [OPTIONS]
verdictan secret update --secret-id <id> [--description <text>] [--env-var <VAR_NAME> | --keychain <service:account> | --stdin] [--json]
verdictan secret delete --secret-id <id> --yes [--json]

Options​

FlagApplies toDescription
--secret-id <id>get, update, deleteMandatory. The secret ID.
--name <name>createMandatory. The secret name. It must be unique in the organization.
--description <text>create, updateA description.
--env-var <VAR_NAME>create, updateRead the value from this environment variable. The name can contain only uppercase letters, digits, and underscores.
--keychain <service:account>create, updateRead the value from this OS keyring entry.
--stdincreate, updateRead the value from standard input. The command removes the final line break.
--kind <kind>create, listThe API accepts only secret, the default. Other values fail. The API ignores --kind on list.
--yesdeleteMandatory confirmation.
--jsonAllPrint the API response as JSON.
--config <path>, --api-url <url>, --profile <name>, --region <region>AllThe CLI config file, API URL, profile (the default is default), and region.

Use only one of --env-var, --keychain, and --stdin. create needs one of them. update needs one of them, or --description, or both.

Save a key in Verdictan​

  1. Load the value into an environment variable from your secret manager. Then create the record:

    verdictan secret create \
      --name REPORTING_WEBHOOK_TOKEN \
      --env-var REPORTING_WEBHOOK_TOKEN \
      --description "Token for the reporting webhook"

    The command prints created secret <id>.

  2. Examine the record:

    verdictan secret get --secret-id "<secret-id>"

    The output has the id, name, source, created_at, and updated_at fields. list prints one line for each record with the ID, name, and source. Neither command returns the value.

Rotate or remove a saved key​

  1. Find the record. For a provider key, look for "secret_kind": "provider_key" and the provider value:

    verdictan secret list --json
  2. Send the new value through standard input:

    printf '%s' "$NEW_VALUE" | verdictan secret update --secret-id "<secret-id>" --stdin

    The command prints updated secret <id>.

  3. For a provider key, send a request through a connected gateway to confirm that the provider accepts the new key. Revoke the old key at the provider only after that.

To remove a record:

verdictan secret delete --secret-id "<secret-id>" --yes

The command prints deleted secret <id>. It does not prompt, and the API does not check for references. When you delete a provider key, connected gateways cannot get a key for that provider from the control plane.

verdictan secrets​

verdictan secrets works on your workstation only. It does not call the API.

Usage​

verdictan secrets add <name> [--keychain]
verdictan secrets status [--config <path>]

Options​

FlagApplies toDescription
<name>addMandatory. The secret name, such as VERDICTAN_OPENAI_API_KEY. It can contain letters, digits, and underscores, and must start with a letter or an underscore.
--keychainaddSelects the OS keyring. This is the only backend, so the flag has no effect.
--config <path>statusThe policy config. The default is policy-config.yaml.

OS keyring backends​

verdictan secrets add, verdictan secrets status, secret create --keychain, secret update --keychain, and the gateway use the same OS keyring. Each entry has a service and an account.

Operating systemBackendEntry
macOSThe macOS KeychainA generic password with the service and the account.
LinuxThe Secret Service, for example gnome-keyringAn item with the service and the account.
Linux, when no Secret Service answersThe persistent kernel keyring of the user, through libkeyutilsThe key verdictan:<service>/<account>. These entries are lost when the computer restarts.
WindowsThe Windows Credential ManagerA generic credential with the target <service>/<account>.

Store a key in the OS keyring​

  1. Store the key:

    verdictan secrets add VERDICTAN_OPENAI_API_KEY

    In a terminal, the command asks for the value and does not show what you type. From a pipe, it reads one line. It prints Secret 'VERDICTAN_OPENAI_API_KEY' stored successfully in keychain.

    The keyring entry has the service VERDICTAN_OPENAI_API_KEY and the account verdictan.

  2. Refer to the entry in the provider target:

    secret_key_ref:
      keychain: VERDICTAN_OPENAI_API_KEY

    The reference has the format SERVICE/ACCOUNT. A keychain reference without an account uses the account verdictan.

Check which targets can resolve a key​

verdictan secrets status --config policy-config.yaml

The output has one row for each provider target:

Provider ID              Secret Ref               Type       Status
------------------------------------------------------------------------
openai-env               VERDICTAN_OPENAI_API_K…  env        ✓ configured
anthropic-store          ANTHROPIC_PRODUCTION_K…  store      → control plane (resolved per request)
openai-keychain          VERDICTAN_OPENAI_API_K…  keychain   ✓ configured
Reference typeStatus values
env✓ configured when the variable is set. ✗ missing when it is not set.
keychain✓ configured when the OS keyring has an entry with a value. ✗ missing when there is no entry, or the entry is empty. ✗ OS keyring unavailable when the command cannot read the OS keyring. ✗ invalid reference when the reference has no service.
storeAlways → control plane (resolved per request). A connected gateway gets the key from the control plane for each request. The command does not call the API.
A secret_key_ref with no value(empty) and ✗ unconfigured.
No reference(inline) and ✓ configured when the target has an inline key or does not need a key. (none) and ✗ missing when the target needs a key.

The command shortens names that are longer than 23 characters. When a row has ✗, it prints one or more provider secrets are missing or unresolved and exits with code 2. An unavailable OS keyring also causes this result.

After the keys resolve, run verdictan gateway check --config policy-config.yaml --verbose to check the full config.

Limits and failure behavior​

  • secrets add stores values in the OS keyring only. On a system with no OS keyring, it reads the value and then stops with no OS keyring is available on this system.
  • When the OS keyring cannot store the value, secrets add stops with failed to store secret in the OS keyring (macOS Keychain, Windows Credential Manager, or Linux Secret Service). The message then gives the error from the OS keyring, for example Windows error 1312 or a Secret Service error. The message does not show the secret value.
  • On Linux, when no Secret Service answers and libkeyutils is not installed, the CLI cannot use a keyring. Start a Secret Service, such as gnome-keyring, or install libkeyutils.
  • secret create stores the value, not the variable name. When the variable changes later, run secret update again.
  • The API removes spaces and line breaks at the start and end of the value.
  • secret create --kind provider_key fails, because the CLI cannot send the provider field that the API needs for this kind. Add provider keys in the Console.
  • secrets status checks that a variable or OS keyring entry exists. It does not check that the provider accepts the key.

Troubleshooting​

SymptomCauseFix
specify exactly one of --env-var, --keychain, or --stdin as the secret sourcecreate has no value source.Add one source flag.
invalid env var name '<name>': must contain only uppercase ASCII letters, digits, and underscoresThe --env-var name has other characters.Use an uppercase variable name.
env var <name> is not setThe variable is not set in the shell.Set the variable, or use --stdin.
secret value from stdin must not be emptyStandard input is empty.Send the value through the pipe.
--keychain value must be in the format 'service:account'The --keychain value has no colon.Give the service and the account.
pass --yes to confirm deleting secret <id>delete has no --yes.Add --yes.
nothing to update: provide at least one fieldupdate has no description and no value source.Add --description or a value source.
missing api token (set VERDICTAN_API_TOKEN or run ...)No API credential.Set VERDICTAN_API_TOKEN or run verdictan auth login.
command-line token flags have been removed; ...The command has a token flag.Remove the flag and use VERDICTAN_API_TOKEN or a profile.
HTTP 409 with secrets.name_conflictA secret with the name exists.Use update or a different name.
config file not found: <path>status cannot find the config.Give the path with --config.
invalid secret name '<name>': ...The add name has other characters, or starts with a digit.Use letters, digits, and underscores.

Requirements​

  • For verdictan secret: an API credential, from VERDICTAN_API_TOKEN or verdictan auth login. You need the secrets:read permission for list and get, and secrets:write for create, update, and delete.
  • For verdictan secrets add: an OS keyring. See OS keyring backends.
  • For verdictan secrets status: a policy config file.

Complete command reference​

Select a command for its complete input table. Default input means the value used when that option is omitted. A value marked Not set can still come from configuration or the environment, as described above. Set uppercase variables in example templates to your own resource IDs and paths before use. See CLI scripting for quoting, output streams, confirmation, and exit codes.

Next steps​