Skip to content

Commit 5c7bd36

Browse files
dvdksnclaude
andcommitted
docs(sandboxes): align credential and kit-spec docs to schemaVersion 2
Reframe the credential and kit-authoring docs to the v2 launch state: - credentials.md: credential bindings as the authorization mechanism, first-run approval (API key vs OAuth), fail-closed by default for schemaVersion 2 kits, environment variables sourced via a binding - kit-reference.md: default examples to schemaVersion "2"; add a "Schema versions" section + v1->v2 mapping; rewrite credentials (credentials[] / apiKey / oauth), network (caps.network), drop proxyManaged - kits.md, kit-examples.md: convert examples to v2 - agent pages: env-var auth now flows through a credential binding - troubleshooting.md: add the "no approved binding" failure Held as a draft until built-in agents move to schemaVersion 2. build-an-agent.md remains on v1 (separate follow-up). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 75b13e9 commit 5c7bd36

14 files changed

Lines changed: 311 additions & 212 deletions

File tree

content/manuals/ai/sandboxes/agents/claude-code.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ Claude Code requires either an Anthropic API key or a Claude subscription.
3838
$ sbx secret set -g anthropic
3939
```
4040

41-
Alternatively, export the `ANTHROPIC_API_KEY` environment variable in your
42-
shell before running the sandbox. See
43-
[Credentials](../security/credentials.md) for details on both methods.
41+
You can also source the key from the `ANTHROPIC_API_KEY` environment variable
42+
through a [credential binding](../security/credentials.md#credential-bindings);
43+
the sandbox prompts you to approve one on first run. See
44+
[Credentials](../security/credentials.md) for details.
4445

4546
**Claude subscription**: If no API key is set, Claude Code prompts you to
4647
authenticate interactively using OAuth. The proxy handles the OAuth flow, so

content/manuals/ai/sandboxes/agents/codex.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ so browser-based authentication works without any extra setup.
5252
$ sbx secret set -g openai
5353
```
5454

55-
Alternatively, export the `OPENAI_API_KEY` environment variable in your shell
56-
before running the sandbox.
55+
You can also source the key from the `OPENAI_API_KEY` environment variable
56+
through a [credential binding](../security/credentials.md#credential-bindings);
57+
the sandbox prompts you to approve one on first run.
5758

5859
See [Credentials](../security/credentials.md) for more details.
5960

content/manuals/ai/sandboxes/agents/copilot.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ Copilot requires a GitHub token with Copilot access. Store your token using
3636
$ echo "$(gh auth token)" | sbx secret set -g github
3737
```
3838

39-
Alternatively, export the `GH_TOKEN` or `GITHUB_TOKEN` environment variable in
40-
your shell before running the sandbox. See
41-
[Credentials](../security/credentials.md) for details on both methods.
39+
You can also source the token from the `GH_TOKEN` or `GITHUB_TOKEN` environment
40+
variable through a
41+
[credential binding](../security/credentials.md#credential-bindings); the
42+
sandbox prompts you to approve one on first run. See
43+
[Credentials](../security/credentials.md) for details.
4244

4345
## Configuration
4446

content/manuals/ai/sandboxes/agents/cursor.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ Cursor supports two authentication methods: an API key or OAuth.
3838
$ sbx secret set -g cursor
3939
```
4040

41-
Alternatively, export the `CURSOR_API_KEY` environment variable in your shell
42-
before running the sandbox. See
43-
[Credentials](../security/credentials.md) for details on both methods.
41+
You can also source the key from the `CURSOR_API_KEY` environment variable
42+
through a [credential binding](../security/credentials.md#credential-bindings);
43+
the sandbox prompts you to approve one on first run. See
44+
[Credentials](../security/credentials.md) for details.
4445

4546
**OAuth**: If no API key is set, Cursor prompts you to sign in interactively
4647
on first run. The proxy intercepts the token exchange with

content/manuals/ai/sandboxes/agents/docker-agent.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ $ sbx secret set -g openrouter
3838
You only need to configure the providers you want to use. Docker Agent detects
3939
available credentials and routes requests to the appropriate provider.
4040

41-
Alternatively, export the environment variables (`OPENAI_API_KEY`,
41+
You can also source these from environment variables (`OPENAI_API_KEY`,
4242
`ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, `XAI_API_KEY`, `NEBIUS_API_KEY`,
43-
`MISTRAL_API_KEY`, `OPENROUTER_API_KEY`) in your shell before running the
44-
sandbox. See
45-
[Credentials](../security/credentials.md) for details on both methods.
43+
`MISTRAL_API_KEY`, `OPENROUTER_API_KEY`) through
44+
[credential bindings](../security/credentials.md#credential-bindings); the
45+
sandbox prompts you to approve one per provider on first run. See
46+
[Credentials](../security/credentials.md) for details.
4647

4748
## Configuration
4849

content/manuals/ai/sandboxes/agents/droid.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ your Factory account.
4040
$ sbx secret set -g droid
4141
```
4242

43-
Alternatively, export the `FACTORY_API_KEY` environment variable in your shell
44-
before running the sandbox. See
45-
[Credentials](../security/credentials.md) for details on both methods.
43+
You can also source the key from the `FACTORY_API_KEY` environment variable
44+
through a [credential binding](../security/credentials.md#credential-bindings);
45+
the sandbox prompts you to approve one on first run. See
46+
[Credentials](../security/credentials.md) for details.
4647

4748
**OAuth**: If no API key is set, Droid prompts you to authenticate
4849
interactively on first run. The proxy handles the OAuth flow, so credentials

content/manuals/ai/sandboxes/agents/gemini.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ Gemini requires either a Google API key or a Google account with Gemini access.
3838
$ sbx secret set -g google
3939
```
4040

41-
Alternatively, export the `GEMINI_API_KEY` or `GOOGLE_API_KEY` environment
42-
variable in your shell before running the sandbox. See
43-
[Credentials](../security/credentials.md) for details on both methods.
41+
You can also source the key from the `GEMINI_API_KEY` or `GOOGLE_API_KEY`
42+
environment variable through a
43+
[credential binding](../security/credentials.md#credential-bindings); the
44+
sandbox prompts you to approve one on first run. See
45+
[Credentials](../security/credentials.md) for details.
4446

4547
**Google account**: If no API key is set, Gemini prompts you to sign in
4648
interactively when it starts. Interactive authentication is scoped to the

content/manuals/ai/sandboxes/agents/opencode.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ $ sbx secret set -g openrouter
4848
You only need to configure the providers you want to use. OpenCode detects
4949
available credentials and offers those providers in the TUI.
5050

51-
You can also use environment variables (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`,
52-
`GOOGLE_GENERATIVE_AI_API_KEY`, `XAI_API_KEY`, `GROQ_API_KEY`,
53-
`AWS_ACCESS_KEY_ID`, `OPENROUTER_API_KEY`). See
54-
[Credentials](../security/credentials.md) for details on both methods.
51+
You can also source these from environment variables (`OPENAI_API_KEY`,
52+
`ANTHROPIC_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY`, `XAI_API_KEY`,
53+
`GROQ_API_KEY`, `AWS_ACCESS_KEY_ID`, `OPENROUTER_API_KEY`) through
54+
[credential bindings](../security/credentials.md#credential-bindings); the
55+
sandbox prompts you to approve one per provider on first run. See
56+
[Credentials](../security/credentials.md) for details.
5557

5658
## Configuration
5759

content/manuals/ai/sandboxes/agents/shell.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ $ sbx run shell -- -c "echo hi" # runs bash -l -c "echo hi"
3333

3434
When the first argument is a bare word, it replaces `-l` instead.
3535

36-
Set your API keys as environment variables so the sandbox proxy can inject
37-
them into API requests automatically. Credentials are never stored inside
38-
the VM:
36+
Provide your API keys as environment variables so the sandbox proxy can inject
37+
them into API requests. The proxy injects a key once a
38+
[credential binding](../security/credentials.md#credential-bindings) authorizes
39+
it — the sandbox prompts you to approve one on first run. Credentials are never
40+
stored inside the VM:
3941

4042
```console
4143
$ export ANTHROPIC_API_KEY=sk-ant-xxxxx

content/manuals/ai/sandboxes/customize/kit-examples.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ruff-lint/
3535
```
3636

3737
```yaml {title="ruff-lint/spec.yaml"}
38-
schemaVersion: "1"
38+
schemaVersion: "2"
3939
kind: mixin
4040
name: ruff-lint
4141
displayName: Ruff
@@ -95,7 +95,7 @@ the kit and install each certificate before running
9595
`update-ca-certificates`.
9696

9797
```yaml {title="internal-ca/spec.yaml"}
98-
schemaVersion: "1"
98+
schemaVersion: "2"
9999
kind: mixin
100100
name: internal-ca
101101
@@ -196,7 +196,7 @@ docker-review/
196196
```
197197

198198
```yaml {title="docker-review/spec.yaml"}
199-
schemaVersion: "1"
199+
schemaVersion: "2"
200200
kind: mixin
201201
name: docker-review
202202
displayName: Dockerfile review skill
@@ -260,7 +260,7 @@ built-in `claude` agent but drops `--dangerously-skip-permissions` so
260260
every tool call prompts for approval:
261261

262262
```yaml {title="claude-safe/spec.yaml"}
263-
schemaVersion: "1"
263+
schemaVersion: "2"
264264
kind: sandbox
265265
name: claude-safe
266266
displayName: Claude Code (with approval prompts)
@@ -272,22 +272,22 @@ sandbox:
272272
entrypoint:
273273
run: [claude]
274274
275-
network:
276-
serviceDomains:
277-
api.anthropic.com: anthropic
278-
console.anthropic.com: anthropic
279-
serviceAuth:
280-
anthropic:
281-
headerName: x-api-key
282-
valueFormat: "%s"
283-
allowedDomains:
284-
- "claude.com:443"
275+
caps:
276+
network:
277+
allow:
278+
- "claude.com:443"
285279
286280
credentials:
287-
sources:
288-
anthropic:
289-
env:
290-
- ANTHROPIC_API_KEY
281+
- service: anthropic
282+
apiKey:
283+
name: ANTHROPIC_API_KEY
284+
inject:
285+
- domain: api.anthropic.com
286+
header: x-api-key
287+
format: "%s"
288+
- domain: console.anthropic.com
289+
header: x-api-key
290+
format: "%s"
291291
```
292292

293293
Launch with the kit's `name:` as the agent argument to `sbx run`:

0 commit comments

Comments
 (0)