Control and proof
Credential vault (secret isolation for AI agents)
A credential vault for AI agents stores the API keys and OAuth tokens for business systems encrypted outside the agent, and uses them on the agent's behalf only at the moment of each call, so the model, its prompt and its logs never contain a vendor secret.
What it is
Secret isolation for agents. Instead of giving an agent a vendor's API key, you give it a credential for the vault side, which holds the vendor key and attaches it to each permitted request. The agent can use the vendor; it can never read, leak or reuse the vendor secret.
Why it matters
Anything in a model's context can end up in its output. A prompt-injected agent can be talked into printing or sending whatever secrets it can see. Secrets in a local MCP server's environment or config file are exposed to every process on that machine. The OWASP MCP cheat sheet says never to store OAuth tokens in plaintext in MCP config files and to use scoped, per-server credentials.
How it works
OWASP's secrets-management cheat sheet sets out the practice:
- Centralise secrets in one managed store.
- Least privilege: nobody, human or agent, reads all secrets.
- Encrypt with envelope encryption: a data key encrypts the secret, a master key encrypts the data key; use authenticated encryption such as AES-256 in GCM mode (NIST SP 800-38D).
- Rotate where possible, and audit every use.
- Avoid environment variables, which can leak into logs and dumps.
For agents, add one more rule: decrypt only for the duration of one outbound request, and never return the secret through any API.
Example
An agent needs to read invoices. It holds key al_... with read:* on the accounting connection. When it calls do, the platform decrypts the stored OAuth token in memory, attaches it to the vendor request, and discards it. The agent's transcript contains the invoices and nothing else.
Common pitfalls
- Pasting an API key into a prompt "just this once".
- One admin token shared by every agent and every person.
- Logging request headers, which carry the token.
- Long-lived personal access tokens where short-lived OAuth tokens are available.
How actionlake handles it
The actionlake vault seals each credential with AES-256-GCM under a per-tenant data key, wrapped by a master key. The credential is unwrapped in memory for one upstream call. It is never logged, never returned by any endpoint and never placed in a prompt. The agent holds an actionlake key, never a vendor token, and revoking that key cuts its access without touching the vendor credential. OAuth refresh happens on our side. Honest limits: the master key is an environment key, not a hardware security module; customer-managed keys are not offered today; and a deleted connection's encrypted row remains in backups for up to seven days. Who can reach production is stated on the trust page.
Questions
Should I put API keys in an AI agent's prompt?
No. Anything in the context can be repeated or exfiltrated. Give the agent a revocable credential to a service that holds the vendor key and attaches it per request.
Are environment variables safe for MCP server secrets?
OWASP advises against them where better options exist, because environment variables are visible to other processes and can end up in logs or dumps.
What is envelope encryption?
A data key encrypts each secret, and a separate master key encrypts the data key, so the master key never touches the secrets directly and data keys can be managed per tenant.
Related terms
- Prompt injectionPrompt injection is an attack in which text that a language model reads, typed by a user or hidden in a web page, email, document or tool result, changes the model's behaviour, and in a tool-using agent it can turn into real actions.
- AI agent permissionsAI agent permissions are the rules that decide which systems, actions and data an agent's credential may reach, and least privilege for agents means granting only the actions a task needs and enforcing that limit outside the model.
- OAuth for MCPOAuth for MCP is the authorisation flow the MCP specification defines for remote servers, in which an MCP client discovers the server's authorisation server, registers itself, sends the person to sign in and consent, and then calls the server with a short-lived, audience-bound access token.
- MCP gatewayAn MCP gateway is a single MCP endpoint that sits between AI agents and many systems, holding the credentials and enforcing permissions, limits and logging on every tool call that passes through it.
- Dedicated egress IPA dedicated egress IP is one static public IP address reserved for a single customer, from which all of that customer's outbound requests to vendor APIs and databases leave, so the vendor or a firewall can allow-list it.
Sources
Connect an agent. Start free.
100,000 calls free every month. No card. Hard caps on every key.