Docker Sandboxes mixin adding Cloudsmith artifact management (30+ package formats)
116
Adds Cloudsmith package/artifact management to any agent via the official cloudsmith CLI, wired to Cloudsmith's cloud API. Push, pull, list and manage packages across 30+ formats. Needs a key: sbx secret set cloudsmith (the kit holds no key).
| Name | Service | Required | Description |
|---|---|---|---|
CLOUDSMITH_API_KEY | cloudsmith | Optional | Cloudsmith API key (read + write) |
pypi.org
files.pythonhosted.org
api.cloudsmith.io
dl.cloudsmith.io
docker.cloudsmith.io
npm.cloudsmith.io
sbx run <agent> --kit docker.io/ajeetraina777/sbx-kits-cloudsmith:latestRun the following command to install sbx on your machine.
brew install docker/tap/sbxwinget install Docker.sbxA Docker Sandboxes mixin that gives any sandboxed agent the ability to publish and manage packages on Cloudsmith, the cloud-native artifact management platform across 30+ formats (Docker, npm, PyPI, Maven, Debian, RPM, Helm, Cargo, Go, NuGet, and more).
The mixin composes the sandbox's isolation + egress control with Cloudsmith's artifact API (diagram above):
cloudsmith CLI is pulled from PyPI, which the kit
allowlists.CLOUDSMITH_API_KEY is
the literal proxy-managed; the real key is never present.api.cloudsmith.io are checked against
the network allow-list, and the proxy-managed sentinel is swapped for your
real key, injected as Authorization: token <key>.dl/docker/npm registry hosts.cloudsmith CLI (cloudsmith-cli==1.26.0) into the sandbox.cloudsmith credential. The sbx proxy injects your API key as
Authorization: token <key> on requests to api.cloudsmith.io.CLOUDSMITH_API_KEY=proxy-managed in the container as a sentinel — the
real key never touches the sandbox; the proxy swaps it in on egress.api.cloudsmith.io, dl.cloudsmith.io, docker.cloudsmith.io,
npm.cloudsmith.io, plus PyPI to install the CLI).Store your Cloudsmith API key (found under User Settings → API in the Cloudsmith web app) once, out of the container image:
sbx secret set cloudsmith
Service secrets are global by default, so every sandbox can reuse it. The kit ships no key; it only declares where the proxy should inject the one you stored.
Org governance note: under a managed organization policy,
deny-allis the default and local kit rules cannot widen it. An administrator must explicitly allowapi.cloudsmith.io(and thedl/docker/npmsubdomains you use) in the org network policy.
Pick whichever agent you want (claude, codex, gemini, …) and one of the
three --kit forms:
# Published OCI artifact (primary — available the moment this repo publishes)
sbx run --kit docker.io/ajeetraina777/sbx-kits-cloudsmith:latest claude
# Straight from git
sbx run --kit "git+https://github.com/ajeetraina/cloudsmith.git" claude
# Local checkout
sbx run --kit ./cloudsmith/ claude
Inside the sandbox:
# i. CLI is present and on the expected version
cloudsmith --version # -> 1.26.0
# ii. The credential env var is the sentinel, not a real key
echo "$CLOUDSMITH_API_KEY" # -> proxy-managed
# iii. End-to-end: the proxy injects the real key on egress
cloudsmith whoami # -> your Cloudsmith username
If whoami returns your username, the proxy is injecting the stored key
correctly.
The agent can drive the CLI directly — the API key is handled by the proxy:
cloudsmith list packages OWNER/REPO # what's already there
cloudsmith push python OWNER/REPO dist/*.whl # publish a Python wheel
cloudsmith push docker OWNER/REPO image.tar # publish a Docker image tarball
cloudsmith status OWNER/REPO/<slug> # check sync status
OWNER is your workspace (organization) slug, REPO the repository slug. Run
cloudsmith push --help for the full format matrix.
401 Unauthorized / whoami fails — the key wasn't stored, or was stored
under a different service name. Re-run sbx secret set cloudsmith and check
sbx secret ls.403 / connection blocked — a required domain isn't allowed. Under a
managed org policy, ask an admin to allow the Cloudsmith domains (see the
governance note above). Check what the proxy blocked with
sbx policy log <sandbox>.sbx config forbids
mounting the agent home; recreate the sandbox without the conflicting mount, or
adjust the policy.