Skip to content
Browse the documentation

Credentials

How AgentLock stores API keys, passwords and other credentials encrypted, which credential types exist and why agents never see them.

How are credentials stored?

AgentLock uses envelope encryption to protect your credentials:

  1. A Master Key is stored securely in the server environment — never in the database.
  2. For each credential, a unique Data Encryption Key (DEK) is generated.
  3. The credential payload is encrypted with the DEK using authenticated encryption.
  4. The DEK itself is encrypted with the Master Key.
  5. Both the encrypted DEK and encrypted payload are stored in the database.

This means: even if the database is fully compromised, the credentials cannot be decrypted without the Master Key.

Can anyone see my credentials?

No. There is no API endpoint that returns decrypted credentials — ever. Not even workspace owners can view the raw secret values.

  • The UI only shows the credential name and type — never any part of the value itself, not even the last characters. Once saved, a secret is write-only.
  • Credentials are stored with envelope encryption (per-credential data key, wrapped by a master key that only the backend holds). The encrypted columns are not even readable by dashboard sessions at the database level.
  • Credentials are decrypted in-memory, just-in-time when executing an action, and the decrypted value is never written to disk, logged, or included in any API response.
  • Credentials are never sent to agents. The agent only receives the sanitized result of the action.

What credential types are supported?

  • API Key / Token — A secret key or token used as an Authorization header (e.g., sk-..., ghp_..., OAuth tokens). Used by the HTTP connector, and sent only to the hosts listed under Allowed hosts (exact hostnames, *.example.com for subdomains). A key without allowed hosts is sent only after someone approves the request. The HTTP connector never sends any other credential type.
  • Login — Username + password credentials used by Browser Sessions. AgentLock can automatically fill login forms on websites using these credentials, without ever exposing them to the agent. Optionally includes a 2FA secret for automatic TOTP code generation.
  • MCP Server — Connect to a Model Context Protocol server. The agent calls tools on the MCP server through AgentLock; credentials and auth tokens stay securely in AgentLock and are never exposed to the agent.
  • SSH Key — Host, port, user and an SSH private key or password, used by the SSH tools. The agent references the credential, never the key.
  • WireGuard VPN — A WireGuard tunnel configuration. Link it to another credential to route that credential's connections through the VPN (Pro and Team).

How do I add a credential?

Go to Credentials and click Add Credential. Select the type (API Key / Token, Login, MCP Server, SSH Key or WireGuard VPN), give it a name, and enter the secret value. The value is encrypted immediately upon submission and the plaintext is discarded.

Only Owners and Admins can manage credentials.

Credentials | AgentLock Docs