Docker Sandboxes kit for Traces
306
sha256:35a1fba62e4e…
1 kB
5 months ago
Source repo for the Traces Docker Sandboxes kit.
docker.io/tracesdotcom/traces-sbx-kit:0.1.0docker.io/tracesdotcom/traces-sbx-kit:latestAgent-readable reference repo for building and publishing Docker Sandboxes kits.
The included kits/traces directory is a prototype mixin kit that adds
Traces sharing support to existing Docker Sandbox agents.
Docker Sandboxes kits are experimental. Re-check the Docker docs before making breaking changes: https://docs.docker.com/ai/sandboxes/customize/kits/
kits/
└── traces/
└── spec.yaml # Docker Sandboxes mixin kit for Traces
Prerequisites:
brew install docker/tap/sbx
sbx daemon start --detach
sbx login
Configure a host-side Traces API key. The real key stays on the host; the
sandbox only sees Docker's proxy-managed sentinel value.
echo "$TRACES_API_KEY" | sbx secret set -g traces
Create a sandbox with the kit:
sbx run claude --kit docker.io/tracesdotcom/traces-sbx-kit:0.1.0 .
# Or from this repo checkout:
sbx run claude --kit ./kits/traces .
For a running sandbox while iterating on the kit:
sbx kit add <sandbox-name> ./kits/traces
Inside the sandbox, share the current session:
traces share --cwd "$PWD" --agent auto --json
Agents should parse the JSON and return data.sharedUrl to the user.
/usr/local/bin.traces setup skills --global for Traces-supported agents.traces credential service and maps it to the outbound
Authorization header for actions.traces.com and api.traces.com.TRACES_API_KEY=proxy-managed inside the VM; Docker's host-side proxy
replaces the outbound auth header with the real host-side secret.When an agent is asked to create or update one of these kits, follow this checklist.
mixin unless you are defining a whole agentUse a mixin kit for add-ons: CLIs, team config, credentials, network access, skills, helper scripts, linters, etc.
Use an agent kit only when defining the complete agent runtime: image, entrypoint, persistence, and launch command.
For Traces, use kind: mixin because Traces extends existing agents.
my-kit/
├── spec.yaml # required
└── files/ # optional static files
├── home/ # copied to /home/agent/
└── workspace/ # copied to the primary workspace
Required top-level fields:
schemaVersion: "1"
kind: mixin
name: lowercase-hyphen-name
displayName: Human Name
description: Short description
Install commands run once during sandbox creation. Startup commands run every
start. Use initFiles for files that need runtime substitution such as
${WORKDIR}.
commands:
install:
- description: Install a tool
user: "0"
command: "apt-get update && apt-get install -y jq"
startup:
- description: Start a background daemon
user: "1000"
background: true
command: ["sh", "-c", "my-daemon &"]
initFiles:
- path: /home/agent/.my-tool/config.json
content: '{"workspace":"${WORKDIR}"}'
onlyIfMissing: true
Use UID 0 for root installs and UID 1000 for the agent user.
environment.variablesUse Docker Sandboxes credential proxy wiring instead:
network:
allowedDomains:
- api.example.com
serviceDomains:
api.example.com: my-service
serviceAuth:
my-service:
headerName: Authorization
valueFormat: "Bearer %s"
credentials:
sources:
my-service:
env:
- MY_SERVICE_API_KEY
environment:
proxyManaged:
- MY_SERVICE_API_KEY
The sandbox sees MY_SERVICE_API_KEY=proxy-managed. Requests to
api.example.com get the real host-side secret injected by Docker's proxy.
Host setup:
echo "$MY_SERVICE_API_KEY" | sbx secret set -g my-service
Every domain needed by install commands and runtime commands must be in
network.allowedDomains. For authenticated domains, also add serviceDomains
and serviceAuth.
Keep rules narrow. Prefer exact hosts over broad wildcards.
Top-level memory: | is appended to the agent's memory file when the base
agent kit defines agent.aiFilename. Keep it short and action-oriented.
sbx kit validate ./kits/traces
sbx kit inspect ./kits/traces
Package for sharing:
sbx kit pack ./kits/traces -o dist/traces-kit.zip
Kits can be loaded from:
Recommended model:
spec.yaml, docs, examples, and
review history here.For public kits, Git URLs or GHCR are fine. Docker Hub still makes sense if you
want the most Docker-native install path and private-kit compatibility later.
Use the full docker.io prefix for Docker Hub references.
Example publish flow:
sbx kit validate ./kits/traces
sbx kit push ./kits/traces docker.io/tracesdotcom/traces-sbx-kit:0.1.0
sbx kit push ./kits/traces docker.io/tracesdotcom/traces-sbx-kit:latest
Example use from Docker Hub:
sbx run claude --kit docker.io/tracesdotcom/traces-sbx-kit:0.1.0 .
Avoid mutable-only distribution. If you publish latest, also publish a
versioned tag like 0.1.0.