Skip to content

Commit a288fc0

Browse files
dvdksnclaude
andcommitted
docs(sandboxes): expand sbx secret import documentation
Add a dedicated subsection covering all import modes: interactive default, named-service import, --all for non-interactive/CI use, --force for overwriting existing entries, and --dry-run. Update the built-in services table heading to explicitly link the env var column to what secret import reads. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 98c9cc3 commit a288fc0

1 file changed

Lines changed: 36 additions & 10 deletions

File tree

content/manuals/ai/sandboxes/security/credentials.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,49 @@ $ sbx secret set my-sandbox openai
9191
> you set or change a global secret while a sandbox is running, recreate the
9292
> sandbox for the new value to take effect.
9393
94-
If you have API keys already set as environment variables in your shell, use
95-
`sbx secret import` to store them all at once:
94+
### Import from environment variables
95+
96+
If you already have API keys set in your shell, `sbx secret import` reads them
97+
and stores them in the keychain without typing each value manually:
9698

9799
```console
98100
$ sbx secret import
99101
```
100102

101-
This reads recognized environment variables from your current session (such as
102-
`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GITHUB_TOKEN`, and others from the
103-
[built-in services table](#built-in-services)) and stores them globally. Run
104-
`sbx secret ls` to confirm what was imported.
103+
This scans your current session for the environment variables listed in the
104+
[built-in services table](#built-in-services) below and prompts you to confirm
105+
each one before writing it. To import a single service:
106+
107+
```console
108+
$ sbx secret import openai
109+
```
110+
111+
For non-interactive use (CI or scripted setup), skip the prompts with `--all`.
112+
New entries are written without confirmation; existing entries are left
113+
unchanged:
114+
115+
```console
116+
$ sbx secret import --all
117+
```
118+
119+
To overwrite an existing stored entry, add `--force`:
120+
121+
```console
122+
$ sbx secret import openai --force
123+
```
124+
125+
To preview what would be imported without writing anything:
126+
127+
```console
128+
$ sbx secret import --dry-run
129+
```
130+
131+
Run `sbx secret ls` afterwards to confirm what's stored.
105132

106133
### Built-in services
107134

108-
Each built-in service name maps to a conventional environment variable name
109-
and the API domains it authenticates requests to:
135+
Each built-in service name maps to the environment variable `sbx secret import`
136+
reads and the API domains the proxy injects credentials into:
110137

111138
| Service | Environment variables | API domains |
112139
| ------------ | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
@@ -123,8 +150,7 @@ and the API domains it authenticates requests to:
123150
| `xai` | `XAI_API_KEY` | `api.x.ai` |
124151

125152
When you store a secret with `sbx secret set -g <service>`, the proxy injects
126-
it into requests to the listed API domains. The environment variable names are
127-
the conventional names for those credentials, used by `sbx secret import`.
153+
it into requests to the listed API domains.
128154

129155
### Services declared by kits
130156

0 commit comments

Comments
 (0)