Skip to main content
A Connection Vault is a workspace-scoped container for credentials. Each credential is one slot: either an MCP server your agents call tools on, or a Secret (API key, token, password, signing secret) that DataGen injects into the sandbox as an environment variable at run time. Credentials never appear in code, prompts, or git. Admins set shared values once; members use them without seeing them. Values a member must own personally — their database password, their Gmail login — are filled in by each member.

Vaults in a workspace

Every workspace has a Default vault. Anything that does not pin a vault (an agent left on Workspace default, an API key that is not pinned to a vault) uses it. Create more vaults to keep credential sets apart — for example production and staging, or one vault per team.
Connection Vaults -- the Default vault's Credentials tab
Open Connection Vaults from the left rail (the Vaults icon). Each vault has these tabs:

Create a vault

1

Open the vault list

Open Connection Vaults and click New vault.
2

Name it

Enter a Name (for example production; unique within the workspace) and an optional Description (optional).
3

Create

Click Create vault, then open the vault to add credentials.

Add a credential

Open a vault, go to the Credentials tab and click Add credential.
Add credential dialog -- choose Secret, then set Name, Target, and Type

Fields

Shared vs Per-user

Decide with one question: is this value the same for every member?

Shared with workspace

You provide one value; everyone uses it without seeing it. Use it for service accounts, company API keys, and connection details such as a database host or port.

Per-user

The slot is only a declaration. Each member sees the row with a Connect button and fills in their own value. Use it for personal logins, personal database roles, and OAuth.
  • Per-user values are scoped to the vault: a member’s value here is separate from their value for the same name in another vault.
  • OAuth is always Per-user. Selecting OAuth switches the Type to Per-user; each member runs the consent flow themselves.
  • Shared + Allow members to use their own token covers the in-between case: one shared token by default, but a developer’s runs use their own token once they click Use my own token on the row.

Fill in a Per-user value

On a Per-user row, click Connect (or Update to replace your value):
  • OAuth — a popup opens for you to sign in with the provider. DataGen stores your access and refresh tokens, encrypted and scoped to this vault. Your provider password is never stored. Allow popups for the site if the popup is blocked.
  • API key / Bearer token — paste your value. Only you can use it; admins and other members never see it.

Status column

The banner above the table tells you whether every credential in the vault is available to you, or how many need attention.

How a Secret becomes an env var

When an agent, context builder, or app starts a sandbox, DataGen resolves every Secret slot in its vault and exports each one as an environment variable. The Target is the variable name, normalized two ways:
  • hyphens become underscores
  • the name is uppercased
Write Targets in the exact uppercase form your code or library reads, for example PGHOST or OPENAI_API_KEY, so the vault table matches what the code sees. Code reads them like any other variable:
MCP server credentials are not exported as env vars. DataGen attaches them when an agent calls a tool on that server; the tool bundle decides which of the vault’s tools an agent may call.

Rotate, update and delete

Rotate a credential whenever its value was pasted into a chat, log, or ticket. Nothing needs redeploying — the next run reads the new value.

Roles


Egress policies

Egress policies take effect only on deployments that run DataGen’s egress proxy with the feature enabled for your account. Where that is not the case, the Sent to column and the Where can it be sent? field are hidden, or the dialog shows a Not active notice and every secret reaches agents as-is.
An egress policy decides whether code in the sandbox can read a secret’s real value. With a policy, the agent sees a stand-in, and DataGen swaps the real value in on the way out — only for the hosts you allow. Set it in the Sent to column of a Secret row, or in Where can it be sent? when adding one:
  • Only header and query-string values are swapped. A secret sent inside a request body, a signing secret, or a database connection string is always given as-is.
  • A policy applies to every secret with that variable name in the workspace, across all vaults.
  • Changes apply from the agent’s next turn.

How agents, contexts and apps use a vault

  • An agent run resolves Per-user values for the member the run runs as.
  • An app resolves the vault as the member who opens it, Per-user slots included, so each member’s app session uses their own values.

Gotchas

A run resolves every Secret slot in its vault before the sandbox starts. If any slot has no value for the member the run runs as — an empty Shared slot, or a Per-user slot that member never connected — the run fails fast with Vault not ready: <names>. Fill in the listed slots on the vault page and re-run. Keep vaults focused: a Per-user slot that only one agent needs still blocks every agent on that vault for members who have not filled it.
Check the Target: it is uppercased and hyphens become underscores, so my-key arrives as MY_KEY. Also confirm the agent, context, or app is bound to the vault that holds the slot — an app with No vault gets nothing.
The vault slot wins. Workspace secrets (Workspace settings -> Secrets) only fill names the vault does not already provide.
OAuth credentials are Per-user. To share one account across the workspace, choose another auth method such as Bearer token or API key.

Next

Sandbox Environments

Bake the packages your agents’ code needs into a reusable image.

Query a Database from Code

A worked example: store PG* secrets in the vault and query Postgres.