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 location | Reference in the policy config | How the gateway gets the key |
|---|---|---|
| Provider key saved in the Console | secret_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 add | secret_key_ref: { keychain: "<name>" } | The gateway reads the OS keyring on the same computer. |
| Environment variable | secret_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.
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
| Flag | Applies to | Description |
|---|---|---|
--secret-id <id> | get, update, delete | Mandatory. The secret ID. |
--name <name> | create | Mandatory. The secret name. It must be unique in the organization. |
--description <text> | create, update | A description. |
--env-var <VAR_NAME> | create, update | Read the value from this environment variable. The name can contain only uppercase letters, digits, and underscores. |
--keychain <service:account> | create, update | Read the value from this OS keyring entry. |
--stdin | create, update | Read the value from standard input. The command removes the final line break. |
--kind <kind> | create, list | The API accepts only secret, the default. Other values fail. The API ignores --kind on list. |
--yes | delete | Mandatory confirmation. |
--json | All | Print the API response as JSON. |
--config <path>, --api-url <url>, --profile <name>, --region <region> | All | The 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
-
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>. -
Examine the record:
verdictan secret get --secret-id "<secret-id>"The output has the
id,name,source,created_at, andupdated_atfields.listprints one line for each record with the ID, name, and source. Neither command returns the value.
Rotate or remove a saved key
-
Find the record. For a provider key, look for
"secret_kind": "provider_key"and theprovidervalue:verdictan secret list --json -
Send the new value through standard input:
printf '%s' "$NEW_VALUE" | verdictan secret update --secret-id "<secret-id>" --stdinThe command prints
updated secret <id>. -
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>" --yesThe 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
| Flag | Applies to | Description |
|---|---|---|
<name> | add | Mandatory. 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. |
--keychain | add | Selects the OS keyring. This is the only backend, so the flag has no effect. |
--config <path> | status | The 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 system | Backend | Entry |
|---|---|---|
| macOS | The macOS Keychain | A generic password with the service and the account. |
| Linux | The Secret Service, for example gnome-keyring | An item with the service and the account. |
| Linux, when no Secret Service answers | The persistent kernel keyring of the user, through libkeyutils | The key verdictan:<service>/<account>. These entries are lost when the computer restarts. |
| Windows | The Windows Credential Manager | A generic credential with the target <service>/<account>. |
Store a key in the OS keyring
-
Store the key:
verdictan secrets add VERDICTAN_OPENAI_API_KEYIn 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_KEYand the accountverdictan. -
Refer to the entry in the provider target:
secret_key_ref: keychain: VERDICTAN_OPENAI_API_KEYThe reference has the format
SERVICE/ACCOUNT. Akeychainreference without an account uses the accountverdictan.
Check which targets can resolve a key
verdictan secrets status --config policy-config.yamlThe 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 type | Status 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. |
store | Always → 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 addstores values in the OS keyring only. On a system with no OS keyring, it reads the value and then stops withno OS keyring is available on this system.- When the OS keyring cannot store the value,
secrets addstops withfailed 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
libkeyutilsis not installed, the CLI cannot use a keyring. Start a Secret Service, such asgnome-keyring, or installlibkeyutils. secret createstores the value, not the variable name. When the variable changes later, runsecret updateagain.- The API removes spaces and line breaks at the start and end of the value.
secret create --kind provider_keyfails, because the CLI cannot send theproviderfield that the API needs for this kind. Add provider keys in the Console.secrets statuschecks that a variable or OS keyring entry exists. It does not check that the provider accepts the key.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
specify exactly one of --env-var, --keychain, or --stdin as the secret source | create has no value source. | Add one source flag. |
invalid env var name '<name>': must contain only uppercase ASCII letters, digits, and underscores | The --env-var name has other characters. | Use an uppercase variable name. |
env var <name> is not set | The variable is not set in the shell. | Set the variable, or use --stdin. |
secret value from stdin must not be empty | Standard 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 field | update 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_conflict | A 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, fromVERDICTAN_API_TOKENorverdictan auth login. You need thesecrets:readpermission forlistandget, andsecrets:writeforcreate,update, anddelete. - 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.
verdictan secret list [OPTIONS]| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
--kind <KIND> | No | Not set | Filter by secret type (for example, "api_key" or "oauth_token") |
--json | No | false | Emit machine-readable JSON to stdout This is a switch without a value. |
--config <CONFIG> | No | Not set | Optional config file path (YAML) |
--api-url <API_URL> | No | Not set | Override API URL |
--profile <PROFILE> | No | default | Profile name (default: "default") |
--region <REGION> | No | Not set | Target region for this API call |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
Use a credential authorized for the requested resource. See Permissions. Regional resource visibility still applies.
Result: Text presents the selected resource records. With --json, the command prints the API response. See the workflow above for its fields.
Example template:
verdictan secret listverdictan secret get [OPTIONS] --secret-id <SECRET_ID>| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
--secret-id <SECRET_ID> | Yes | Not set | Secret id |
--json | No | false | Emit machine-readable JSON to stdout This is a switch without a value. |
--config <CONFIG> | No | Not set | Optional config file path (YAML) |
--api-url <API_URL> | No | Not set | Override API URL |
--profile <PROFILE> | No | default | Profile name (default: "default") |
--region <REGION> | No | Not set | Target region for this API call |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
Use a credential authorized for the requested resource. See Permissions. Regional resource visibility still applies.
Result: Text presents the selected resource records. With --json, the command prints the API response. See the workflow above for its fields.
Example template:
verdictan secret get --secret-id "$SECRET_ID"verdictan secret create [OPTIONS] --name <NAME>| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
--name <NAME> | Yes | Not set | Secret name (unique in the organization) |
--kind <KIND> | No | Not set | Secret type (for example, "api_key" or "oauth_token") |
--description <DESCRIPTION> | No | Not set | Optional description |
--env-var <VAR_NAME> | No | Not set | Read secret material from this environment variable Cannot be combined with --keychain <SVC:ACCT>, --stdin. |
--keychain <SVC:ACCT> | No | Not set | Read secret material from the OS keyring entry "service:account" (macOS Keychain, Windows Credential Manager, or Linux Secret Service) Cannot be combined with --env-var <VAR_NAME>, --stdin. |
--stdin | No | false | Read secret material from stdin This is a switch without a value. Cannot be combined with --env-var <VAR_NAME>, --keychain <SVC:ACCT>. |
--json | No | false | Emit machine-readable JSON to stdout This is a switch without a value. |
--config <CONFIG> | No | Not set | Optional config file path (YAML) |
--api-url <API_URL> | No | Not set | Override API URL |
--profile <PROFILE> | No | default | Profile name (default: "default") |
--region <REGION> | No | Not set | Target region for this API call |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
Choose exactly one of --env-var, --keychain, or --stdin. A keyring selector uses service:account. The command stores the resolved value, not the variable name.
Use a credential authorized for the requested resource. See Permissions. Regional resource visibility still applies.
Result: Text identifies the operation and affected resource. With --json, the command prints the API operation response.
Example template:
verdictan secret create --name "example" --env-var VERDICTAN_PROVIDER_KEYverdictan secret update [OPTIONS] --secret-id <SECRET_ID>| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
--secret-id <SECRET_ID> | Yes | Not set | Secret id |
--description <DESCRIPTION> | No | Not set | New description |
--env-var <VAR_NAME> | No | Not set | Read new secret material from this environment variable Cannot be combined with --keychain <SVC:ACCT>, --stdin. |
--keychain <SVC:ACCT> | No | Not set | Read new secret material from the OS keyring entry "service:account" (macOS Keychain, Windows Credential Manager, or Linux Secret Service) Cannot be combined with --env-var <VAR_NAME>, --stdin. |
--stdin | No | false | Read new secret material from stdin This is a switch without a value. Cannot be combined with --env-var <VAR_NAME>, --keychain <SVC:ACCT>. |
--json | No | false | Emit machine-readable JSON to stdout This is a switch without a value. |
--config <CONFIG> | No | Not set | Optional config file path (YAML) |
--api-url <API_URL> | No | Not set | Override API URL |
--profile <PROFILE> | No | default | Profile name (default: "default") |
--region <REGION> | No | Not set | Target region for this API call |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
A value change requires one secret source. Description-only updates need no source. At least one field must change.
Use a credential authorized for the requested resource. See Permissions. Regional resource visibility still applies.
Result: Text identifies the operation and affected resource. With --json, the command prints the API operation response.
Example template:
verdictan secret update --secret-id "$SECRET_ID" --description "Updated description"verdictan secret delete [OPTIONS] --secret-id <SECRET_ID>| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
--secret-id <SECRET_ID> | Yes | Not set | Secret id |
--yes | No | false | Required confirmation. Without it, this command stops and changes nothing. This is a switch without a value. |
--json | No | false | Emit machine-readable JSON to stdout This is a switch without a value. |
--config <CONFIG> | No | Not set | Optional config file path (YAML) |
--api-url <API_URL> | No | Not set | Override API URL |
--profile <PROFILE> | No | default | Profile name (default: "default") |
--region <REGION> | No | Not set | Target region for this API call |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
Use a credential authorized for the requested resource. See Permissions. Regional resource visibility still applies.
Result: Text identifies the operation and affected resource. With --json, the command prints the API operation response.
Example template:
verdictan secret delete --secret-id "$SECRET_ID" --yesverdictan secrets add [OPTIONS] <NAME>| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
<NAME> | Yes | Not set | Secret name (for example, OPENAI_API_KEY) |
--keychain | No | false | Store the secret in the OS keyring (macOS Keychain, Windows Credential Manager, or Linux Secret Service with a kernel keyring fallback). It is the only backend. The flag is kept for forward compatibility This is a switch without a value. |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
The value comes from terminal input or standard input and is stored in the OS keyring. No OS keyring means the command cannot store it.
Result: Text confirms storage in the OS keyring. It does not print the value.
Example template:
verdictan secrets add "example"verdictan secrets status [OPTIONS]| Input | Required | Default input | Meaning and accepted values |
|---|---|---|---|
--config <CONFIG> | No | policy-config.yaml | Path to the policy config file |
--help (-h) prints help. The global --lang and --region options follow the shared input rules.
This reads a gateway policy file, not a CLI connection file. Missing or unresolved provider secrets cause an error.
Result: Text reports each provider target, credential reference, and resolution status.
Example template:
verdictan secrets statusNext steps
- Environment variable use: select between
env,keychain, andstorereferences. - Declarative config reference: find the
secret_key_reffields of a provider target. - verdictan gateway run: start the gateway after the keys resolve.