Skip to documentation
Documentation

Personal secrets

Let each person give an agent their own API key without pasting it into the chat.

Some tools only work with the user's own key. A CLI that reads VIBECODE_API_KEY is one example. A personal secret lets each person in a conversation give the agent that key through a short-lived link, never through the chat. The value is encrypted at rest. It reaches only that person's sandbox commands, and it never enters the prompt, the transcript, traces or tool arguments.

Declare the secrets an agent needs

For organization-level provider credentials rather than a person's own keys, see Bring your own key.

Open the agent, go to Sandbox, and add an entry under Personal keys. You can also send userSecrets (or user_secrets) on POST /agents, POST /agents/:id and the developer API /sync:

JSON
{
  "userSecrets": [
    {
      "name": "VIBECODE_API_KEY",
      "label": "Vibecode API key",
      "description": "Settings → API keys in Vibecode.",
      "helpUrl": "https://vibecode.dev/settings/keys",
      "prefix": "vc_",
      "minLength": 20
    }
  ]
}
FieldMeaning
nameThe environment variable the value is exported as. It can't be a variable the shell relies on, such as PATH or HOME.
labelWhat the person is asked for. Defaults to name.
description, helpUrlWhere the person gets the value. Both are shown on the entry page. helpUrl must be https.
prefix, minLengthOptional verification. A value that doesn't match is refused on the entry page. prefix is also how a key pasted into the chat is recognised.

An agent can declare up to ten.

How a person provides one

Declaring a secret gives the agent the request_user_secret tool. The agent also gets a short status line for each declared secret: set, not set, or unreadable. When a value is needed, the agent calls the tool and sends the link it returns. The link is single-use, expires after 15 minutes, and is bound to the conversation and person the turn belongs to. The model only names the secret and never chooses whose it is. Opening the link doesn't use it up, so link previews are safe.

The page lets the person save, replace or remove their value. After they submit, the agent gets a silent notice in the conversation and can continue. This works the same on every channel.

Whose secret it is

The owner is the person, not the conversation's sandbox folder. In a Slack channel, everyone in the thread shares one workspace folder, but each person's key belongs to that person alone. Playground, eval and copilot runs have no personal secrets. A Slack message that can't be attributed to a person also gets none.

In the sandbox

A sandbox command gets that person's values as environment variables, for that one command only. They're never written into the sandbox's boot environment or any file. If a command uses $NAME and the person hasn't set it, the command doesn't run. Instead the agent gets a structured needsAuth result with a fresh link to send them. The same thing happens when a stored value can't be decrypted.

Redaction

Each turn scrubs the person's stored values, and any key they paste in a format a declared prefix recognises. They're replaced with [redacted NAME] before the message is stored, traced or shown to the model. This covers messages that arrive mid-turn or while a human holds the conversation. A pasted key isn't kept in the chat: the agent is told it was redacted and offers a link that saves the pasted value in one tap. The same values are scrubbed from tool inputs and outputs recorded in spans, from sandbox output, and from tool results returned to the model.