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 exampleproduction and staging, or one vault per team.

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.
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:
Rotate, update and delete
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.
- 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
Run fails with "Vault not ready"
Run fails with "Vault not ready"
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.Env var not found in the sandbox
Env var not found in the sandbox
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.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.