Repository navigation
feat(sandbox-kit): port the kit to Docker Sandboxes v3 and inject the token via the egress proxy - #3854
Open
e00dan wants to merge 3 commits into
Open
feat(sandbox-kit): port the kit to Docker Sandboxes v3 and inject the token via the egress proxy#3854e00dan wants to merge 3 commits into
e00dan wants to merge 3 commits into
Conversation
… token via the egress proxy The kit is a v3 mixin on Docker's built-in claude agent, in devel/sandbox-kit/sbx-kit-claude/. - The Chainloop token stays on the host (`sbx secret set chainloop`) and the sbx egress proxy injects it; the chainloopToken and chainloopConfig arguments are removed. - The checks that refused to start an untraced agent run at `sbx create`. - The kit is published with `docker buildx` and signed with `sbx kit sign`, still as docker.io/chainloop/sbx-kit-claude. Requires sbx v0.55.0 or later. Refs: chainloop-dev#3836 Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com>
Contributor
PR validation — ✅ 3 passing
AI Session Checks —
|
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ GitHub Actions Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | ci-pipeline-security |
- |
✅ SAST Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
✅ IaC Scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | iac-misconfiguration |
- |
Scan not applied (1)
| Scan | Reason |
|---|---|
| Vulnerability Scan | no manifest/lockfile changed |
Powered by Chainloop and Chainloop Trace
Contributor
There was a problem hiding this comment.
3 issues found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="devel/sandbox-kit/README.md">
<violation number="1" location="devel/sandbox-kit/README.md:97">
P2: `CHAINLOOP_PLATFORM_API` is ignored by the Chainloop CLI used in this sandbox, so this self-hosted command does not configure its platform endpoint. Remove this option or add corresponding CLI support before documenting it here.</violation>
</file>
<file name="devel/sandbox-kit/sbx-kit-claude/spec.yaml">
<violation number="1" location="devel/sandbox-kit/sbx-kit-claude/spec.yaml:66">
P1: The credential is runtime-only, but the install hook checks its environment before the runtime phase exists, so every normal `sbx secret set chainloop` run is rejected as having no credentials. Declare an install-phase credential as well (with the required install policy) or move this credential check to a runtime lifecycle hook.</violation>
<violation number="2" location="devel/sandbox-kit/sbx-kit-claude/spec.yaml:71">
P2: Older configs targeting `api.cp.chainloop.dev` can reach the allowlisted host but never receive the Chainloop bearer token because the inject list omits that exact domain. Add `api.cp.chainloop.dev` to the credential injection mappings.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
release.yaml runs the script by path; the previous commit dropped its executable bit by mistake. Assisted-by: Claude Code Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com>
Without TLS the CLI needs CHAINLOOP_API_INSECURE=true. On Linux the sbx daemon only picks up a newly trusted CA after a restart; until then the proxy answers 502. Signed-off-by: Daniel Kmak <4950658+e00dan@users.noreply.github.com>
jiparis
approved these changes
Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3836
Why
sbxv0.51.0 moved its built-in agents to v3 kits and droppedextends: claude, soevery current
sbxrefuses the v2 kit (extends: "claude" is no longer a built-in agent).because the egress proxy could not inject credentials into gRPC.
sbxv0.55.0 fixes that(Secret injection downgrades intercepted hosts to HTTP/1.1 (no h2 in ALPN), breaking gRPC clients docker/sbx-releases#574), which is what chore(sandbox-kit): use egress proxy credential injection for the Chainloop token #3836 asks for.
How
claudeagent (devel/sandbox-kit/sbx-kit-claude/):sbx run --clone claude --kit chainloop/sbx-kit-claude .sbxsecret (sbx secret set chainloop). The sandbox sees a placeholder and theegress proxy adds the real value on the control plane and platform hosts, never on the CAS, which uses its own
token from the control plane.
sbx createfails instead.chainloopTokenandchainloopConfigare removed. Achainloop auth loginsession works through acommand-backed secret; a self-hosted control plane through
sbx secret set-customand theCHAINLOOP_*_APIvariables.
sbx kit push(v2 only) todocker buildx, signed withsbx kit sign, under the sameimage name.
sbxenv.yamland the README follow.Why a mixin, not a set or a workload
sbx run claude --kit …sbx run chainloop/sbx-kit-claudesbx run chainloop/sbx-kit-claudeanthropicbindingThe mixin keeps Docker in charge of Claude Code and its login, which is what
extends: claudedid. The cost isa second name on the command line and checks at create rather than at launch; in a
--clonesandbox the repo andthe credential are fixed at create anyway.
v2 kit vs this kit
sbx≤ v0.50)sbx≥ v0.55)sbx run --clone -e CHAINLOOP_TOKEN ./devel/sandbox-kit/claudesbx run --clone claude --kit ./devel/sandbox-kit/sbx-kit-claude .sbx secret set chainloop, applies to running sandboxesconfig.toml, copied into the sandboxconfig.tomlsbx secret set-custom+CHAINLOOP_*_APINO_PROXY)sbx createanthropicbindingsbx kit push --signdocker buildx+sbx kit sign, same image nameNotes for reviewers
sbxv0.55.0 stable, which is not released yet;SBX_VERSIONin the publish workflow points at it. Tested on v0.55.0-rc5 (macOS and Linux), including a full publish run in a fork; to be re-checked on v0.55.0 once it ships.main:chainloop attestation initstops with "creating workflows during theattestation process is disabled for this organization", because the
sandbox-kit-packageworkflow does notexist in the
chainlooporg. This PR keeps that step; creating the workflow (or allowing it) is up to themaintainers.
chainloop/sbx-kit-claude:latestto the v3 kit;:latestmoves only after thedigest is signed.
-eis refused when nochainloopsecret is stored:sbxdrops it atthe proxy, although the v3 spec says an unbound optional credential is
skipped.
sbx secret setaccepts an empty value, and the install check sees only that a secret is bound, not its value, so an emptychainloopsecret passes at create (v2 refused an empty token). As with an expired or wrong token, Claude's session-start banner then reportsChainloop Trace cannot upload this session when you push: your authentication token is invalid…, andgit pushwarns and goes through, or is blocked with--require-trace.sbx kit sign, per Docker'sdistribution guide;
sbxdoes notverify cosign signatures.
This change was prepared with AI assistance (Claude Code).