Skip to content

Commit 92cd515

Browse files
dvdksnclaude
andcommitted
docs: clarify that credential env vars are host-side (fixes #24678)
The credentials page could be misread as suggesting you set API key environment variables inside the sandbox. Clarified that env vars are read from the host shell, and added a note that model-provider keys set inside the sandbox have no effect because the proxy handles credential injection from the host. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 69b3d7a commit 92cd515

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,20 @@ $ sbx run claude
126126
The proxy reads the variable from your terminal session. See individual
127127
[agent pages](../agents/) for the variable names each agent expects.
128128

129+
> [!NOTE]
130+
> These environment variables are set on your host, not inside the sandbox.
131+
> Sandbox agents are pre-configured to use credentials managed by the
132+
> host-side proxy. For custom environment variables not tied to a
133+
> [supported service](#supported-services), see
134+
> [Setting custom environment variables](../faq.md#how-do-i-set-custom-environment-variables-inside-a-sandbox).
135+
129136
## Best practices
130137

131138
- Use [stored secrets](#stored-secrets) over environment variables. The OS
132139
keychain encrypts credentials at rest and controls access, while environment
133140
variables are plaintext in your shell.
134-
- Don't set API keys manually inside the sandbox. Credentials stored in
135-
environment variables or configuration files inside the VM are readable by
136-
the agent process directly.
141+
- Don't set API keys manually inside the sandbox. Sandbox agents are
142+
pre-configured to use proxy-managed credentials.
137143
- For Claude Code and Codex, OAuth is another secure option: the flow runs on
138144
the host, so the token is never exposed inside the sandbox. For Claude Code,
139145
use `/login` inside the agent. For Codex, run `sbx secret set -g openai --oauth`.

0 commit comments

Comments
 (0)