Skip to main content

Secrets

Encrypted storage for sensitive values such as API keys and credentials.

Overview

Secrets are associated with a project. Values are encrypted at rest using AES-256-GCM and are never returned by any API response. Once stored, a secret's value can only be replaced. All operations return a has_value boolean to indicate whether an encrypted value is on file.

Secrets can be linked to AI Providers to supply credentials at inference time.

See the Permissions Reference for the IAM action strings for this module.

Data Model

FieldTypeDescription
idstringPublic identifier (e.g. sec_…)
project_idstringID of the owning project
namestringHuman-readable label
has_valuebooleantrue when an encrypted value is stored
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last-updated timestamp

Key Concepts

Deletion

By default, deleting a secret that is still referenced by one or more AI providers returns 409 Conflict. Pass ?force=true to cascade-delete the dependent AI providers along with the secret.

Configuration

Environment VariableRequiredDescription
SECRETS_ENCRYPTION_KEYYes64-character hex string (32 bytes). Used for AES-256-GCM encryption of all stored secret values.

Generate a key with:

openssl rand -hex 32

Examples

Create a secret

soat create-secret --project-id proj_ABC --name "OpenAI Key"

Update secret value

soat update-secret --secret-id sec_01 --value sk-abc123...