Skip to content

Commit 1840ddd

Browse files
authored
Merge pull request #25810 from dvdksn/fix/issue-434-credential-binding
docs: warn about extended-agent OAuth
1 parent bb1c8a0 commit 1840ddd

2 files changed

Lines changed: 37 additions & 5 deletions

File tree

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,26 @@ the child kit's name:
364364
$ sbx run claude-sonnet --kit ./claude-sonnet
365365
```
366366

367+
Proxy-managed OAuth isn't supported for a third-party kit that extends the
368+
built-in `claude` agent. Store an Anthropic API key on the host before the first
369+
launch:
370+
371+
```console
372+
$ sbx secret set anthropic
373+
```
374+
375+
When you launch the kit for the first time, `sbx` prompts you to approve its
376+
inherited Anthropic credentials. Because this is a third-party schema v2 kit,
377+
`sbx` records your approval as a
378+
[credential binding](../security/credentials.md#credential-bindings). The
379+
sandbox receives a sentinel value, and the proxy injects the real API key into
380+
requests to the domains declared by the kit.
381+
382+
> [!WARNING]
383+
> The approval prompt also lists OAuth, but OAuth doesn't work for the extended
384+
> agent. If you use Claude Code's `/login` command, Claude Code stores the real
385+
> OAuth tokens inside the sandbox.
386+
367387
OpenCode supports an additional config file through `OPENCODE_CONFIG`. Keep the
368388
kit's config separate from the sandbox-managed
369389
`/home/agent/.config/opencode/opencode.json`, for example at
@@ -431,7 +451,9 @@ sandbox:
431451
432452
The child inherits the built-in image, credentials, network permissions,
433453
persistent volumes, settings, MCP integration, and agent instructions. Its
434-
`sandbox.entrypoint` replaces the inherited entrypoint.
454+
`sandbox.entrypoint` replaces the inherited entrypoint. Proxy-managed OAuth
455+
isn't supported for the extended agent, so follow the
456+
[Anthropic API-key setup](#customize-agent-settings) before launching it.
435457

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

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ bindings:
317317

318318
A binding is only an approval record: the presence of `apiKey` or `oauth`
319319
authorizes that mechanism. Declining a credential writes no entry at all.
320+
The real credential isn't stored in this file.
320321

321322
### First-run approval
322323

@@ -340,10 +341,19 @@ constrain which requests can carry the credential.
340341

341342
Only third-party kits that declare `schemaVersion: "2"` require a binding.
342343
Built-in agents also use `schemaVersion: "2"`, but credentials declared only by
343-
embedded kits are authorized by provenance and inject automatically. If a
344-
third-party kit also declares the same service, that service requires approval.
345-
Kits on `schemaVersion: "1"` inject their declared credentials without a
346-
binding.
344+
embedded kits are authorized by provenance and inject automatically. A
345+
third-party kit that extends a built-in agent inherits its credentials, but not
346+
its built-in provenance. The inherited credentials therefore require approval.
347+
If a third-party kit declares the same service itself, that service also
348+
requires approval. Kits on `schemaVersion: "1"` inject their declared
349+
credentials without a binding.
350+
351+
> [!WARNING]
352+
> Proxy-managed OAuth isn't supported for third-party sandbox agents, including
353+
> kits that extend a built-in agent. Repeating the parent's OAuth declaration in
354+
> the child kit doesn't activate OAuth interception. Use a stored API key when
355+
> the service supports one. Otherwise, an OAuth login performed inside the
356+
> sandbox stores the real token there.
347357
348358
## Registry credentials
349359

0 commit comments

Comments
 (0)