← Back to Dashboard

Vault

Encrypted secrets management — securely store API keys, passwords, and credentials used by your agents.

Table of Contents

Overview

For everyone: The Vault is a secure safe for all the passwords and API keys your AI agents need. Instead of putting credentials directly in agent configs (where they could be leaked), you store them in the Vault. The Vault encrypts everything so even if someone accesses the database, they can't read your secrets. Every time anyone looks at or changes a secret, it's logged.

For technical users: The Vault implements AES-256-GCM authenticated encryption with PBKDF2 key derivation (100,000 iterations). Each secret gets a unique random salt and initialization vector. The master encryption key is derived from AGENTICMAIL_VAULT_KEY in the .env file. Platform presets auto-name secrets as skill:<platform>:<key> for automatic discovery by agent tools. Full audit trail via /vault/audit-log.

Organization Scoping: Use the org switcher in the page header to view and manage vault secrets per organization. Secrets are scoped — each organization has its own isolated vault.

How It Works

  1. Store a secret — select a platform preset or create a custom secret. The value is encrypted before being written to the database.
  2. Agents use secrets — agent tools automatically discover secrets named skill:<platform>:<key> and decrypt them on demand.
  3. Access is logged — every read, create, delete, and rotate operation is recorded in the audit trail.
  4. Rotate periodically — re-encrypt secrets with fresh salts and IVs without changing the actual credential value.

Key Concepts

Encryption Details

PropertyValue
AlgorithmAES-256-GCM (authenticated encryption with tamper detection)
Key DerivationPBKDF2 with 100,000 iterations
SaltUnique random salt per secret
IVUnique random initialization vector per secret
Master KeyDerived from AGENTICMAIL_VAULT_KEY environment variable

Secret Naming Convention

Platform preset secrets follow the naming pattern skill:<platform>:<key>:

skill:openai:access_token
skill:anthropic:access_token
skill:stripe:access_token
skill:stripe:webhook_secret
skill:aws:access_key_id
skill:aws:secret_access_key

Agent tools automatically discover and use secrets matching this pattern.

Managing Secrets

Adding Secrets

Click "Add Secret" to open the modal:

  1. Select Platform/Service — choose from presets or "Custom Secret."
  2. Fill in fields — each platform has specific fields (API key, token, etc.). Required fields are marked with *.
  3. Click "Store Secret" — the value is encrypted and saved.

Viewing Secrets

Click any secret in the table (or the eye icon) to open the view modal:

Warning: Viewing a secret creates an audit log entry. Be mindful of who has access to view secrets in production.

Deleting Secrets

Click the trash icon and confirm. Deletion is permanent and immediately revokes access for any services using the secret.

Danger: Deleting a secret cannot be undone. Any agents or services using the secret will immediately lose access. Make sure the credential is no longer needed before deleting.

Searching and Filtering

Platform Presets

The Vault includes presets for common platforms. Each preset auto-configures the secret name, category, and required fields:

PlatformCategoryFields
OpenAISkill CredentialAPI Key (sk-...)
AnthropicSkill CredentialAPI Key (sk-ant-...)
Google Cloud / GeminiSkill CredentialAPI Key, OAuth Client ID*, OAuth Client Secret*
ElevenLabsSkill CredentialAPI Key (xi_...)
Telegram BotSkill CredentialBot Token
SlackSkill CredentialBot Token (xoxb-...), Signing Secret*
GitHubSkill CredentialPersonal Access Token (ghp_...)
StripeSkill CredentialSecret Key (sk_live_...), Webhook Secret*
SendGridSkill CredentialAPI Key (SG...)
TwilioSkill CredentialAccount SID (AC...), Auth Token
AWSCloud StorageAccess Key ID (AKIA...), Secret Access Key, Region*
CloudflareSkill CredentialAPI Token, Account ID*
NotionSkill CredentialIntegration Token (secret_...)
HubSpotSkill CredentialPrivate App Token (pat-...)
SMTP / EmailDeploy CredentialsHost, Port*, Username, App Password
DatabaseDeploy CredentialsConnection String

* = optional field

Secret Categories

CategoryColorDescription
Deploy CredentialsIndigoInfrastructure and deployment secrets (SMTP, database connections)
Skill CredentialsGreenAPI keys for agent tools (OpenAI, Slack, GitHub, etc.)
Cloud StorageBlueAWS, GCP, and other cloud provider credentials
API KeysAmberGeneral-purpose API keys
CustomGrayUser-defined secrets with custom names

Key Rotation

Rotating a secret re-encrypts it with a fresh salt and initialization vector without changing the actual credential value. This limits the window of exposure if encryption material is compromised.

Single Secret Rotation

Click the rotate icon on any secret, or use the "Rotate" button in the view modal.

Bulk Rotation

Click "Rotate All" to re-encrypt every secret in the vault at once. Use after security incidents or as periodic hygiene.

Tip: Rotate secrets periodically (monthly or quarterly). Use "Rotate All" immediately after any suspected security incident.

Audit Log

The Audit Log tab records every vault operation. Each entry includes:

FieldDescription
Actionencrypt, decrypt, delete, rotate, migrate, read, create
SecretName or ID of the secret accessed
ActorUser or system that performed the action
TimestampWhen the action occurred
DetailsAdditional metadata (IP address, etc.)

Features:

Vault Status

The Status tab shows:

Configuration & Setup

API Endpoints

MethodEndpointDescription
GET/vault/secrets?orgId=List all secrets (metadata only, not decrypted)
POST/vault/secretsCreate/encrypt a new secret
GET/vault/secrets/:idDecrypt and retrieve a secret value
DELETE/vault/secrets/:idPermanently delete a secret
POST/vault/secrets/:id/rotateRe-encrypt a single secret
POST/vault/rotate-allRe-encrypt all secrets
GET/vault/audit-logQuery audit log (supports search, action filter, pagination)
GET/vault/statusVault status and statistics

Create Secret Request

POST /vault/secrets
{
  "orgId": "org-123",
  "name": "skill:openai:access_token",
  "value": "sk-...",
  "category": "skill_credential"
}

Best Practices

Troubleshooting

"Decryption failed" when viewing a secret

The AGENTICMAIL_VAULT_KEY in your .env may have changed or been corrupted. If you migrated to a new machine, ensure you copied the exact same .env file. Secrets encrypted with a different key cannot be recovered.

Agent can't find credentials

Verify the secret follows the skill:<platform>:<key> naming convention. Check the secret name in the vault list — it must match exactly what the agent tool expects.

"Vault not configured" status

The AGENTICMAIL_VAULT_KEY environment variable is missing. Add it to ~/.agenticmail/.env and restart the server.

Audit log shows unexpected access

Check the actor column for the user or system that accessed the secret. Review user permissions on the Users page and consider restricting Vault access to fewer users.

Bulk rotation fails partway

Some secrets may have been rotated while others weren't. Check the audit log for which secrets were rotated successfully, then manually rotate the remaining ones.

AgenticMail Enterprise Documentation Report an issue