Generated banner for Docker Sandboxes Kits
Generated logo for Docker Sandboxes Kits

Docker Sandboxes Kits

DockerOfficialPublished by Docker

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Use this skill when authoring, verifying, publishing, or composing a Docker Sandboxes kit, even if the user just says they want to "add a tool to a sandbox agent", "package a CLI or agent as a kit", "publish a kit to a registry", or "give a mixin its own credentials and network access". Covers the v3 kit descriptor (`# syntax=docker/sandbox-kit:3`, `kind: workload` or `mixin`, typed capabilities, provides/requires, content recipes), building with docker buildx, checking with kit-tck and `sbx kit inspect`, composing onto a workload, and publishing and signing. Legacy v2 `spec.yaml` kits are not covered; `sbx kit validate` is not a substitute for kit-tck conformance and runtime checks.
— the description by Docker

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides guidance for working with Docker Sandboxes Kits v3, which are OCI images containing a descriptor that defines capabilities, requirements, and content recipes. It covers the v3 descriptor format, building with Docker Buildx, conformance testing with kit-tck, and composing kits onto workloads. It specifically excludes legacy v2 spec.yaml kits and focuses on the v3 workflow for creating mixins and workloads that extend sandbox functionality.

What it does

  • Authors v3 kit descriptors using the docker/sandbox-kit:3 syntax
  • Defines typed capabilities for network access, credentials, and host mounts
  • Builds and validates kits using Docker Buildx and kit-tck
  • Composes kits onto sandbox workloads for runtime testing
  • Provides patterns for content recipes and overlay ownership
  • Guides the publishing and signing process for kit images

When to use it

  • When packaging a CLI or agent as a reusable sandbox kit
  • When adding tools, credentials, or policies to an existing sandbox agent
  • When converting a legacy v2 kit to the v3 descriptor format
  • When defining capability requests for a kit to ensure least-privilege access

Advantages

  • Ensures strict descriptor validation to prevent silent policy failures
  • Supports modular composition of mixins onto base workloads
  • Provides a clear path for conformance testing before deployment
  • Enables granular control over host capabilities and environment variables

Usage examples

“How do I create a new mixin kit for a CLI tool?”
The agent will guide you through creating a kit directory with a v3 YAML descriptor and a Dockerfile recipe, defining the necessary network policies and capabilities.
“How do I validate my v3 kit before publishing?”
The agent will provide the commands to build the kit using Docker Buildx and run the kit-tck validation tool against the resulting OCI layout.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/docker/docker-sandboxes-kits/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip docker-sandboxes-kits.zip -d .agents/skills

Documentation by Docker

Docker Sandboxes: Kits (v3 descriptors)

Overview

A kit extends a sandbox with a tool, an agent, credentials, or policy. In v3 a kit is one OCI image: its layers are the content, and a manifest annotation carries the descriptor, which says what the kit offers, what it needs from the host as typed capability requests, and what it needs from other kits. An engine that does not read the annotation runs it as an ordinary image.

The source is a <kit>.yaml whose first line is # syntax=docker/sandbox-kit:3 with schemaVersion: "3", usually beside a <kit>.dockerfile content recipe. The kinds are workload, mixin, and set (a list of other kits). Build and check with docker buildx build, kit-tck validate, sbx kit inspect, and a real sbx run composition.

Scope and guardrails:

  • Legacy v2 spec.yaml kits (schemaVersion: "2", kind: sandbox) are not covered here. This is the skill's routing boundary, not a claim that v2 has been deprecated or removed. This skill neither authors nor debugs them. If the user has one, say so and offer to write the v3 equivalent as a new descriptor (see "Migrating from v2").

  • sbx kit validate is not a conformance check. The v0.50.1 code supplies a v3 builder to both normal validate and inspect. Both need an authenticated daemon; --offline deliberately omits the builder and rejects v3 source kits. A normal validate success is therefore allowed, but does not replace kit-tck or real runtime composition.

  • Do not carry v2 vocabulary into v3: name, sandbox:, permissions.network, credentials:, setup.*, and --kit-arg are not v3 fields, and v2 composition rules (additive allow lists, duplicate-service credential failures) are not established for v3.

  • This skill is experimental. The source calls the schema-3 grammar unfinished and says the Go implementation wins over its docs, so re-check fine details against the spec before relying on them.

  • No minimum sbx version for Kits v3 is established by the source, which says only that current stable releases support it in local and cloud mode. Check the installed sbx rather than assuming.

When to use this skill

Activate this skill when:

  • The user wants to create a new kit: package a CLI or agent as a kit, add a tool, credential, or policy to an existing agent, or add a -mixin variant.

  • The user asks what a kit descriptor should contain, whether to write a workload or a mixin, or which capabilities a kit should request.

  • The user wants to pin a tool version, declare provides/requires, or write the content recipe (<kit>.dockerfile) for a kit.

  • The user wants to build, check, publish, or sign a kit, or to compose a built kit onto a workload and test it.

  • The user has an existing v2 spec.yaml and wants it converted to v3.

Do not use this skill when

Do not use this skill when:

  • The task is creating, running, or removing the sandbox a kit is composed into, independent of the kit's own content — use docker-sandboxes-lifecycle.

  • The task is what a credential or network rule actually does at runtime (proxy injection, allow/deny precedence, the policy a sandbox currently has), where a user stores a secret value, or secrets and policy unrelated to any kit — use docker-sandboxes-network-credentials.

  • The task is the sbxenv.yaml file that references kits through its own kits: block — use docker-sandboxes-env (this skill still owns what goes inside the referenced kit).

  • The task is general Dockerfile or image-build optimization unrelated to a kit's recipe — use docker-build-strategies.

  • The task is to author, validate, or debug a legacy v2 spec.yaml. It is out of scope; offer migration instead.

  • The task is a bulk migration of v2 kits to v3. The source names a migrate-kit-to-v3 skill and a field-by-field mapping, but that skill is not part of this catalog and may not be installed; do not route to it unless it is available. See "Migrating from v2" below.

Core guidance

v3: choose workload or mixin first

Everything else follows from the kind.

kind: workloadkind: mixin
Layers area root filesysteman overlay landing on a workload
Per compositionexactly onezero or more
Ownsentrypoint, env, user, workdir, a legacy context profileenv, labels, ports and volumes, which merge; an agent mixin can select an explicit context profile
Must have contentyesno — may be declaration-only
  • Write a workload when you own the environment the agent runs in. Write a mixin when you add a tool, a credential, or a policy to somebody else's. Most new kits should be mixins; a tool worth shipping as a workload is usually worth shipping as both (the source's claude and claude-mixin examples are that pair).

  • A mixin cannot set ENTRYPOINT, CMD, USER or WORKDIR and have it take effect: the workload anchors the composition and owns those fields. The additive fields merge (env, labels, ports, volumes), so a mixin's ENV reaches the composed image and PATH is appended rather than replaced.

  • Prefer ENV for static environment: it is what the agent process sees, whereas profile and rc files do not run for the agent, so an /etc/profile.d/<kit>-env.sh drop reaches a terminal the user opens but not the agent. Use profile.d only when two mixins might set one variable to different values (a hard composition failure) or the value only makes sense in an interactive shell.

v3: layout and descriptor

The default form is a companion pair found by filename stem: <kit>/<kit>.yaml (first line # syntax=docker/sandbox-kit:3) and <kit>/<kit>.dockerfile (omitted for a declaration-only mixin). Every key is lowerCamelCase, and decoding is strict: an unrecognized key is an error, deliberately, because a silently ignored misspelling would be a policy silently absent.

  • assets/v3-mixin-egress.yaml is a complete declaration-only mixin. Its build and all 19 layout conformance checks passed on 2026-11-02; runtime composition initially failed on v0.50.1 because agent-context@2 was required. The explanatory note is now optional; the network request remains required. Corrected composition and npm HTTPS access passed under the test host policy. See checks/authenticated-results.md for scope and limits.

  • references/v3-capabilities.md has the annotated descriptor skeleton, the other authoring forms, and every capability type with its common mistakes.

v3: capabilities — least privilege, and the rules most often missed

A capability is a typed request the host answers. The default is required and fails resolution closed; optional: true means the kit degrades without it. Request only what the kit needs. The rules below prevent the most common failures; the full table is in references/v3-capabilities.md.

  • network-policy@1 is phase-scoped: an absent phase grants nothing. Install-hook hosts go in install, runtime hosts in runtime, shared hosts in both. network-policy@2 bounds by HTTP method and path, is exclusive with @1, and its bound should be verified on the target runtime before it is treated as a security boundary.

  • credential@1 entries are required by default; add optional: true unless the kit cannot run unauthenticated. Every inject[].domain must appear exactly in each listed phase's allow list; a wildcard does not satisfy a specific subdomain. Never put secret values in a descriptor, arg, or recipe.

  • ssh-agent@1: set unrestricted: false and bound it (sign: [git], authenticate: [[email protected]]); the default signs anything with every key the user's agent holds. Prefer credential@1 over HTTPS when a token will do.

  • lifecycle@1 hook environments are deny-by-default; declare every variable a hook or its child processes read, including HTTP_PROXY/HTTPS_PROXY.

  • privileged@1, host-mount@1, host-port@1 and dockerd@1 widen what the kit can touch. Do not declare them on speculation; host mounts are shared with the host user and survive sandbox removal.

  • Verify every flag in agent-sessions@1 and agent-interactive-sessions@1 against the tool's real CLI; never invent one.

v3: versions, provides, and requires
  • Pin the tool once. Declare a build-phase version arg, wire it through to the installer, and reference it from both provides and the top-level version:, so one value drives the install, the matchable capability, the published version, and the tag.

  • A pinned provide is a claim about content, so make the build enforce it: re-read the installed version and fail on mismatch. Pinning the provide without pinning the install is worse than floating.

  • An unversioned provide is not a resting place. Under version: "1.0.0" it publishes <tool>@1.0.0, the kit's release number wearing the tool's name; with no version: the build fails. Pin it, or drop the provide.

  • requires is a closed-set check. A name nothing in the composition provides makes the kit refuse to compose anywhere. It constrains the composed runtime, not your build stage. Never require the platform floor (bash, sh, curl, git, a CA store, the agent user at uid 1000), and do not try to express a conditional dependency: let the hook probe and fail with an actionable message. The test is "what must already be present, on every base, for this kit to work at all"; usually that is nothing.

  • Where a requirement is real, use deb/ names (derived from a workload's dpkg database; on multi-platform workloads, the intersection across platforms), and never author a deb/ provide yourself.

v3: content recipes

Recipes for both kinds, the overlay ownership rules, the virtualenv trap, and the audit are in references/v3-recipes.md. Read it before writing a mixin: overlay ownership is the most common way a working-looking kit is broken. In short: a mixin overlay stages under /out and copies into scratch, keeps out of /home/agent where it can, and states numeric ownership for every directory level it ships (/home root-owned, /home/agent uid 1000).

v3: build, run, and verify

Create a named container builder once and select it for exports and publication. The docker driver with the classic image store can drop manifest annotations, leaving an image that is no longer a kit.

docker buildx create --name kit-builder --driver docker-container --bootstrap
# Run from the parent of <kit> and <workload>; subshells preserve that directory.
# 1. validate — the descriptor is checked before content is built. cacheonly
#    drops the EXPORT, not the build: once valid, the whole recipe still solves.
(cd <kit> && docker buildx build --builder kit-builder . \
  -f <kit>.yaml --output type=cacheonly)

# 2. build, exporting a layout so kit-tck can judge it without a registry
(cd <kit> && docker buildx build --builder kit-builder . -f <kit>.yaml -t <kit>:<version> \
  --output type=oci,dest=/tmp/<kit>-layout,tar=false)

# 3. conformance — the tag alone, not <kit>:<version>
kit-tck validate --layout /tmp/<kit>-layout <version>

# 4. run it, no registry needed
sbx run ./<kit> .                          # a workload
sbx run ./<workload> --kit ./<kit> .       # a mixin, composed
sbx kit inspect ./<kit>                    # requires authenticated daemon; see below
  • --app-name isolates the Docker login store as well as daemon state. Sign in explicitly to the test app before normal source inspection. --offline is not an auth workaround for v3 sources: it deliberately disables the builder to keep the command daemon-free. The observed offline rejection is expected, not evidence that normal inspect is broken.

  • v0.50.1 inspection shows a legacy-shaped summary, not the raw descriptor. Use kit-tck inspect --descriptor --layout <layout> <tag> to read the typed requests. Do not copy sbx kit inspect --format json output as v3 YAML.

  • v0.50.1 supports v3 kits but not agent-context@2 at composition time. Only mark this request optional when its guidance is nonessential, as in the egress asset; otherwise use a host with explicit support. Successful inspection/validation does not prove required capability availability.

  • A build is not proof the kit works. For a mixin, compose the built overlay onto a real workload and run the tool with sbx exec <sandbox> <tool> --version. Arguments after -- on sbx run are agent arguments, so they never execute the overlay's binary. Details and the ownership audit are in references/v3-recipes.md.

  • Inside a sandbox the kit is self-describing: /usr/share/sandbox/kit/<kit>/kit.yaml is the published descriptor, kit.dockerfile the recipe, and /var/log/sbx-kit-startup.log the startup hook output.

  • Local recipe builds use host Docker Buildx when available, otherwise the shared builder sandbox; see references/v3-publish-and-sign.md for the BUILDX_BUILDER and SBX_KIT_BUILDER selectors.

  • Install kit-tck from a pinned release or commit, not @latest, and record which one you used. The source's go install line uses @latest.

v3: publish and sign

Publishing is the build with --push: there is no pack step and no kit push subcommand. Push both platforms in one invocation, tag the version and latest together, and run kit-tck validate on the pushed reference. Signing is optional: sign the digest from --metadata-file, never the tag, and pin the whole certificate identity (repository, workflow file, and ref), not an organization prefix. Commands and reasoning are in references/v3-publish-and-sign.md.

A push writes to a registry and this skill cannot undo it. Get explicit approval for the exact registry, repository, and tags first, and use a scratch namespace for trials.

Safety boundaries and inverse operations
  • Never run source examples blindly. Build, run, push, and sign commands here are templates with placeholders; the operator runs them against disposable resources.

  • Inverse operations are destructive and need explicit confirmation: the named builder is removed with docker buildx rm kit-builder, a test sandbox with sbx rm (flags in docker-sandboxes-lifecycle), and local test images with docker rmi (see docker-destructive-guardrails). Name only what you created. Removing a sandbox instance deletes its volumes; host-mounted data survives and stays visible to the host user.

  • Keep descriptors, args, recipes, and build output free of secrets. Use credential@1 for credentials and let the host answer it.

  • A registry push, a tag move, and a signature are not reversible by this skill. State exactly what was pushed and signed.

Migrating from v2

The v2-to-v3 field mapping is not part of the supplied source material, so this skill does not map fields; do not guess one. For a request to convert a v2 spec.yaml: confirm the installed sbx can read v3, keep the v2 kit only as a reference for intent, and write the v3 kit as a new descriptor using the sections above. Check it with the v3 workflow (buildx, kit-tck, a real composition); do not substitute sbx kit validate for those checks. If the migrate-kit-to-v3 skill or its mapping is available in the user's environment, use it as an additional reference and say that it came from outside this catalog.

  • For the sandboxes a kit is composed into (sbx create/run --kit, and removing a test sandbox), use docker-sandboxes-lifecycle.

  • For what a kit's credential and network declarations mean at runtime (proxy injection, allow/deny precedence, the effective policy once global or per-sandbox policy is included, where the user stores a secret value), use docker-sandboxes-network-credentials. That skill's vocabulary is v2-era; for v3, the capability rules in this skill apply to what a kit asks for.

  • For the sbxenv.yaml file whose kits: and agent: fields reference a kit, use docker-sandboxes-env.

  • For Dockerfile and build practices beyond kit recipes, use docker-build-strategies.

  • Before removing builders, images, or volumes created while testing a kit, use docker-destructive-guardrails.

References

  • references/v3-capabilities.md — v3 descriptor skeleton, authoring forms, every capability type with common mistakes, volume and host-mount semantics, groups, and final-environment references.

  • references/v3-recipes.md — workload and mixin overlay recipes, ownership rules, and how to verify an overlay.

  • references/v3-publish-and-sign.md — publishing with buildx, tagging, cosign signing and verification, and tooling notes.

  • references/sources.md — provenance, unverified claims, and conflicts.

Assets

  • assets/v3-mixin-egress.yaml — a complete declaration-only v3 mixin (schemaVersion: "3") with a required network-policy request and optional explanatory agent context.

Checks

  • checks/verification.md — a manually exercised v3 runbook (inspect, buildx descriptor check, kit-tck, strict decoding, daemon-backed validation versus offline rejection, optional composition, scoped cleanup). It uses isolated names and no registry publishing or signing.

  • checks/runtime-results.md — 2026-11-02 commands, output, versions, pass/fail results, and the source-inspection limitation.

  • checks/authenticated-results.md — authenticated A2/A6/A7, original failures, descriptor correction, successful runtime checks and cleanup.

  • scripts/audit-layer-owners.py — fail-closed numeric ownership inventory of manifest-referenced OCI layers (Python 3.11+; uncompressed/gzip layers).

Files

references/v3-capabilities.md

v3 descriptor and capabilities

Adapted from the create-kit-v3 skill in docker/sandbox-kit-spec at 4d932451613f8df89c8468e2bb7c5286882897ca. Claims here rest on that source and the pinned public spec. Only the bundled egress example was exercised on a live sbx; see sources.md for the cross-check and limits. Section numbers (§) refer to SPEC-v3 as cited by the source.

The source describes the schema-3 grammar as unfinished, and says that where the docs and the Go implementation disagree, the code wins. Treat fine details as provisional and re-check the spec before depending on them.

Authoring forms and layout

A kit is one OCI image. Its layers are the content and a manifest annotation carries the descriptor: what the kit offers, what it needs from the host as typed capability requests, and what it needs from other kits. An engine that does not read the annotation runs it as an ordinary image.

The default authoring form is a companion pair found by filename stem:

<kit>/
  <kit>.yaml           # the descriptor; first line `# syntax=docker/sandbox-kit:3`
  <kit>.dockerfile     # the content recipe (omit for a declaration-only mixin)
  README.md

No dockerfile: field is needed. Three other forms exist: an inline build: block, a # kit: comment descriptor inside a Dockerfile, and a kind: set list of other kits (SPEC-v3 §3). For a complete declaration-only mixin, see assets/v3-mixin-egress.yaml.

Descriptor skeleton

This is a fragment, not a complete kit: it needs a companion <kit>.dockerfile whose ARG GH_VERSION receives the buildArg and installs that exact release. The companion recipe was not part of the source, so none is shown for gh; use the overlay pattern in references/v3-recipes.md.

# syntax=docker/sandbox-kit:3
schemaVersion: "3"
kind: mixin
displayName: GitHub CLI
description: gh, installed from the official release tarball
sourceUrl: https://github.com/cli/cli
licenses: [MIT]

# One value drives the install, the provide, the published version and the tag.
version: "${{ kit.args.version }}"

args:
  version:
    default: "2.98.0"
    pattern: '^[0-9]+\.[0-9]+\.[0-9]+$'
    description: GitHub CLI release to install
    buildArg: GH_VERSION

provides: ["gh@${{ kit.args.version }}"]
# No requires: this overlay ships a release tarball and needs nothing from the
# workload. Add entries only for what the composed runtime must already have.

capabilities:
  - type: com.docker.sandbox/network-policy@1
    config:
      runtime:
        allow: [github.com, api.github.com]

  - type: com.docker.sandbox/agent-context@2
    config:
      content: Use gh for GitHub operations.

Every key is lowerCamelCase with acronyms title-cased (sourceUrl, apiKey). Decoding is strict: an unrecognized key anywhere is an error, so a misspelled key cannot silently leave a policy absent.

Capabilities

An optional entry-level name gives a short display label and description its explanation. Names may contain spaces and need not be unique; they change no identity, permission, or merge key. When entries merge, the first nonempty label in contribution order wins. This label is separate from config fields such as apiKey.name.

A capability is a typed request the host answers. optional: true means the kit degrades without it; the default is required, which fails resolution closed. Read the capability page for each type you emit; each is normative for its config and for what a runtime must do. Types below are written without their com.docker.sandbox/ prefix.

TypeUse it forEasy to get wrong
network-policy@1egress by hostPhase-scoped: an absent phase grants nothing. Hosts your install hooks reach go in install, hosts the running agent (or a startup hook) reaches go in runtime, hosts both reach go in both.
network-policy@2egress bounded by HTTP method and pathSame phases, plus entries that grant only matching requests. Pick @2 when a host should carry one API and not the rest; stay on @1 when host alone is the grant. Exclusive with @1: declaring both is an error, and a bounded allow entry must name its hosts literally. Verify the bound you rely on: declare the tightest correct policy, but confirm against your target runtime which parts it enforces before treating one as a security boundary. A refusal is a 403 from the boundary, which an origin can also return, so test a case the origin would allow.
credential@1one service's authEntries are required by default; add optional: true unless the kit genuinely cannot run unauthenticated. phase accepts a single phase or [install, runtime] with shared configuration. Every inject[].domain must appear in every listed phase's allow list, matched exactly: a *.example.com wildcard does not satisfy api.example.com.
ssh-agent@1git over SSH, SSH commit signingSet unrestricted: false to bound it. sign: [git] is all commit signing needs; authenticate: [[email protected]] is a login to one server. An entry with unrestricted: true (the default) signs anything with every key the user's agent holds: declare that only when a client cannot bind sessions (OpenSSH can), and prefer credential@1 with HTTPS when a token will do. optional: true unless the kit cannot work without it, since many users have no agent running. A hook that uses it declares SSH_AUTH_SOCK in env:, and only hooks of the granted phase get it. authenticate grants a signature, not a connection: the server must also be reachable under the network policy. phase accepts a single phase or [install, runtime] with shared rules. Commit signing needs git config too (gpg.format=ssh, gpg.ssh.defaultKeyCommand="ssh-add -L").
lifecycle@1install/startup hooks, staged filesHook environments are deny-by-default. Declare every variable in env:, including ones only a child process reads: curl, pip and npm need HTTP_PROXY/HTTPS_PROXY, and docker needs DOCKER_HOST.
volume@1persistent pathsDeclare needed capacity with size; omission leaves it unspecified and conflicts with another kit's explicit request. Retained volume settings cannot change on recreation.
host-mount@1host-shared caches, datasets, or artifactsDeclare only the absolute, canonical in-container path and optional octal mode. The runtime owns the host location. Data is shared across sandboxes of the declaring kit, survives sandbox removal, and is visible to the host user. Use an optional group to couple cache setup with the mount.
agent-context@2inline instructions the agent readsv0.50.1 rejects required requests at composition time. Use a supporting host, or optional: true only for nonessential guidance. Use content: for every body; contentFile is rejected. Profile destinations and precedence match @1, but every effective profile contains all selected guidance and the runtime materializes it directly. Kit args and final kit.env references expand normally; shell variables remain literal. Do not mix selected @1 and @2 requests. Rebuild every member of a migrated set. The serialized descriptor warns above 64 KiB and fails above 512 KiB after expansion and composition.
agent-context@1legacy progressive instructions the agent readsA workload can supply the legacy workspace-sibling filename. An agent workload or mixin supplies filename plus an absolute directory at its discovery location, which overrides the legacy fallback. Different explicit destinations each get a profile, so agent mixins stack. Tool mixins contribute bodies alone. Use contentFile: for a static body, but inline content: when the body interpolates an arg, because a staged body is never arg-expanded.
long-running@1workloads or service mixins that outlive client sessionsConfig-less; a request from any kit applies to the whole sandbox. A background hook or published port does not prevent session auto-stop. Required by default; use optional: true only if auto-stop is tolerable. This does not request restart after failure.
git-identity@1commits attributed to the runtime-provided userConfig-less; requests only user.name and user.email, not a configuration-source mount. Requires permission; optional when missing identity is tolerable. Signing and authentication are separate grants.
sbx@1"launch this as an agent"Workload-only and config-less, and enforced: a mixin declaring it fails validation.
agent-skill@1one bundled skillpath names the image directory containing SKILL.md and supporting files. The basename is the discovery name unless config.name overrides it; the entry-level name remains only a display label.
agent-skills@1where an agent discovers skillsDeclare on the agent workload or agent mixin. The runtime links or otherwise exposes every selected agent-skill@1 bundle here, and includes host-shared skills when available and enabled. Missing host skills never block startup; mode bounds host-store access only.
acp@1how to run an ACP agentDeclare on the kit that supplies the launch command, workload or mixin. agent is its unversioned provides name; another composed kit may provide it. command is a complete non-TTY stdio command, never an argv tail. env overlays the session environment; positive protocolVersion defaults to 1 and names the protocol major version, not a package release. Use optional: true for older hosts. Different configs for one normalized agent conflict.
agent-sessions@1the headless verbs a harness drives (run one prompt, continue, resume, list)Argv tails appended to the launch argv; prompt must reference {{.Prompt}} and resume {{.SessionID}}. Most agent kits declare both this and agent-interactive-sessions@1; an agent with no interactive mode declares only this. Verify every flag against the tool's real CLI; never invent one.
agent-interactive-sessions@1the TUI verbs a human-facing host launches (seeded prompt, continue, resume, session picker, list)The sibling of agent-sessions@1 for an agent whose CLI has an interactive mode. Presence is meaning: a present key is supported, an absent key is not, and for continue, newSession and sessionPicker [] is the launch argv alone (prompt and resume carry their placeholders, so they are never empty). newSession is the exception: omit it when a bare launch opens the TUI, because it then defaults to lifecycle@1's interactive launch; if you state both newSession and interactive they must be the same argv, an explicit [] included. list is the same command as in agent-sessions@1. Declare only verbs you verified.
host-port@1one host loopback TCP or UDP servicehost is required (1-65535); container defaults to host (also when zero); transport is tcp (default when empty) or udp. family selects host loopback: ipv4 (default), ipv6, or dual when either reaches the same service; it is part of the grant. The sandbox endpoint stays IPv4 loopback. A mapping conflicts with port@1 on the same sandbox port and transport. This grants raw access to a host service, not general egress or a published guest port.
dockerd@1a Docker Engine (Docker-in-Docker)Singleton; any kind may declare it. Omit config to have the runtime start the engine; autoStart: false leaves starting it, waiting for GET /_ping to return 200, and the socket's permissions to the kit's own root startup hook, with the same elevation and store (and no wider surface). When kits disagree, the merged entry starts it, so that hook must tolerate an engine already running. Engine settings go in the image's /etc/docker/daemon.json. It counts as privileged@1 plus storage at /var/lib/docker on the permission surface, so declaring privileged@1 beside it is redundant, not refused. By default the runtime starts the dockerd on the composed image config's PATH before startup hooks and owns /var/lib/docker: a volume@1 or host-mount@1 at or under it is refused. It does not install the engine; a mixin relying on the workload's keeps requires: ["deb/docker-ce"]. Use the com.docker.sandboxes.start-docker label only as a transition, beside an optional dockerd@1, for runtimes that predate it.
port@1, resources@1, privileged@1inbound ports, limits, elevationDo not declare on speculation; privileged@1 is the largest widening available. For an engine inside the sandbox, declare dockerd@1 instead.

Declare the least that works: every required capability is a request the user or host must answer, and privileged@1, host-mount@1, host-port@1, ssh-agent@1 with unrestricted: true, and dockerd@1 widen what the kit can touch. Do not put secret values in a descriptor, arg, or recipe; ask for the credential with credential@1 and let the host answer it.

Volumes and host mounts

Host sharing is a separate grant from volume@1, including when the in-container path stays the same. Do not supply a host path or assume a Linux bind mount: runtimes may use VM filesystem sharing. Host-shared directories may have weaker filesystem semantics than private volumes. Concurrent writers coordinate access themselves. The initial mode does not reset existing directory permissions on later creates. Two host mounts at one path, or a host mount and a volume there, conflict.

Matching volume requests across kits merge on the cleaned destination; different sizes, modes, or backing kinds conflict. Sizes compare by byte value (suffixes use powers of 1024), modes by octal value, and omitted tmpfs is false. Argument-backed sizes and modes remain strings, including byte sizes such as 1024 and unpadded octal modes such as 755. An unspecified size or mode differs from an explicit value. Duplicate destinations within one declaration block are rejected. When a published set re-exports a volume's text input, publication keeps the requests separate until create expands and selects them; matching concrete settings then merge. Do not pin a create-phase size merely to avoid comparing its placeholder during publication.

Data lifetime (the inverse of declaring a volume). Block-volume data belongs to the sandbox instance, independently of the kits that requested it. Restart and recreation retain it, including when mixins or the workload change. Removing a declaration leaves its storage retained and unmounted; restoring the path reattaches it. Recreation with different settings for a retained destination refuses before replacing the container. New paths start empty before hooks; reattachment preserves contents and permissions. Removing the instance deletes all its volumes; creating another with the same name starts fresh. Tmpfs is empty after stop or recreation. Host mounts keep their separate sharing contract: their data survives sandbox removal.

Bundled skills

Use agent-skill@1 to package a skill as a mixin. Ship the whole directory under a kit-specific prefix such as /usr/share/example-skills/review, and declare that absolute source path. A source path must be literal after publishing; use a build-phase argument if it varies. Supporting scripts and references retain their relative paths. An optional config.name overrides the source basename at discovery destinations; it does not rename or rewrite the source.

Agent kits declare agent-skills@1 at their discovery paths. The runtime links or otherwise exposes every selected agent-skill@1 bundle at each path, even when the host store is missing, empty, or disabled. The same declaration permits host sharing when available, bounded by mode and host policy; no second directory declaration is needed. Runtime assembly of these sources is implementation-specific. Different source paths claiming one effective name conflict at composition, and an existing destination entry makes a skill request unsatisfiable. Without any selected destination, a required skill request fails; optional requests are skipped and recorded. Registration does not execute scripts.

Coupled optional features (groups)

Use a group when skipping a capability also needs to skip its hooks, files, or guidance. Put optional: true on the group, never on its members (even optional: false is invalid). Groups are nonempty and cannot nest; required and one-member groups are valid.

The selection API includes every member or none, before composition. A runtime supplies decisions on expanded entries; the API owns atomic selection and ordering. Validate all member configs even in skipped groups. Selected entries must still satisfy cross-entry rules, and a composition conflict is an error rather than a reason to skip another group. Singleton arity is per declaration block; lifecycle lists from selected blocks concatenate, and duplicate file paths are errors.

Published sets may carry declarationBlocks on ordinary items or one-member group wrappers. Preserve these descriptor-local IDs when reading a published descriptor. Hand-authored kits normally omit this field.

Selection lasts for one sandbox installation, including restarts. Recreation selects afresh. A failing selected hook is an execution failure, not optional unavailability. Skipping a group does not remove old files from reused volumes, omit image layers, or suppress argument environment exports. Group names are display labels, not merge keys. Groups extend the unfinished schema-3 grammar in place: descriptors using them require a reader implementing this extension, and older strict readers reject them.

Final environment references

Use ${{ kit.env.HOME }} in capability configuration strings when a path depends on the final container environment. Image defaults compose first, argument env exports replace them, and runtime environment overrides win last. Expansion happens before validation and selection, including inside groups. Missing names fail; empty values remain empty. This is structural string substitution, not shell evaluation: $HOME, ${HOME}, and ~/ are unchanged. Do not use environment references in mapping keys or kit metadata, and do not pass kit placeholders inside argument or environment values. Persist the expanded descriptor for restart.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs a command-line tool, Needs Python

The author says: Experimental. Needs docker buildx, kit-tck, and an sbx release with Kits v3 support (adapted from docker/sandbox-kit-spec at 4d932451613f8df89c8468e2bb7c5286882897ca; build/conformance tested 2026-11-02; authenticated inspect/validate and composition tested on sbx v0.50.1 with optional agent-context@2). Not the legacy docker sandbox wrapper. See references/sources.md.

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Docker
Publisher
Docker (Official)
Source
docker/skills · skills/docker-sandboxes-kits · commit 9f04a05
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Docker or Docker.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download docker-sandboxes-kits.zip