> ## Documentation Index
> Fetch the complete documentation index at: https://vetta.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Credential vault

> Secrets injected at the network boundary — the agent never sees raw values.

> [!NOTE]
>
> **Available now.** The vault API and CLI are live, with write-only at-rest encryption. Injection is live on the [MCP connector](https://vetta.sh/docs/capabilities/tools.md#mcp-connector) path.

> [!WARNING]
>
> **`env_var` credentials are not available.** Creating one answers `501 feature_not_configured` and nothing is stored: the egress boundary that would substitute the value does not exist yet. Use `static_bearer` or `mcp_oauth`, which are injected before the sandbox sees the token.

The vault lets you register a credential once and reference it by ID, so you don't run your own secret store or transmit tokens on every call. Its defining property: **the agent never sees the raw secret**. Values are injected at the network boundary, so nothing sensitive enters the model's context, the transcript, or your logs.

## Setting a credential

```bash CLI theme={"system"}
# one vault per identity (by id or name); credentials are sealed into it by vault id
naive vault create --name ava-secrets --identity ava

# MCP static bearer, keyed by server URL; the value is read from stdin, never echoed
naive vault set --vault vlt_... --mcp-bearer https://mcp.example.com/mcp

# MCP OAuth token
naive vault set --vault vlt_... --mcp-oauth https://chat.example.com/mcp
naive vault credentials --vault vlt_...   # metadata only; no value is ever returned
naive vault rm --vault vlt_... --credential vcr_...
```

```typescript TypeScript theme={"system"}
const vault = await client.vaults.create({ display_name: "ava-secrets", identity_id: "idn_..." });
await client.vaults.credentials.create(vault.id, {
  kind: "static_bearer",
  key: "Task tracker API key",
  value: "tok_...",
  mcp_server_url: "https://mcp.example.com/mcp",
});
```

## How network-boundary injection works

```
mcp_oauth / static_bearer:
  MCP connector (server-side)  injects the token when the agent connects to mcp_server_url
```

The token is added on our side of the connection, matched to the exact `mcp_server_url` it was stored for. The sandbox process, the model, the transcript, and logs never see it, and no other server URL receives it.

## At rest

Credentials are protected with envelope encryption: a per-write data key wraps the value with AES-256-GCM, and the data key itself is wrapped by a key held in a managed key service, bound to the org and identity. A vault maps to an [identity](https://vetta.sh/docs/identity/overview.md) and is referenced per session.

## Credential kinds

**env\_var** `credential`

**Not available.** Refused with `501 feature_not_configured`. It is meant for CLIs and direct API calls that read an environment variable, with the real value substituted at egress only for one bound `host`; that egress boundary does not exist yet, so nothing is stored.

**mcp\_oauth** `credential`

For MCP servers that use OAuth 2.0, keyed by `mcp_server_url`. The access token is the `value`, injected server-side when the agent connects. There is no refresh: rotate by adding a new credential and deleting the old one.

**static\_bearer** `credential`

For MCP servers that accept a fixed bearer token (API key or PAT), keyed by `mcp_server_url`. No refresh needed.

An MCP credential can also be **bound to one agent** with `agent_id`. It is then injected into that agent's sessions only, even when another agent declares the same server. A credential for this platform's own `/v1/mcp` is never injected: bound, it marks the agent as your organization's CEO, which gets a short-lived credential for each turn holding only what the people driving it may do. Binding makes the agent an admin's to change: editing, rolling back or deleting it needs the `admin` scope. A version older than the binding gets the credential only while it is the agent's current version, or if it was the current version when the credential was bound.

The secret travels in one field, `value`, which is **write-only** and never returned by the API. Reads return metadata only. An `expires_at` must be in the future; a past one is refused with `400 validation_failed`.

> [card] [Back to identity](https://vetta.sh/docs/identity/overview.md)
>
> How personas tie it all together.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.