# Vaults

> The customer side of Manykind — what a vault is, who owns it, what it holds, and how scopes partition it.

Source: https://developers.manykind.ai/vaults/overview/

This group covers the customer side: the vault, sovereign data, connections and consent, the Memory Bank, connectors, members, and how your own apps build on a vault.

A **vault** is a customer's own store for their own data. Your agents and
workflows work inside it; your apps read and write it through the Vault SDK. The
customer owns it, not you and not the platform.

## Who owns a vault

A vault is owned by a **wallet**. One wallet owns exactly one vault, and claiming
it is idempotent: `sdk.vault.ensure()` returns the caller's vault, creating it on
first use.

A vault can belong to:

- **A person.** One owner, no other members.
- **An organization.** The owner adds [members](https://developers.manykind.ai/vaults/members/) and grants each
  of them access to scopes. A vault becomes an organization's vault by having a
  second member; its name is the vault's display name.

## What a vault holds

| Part | What it is |
|---|---|
| **Scopes** | Named partitions. Events, objects, and connections are all per scope. |
| **Events** | Typed messages published into a scope, grouped into streams by `context`. See [Runs and events](https://developers.manykind.ai/agents/how-agents-run/). |
| **Objects** | Files stored in a scope at a path you choose. |
| **[Memory Bank](https://developers.manykind.ai/vaults/memory-bank/)** | Records and relations its agents and workflows filed, each with a privacy class. |
| **[Connectors](https://developers.manykind.ai/vaults/connectors/)** | Configured accounts on outside systems, with their secrets sealed in the vault. |
| **Agent connections** | The agents and workflows the owner [connected](https://developers.manykind.ai/vaults/connections-and-consent/), with their agreements and settings. |
| **Cubbies** | The databases of each connected Agent Service. See [Cubbies](https://developers.manykind.ai/agents/building-blocks/cubbies/). |
| **[Members](https://developers.manykind.ai/vaults/members/)** | Who else may use the vault, and at what level. |

The vault's storage is a bucket the owner's wallet controls.

## Scopes

A scope is the unit every grant is made in. A customer can connect a fitness
agent to `health` without exposing `finance`.

| Rule | Value |
|---|---|
| Name pattern | `^[a-z][a-z0-9-]*$`, at most 63 characters |
| Always present | `default` |
| Reserved | `default`, `shared` |
| Optional fields | `displayName`, `streamLabel`, `metadata` (a free-form map; updates shallow-merge per top-level key) |

In ROC, a vault's scopes are shown as **Domains**, on the **Organization** page's
**Domains** tab.

```ts
await vault.scopes.create({ name: "health", displayName: "Health" });
const scopes = await vault.scopes.list();
```

## Credential status

A vault's storage credential refreshes in the background. `vault.status` is
`active` or `disconnected`; `vault.isDisconnected()` is true when the credential
can no longer be refreshed and the owner has to act.

## Related

- [Next: Sovereign data](https://developers.manykind.ai/vaults/sovereign-data/)
- [Memory Bank](https://developers.manykind.ai/vaults/memory-bank/)
- [Members](https://developers.manykind.ai/vaults/members/)
- [Data onboarding](https://developers.manykind.ai/vaults/build-on-a-vault/data-onboarding/)
