Tested on macOS 27.0.1 with sbx 0.54.1. The credential-injection step after approval follows Docker's documentation.
You ask your coding agent to fix a failing test. While it works, it can also call any API your tokens reach, and push to any repo you can push to. Nobody decided that. It's just what "runs as you" means.
A sandbox helps. The previous post on Docker Sandboxes covered how: the agent gets its own microVM, and the network goes through a proxy on your machine. But someone still has to decide which doors in that wall are open, and for which agent.
That's what Docker Sandbox Kits are for. A Kit is a permission slip that ships with the agent. We'll write a small one, stack it with another, and see which rules survive.
The problem in one sentence
An agent's permissions usually live in someone's head or a wiki page, not next to the agent itself.
So every team re-decides the same things. Can it reach GitHub? Which token does it get? And the answers drift: the agent image gets updated and the rules don't, or the other way around.
Docker's pitch is to put the rules inside the thing you ship. In their words, "Containers made software portable. Kits make authority portable." (Docker). That's a marketing line, but the idea behind it is sound: the rules should travel with the agent.
What a Kit actually is
A Kit is an ordinary container image (an OCI image) with one extra thing: a short list of what the agent is asking to be allowed to do. That list sits in the image's metadata, so when you pin the image, you pin the permissions with it (spec blog).
There are two kinds you'll use:
- Workload Kit. The base: the agent and its file system. A sandbox runs exactly one.
- Mixin Kit. An add-on you stack on top: a CLI tool, a network rule, a credential. Add as many as you like.
Each permission is a typed entry called a capability, like network-policy@2 or credential@1. The @2 is a version, so a capability can change without breaking older Kits.
One rule matters more than the rest: a Kit only asks. The host decides. If a Kit requires something the host won't give, the sandbox doesn't start. If it marks a request optional, the host can skip it and the sandbox still runs (spec).
A first Kit
Here's the scenario. Your agent needs to read from one API, httpbin.org (a free test API). It should never delete anything there. And it gets a token it can use but can't see.
Make a scratch folder and cd into it. Everything below runs from there. Inside it, create a folder called httpbin-readonly with one file, httpbin-readonly/httpbin-readonly.yaml:
# syntax=docker/sandbox-kit:3 schemaVersion: "3" kind: mixin displayName: httpbin read-only description: Read from httpbin.org. Never delete. capabilities: - type: com.docker.sandbox/network-policy@2 config: runtime: allow: - hosts: [httpbin.org] methods: [GET, HEAD] deny: - hosts: [httpbin.org] methods: [DELETE] - type: com.docker.sandbox/credential@1 optional: true config: service: httpbin phase: runtime apiKey: name: HTTPBIN_TOKEN proxyManaged: true inject: - {domain: httpbin.org, header: Authorization, format: "Bearer %s"} Read it top to bottom, like a permission slip:
- Allow: the agent may send
GETandHEADrequests tohttpbin.org. This Kit adds that rule on top of the sandbox's default network policy, which already blocks most of the internet. - Deny:
DELETEonhttpbin.orgis off the table. Right now that looks redundant, sinceDELETEisn't in the allow list anyway. Keep it. You'll see why when we stack Kits. - Credential: the Kit asks to use an
httpbinsecret stored on your machine. If you approve it, the sandbox's proxy adds it to matching requests as aBearerheader. Inside the sandbox,HTTPBIN_TOKENholds only the placeholder textproxy-managed, never the real value (Kit reference). It's markedoptionalso the sandbox still starts if you say no.
This is a declaration-only mixin. There's no Dockerfile, because it doesn't install anything. It only adds rules, and sbx builds the folder into a Kit when it creates the sandbox.
Running it
You need the sbx CLI, version 0.45.0 or newer, because that's when local sandboxes started enforcing these capabilities (the previous post covers the install). Check with sbx version.
Store a dummy secret first, so the credential request has something to point at:
# on your machine, not in the sandbox sbx secret set httpbin # paste any test value, e.g. test-123 Saved secret httpbin (global) Then validate the Kit and start a sandbox with it:
# on your machine sbx kit validate ./httpbin-readonly sbx run shell --kit ./httpbin-readonly . Before the sandbox starts, sbx shows you what the Kit is asking for and waits:
This kit wants to use these credentials: httpbin: API key sent to httpbin.org (stored) Approve these credentials? 1. Approve all 2. Review each 3. No start without them Choice [1-3, default 3]: This is the "a Kit only asks, the host decides" rule in action, and the safe answer is the default. Press Enter (no) for this first run. sbx says so plainly: credential not sent: no binding authorizes this service.
shell is one of the built-in agents: a workload Kit from Docker (docker.io/sbx/shell) that just gives you a shell, which is handy for testing rules without an agent in the way. --kit adds your mixin on top, and the final . is the folder to mount as the workspace. Kits apply when a sandbox is created, so if you change the YAML, start a new sandbox.
You're now in the sandbox shell. Try these:
# inside the sandbox echo "TOKEN=$HTTPBIN_TOKEN" for m in GET POST PUT DELETE; do printf "%-6s /anything/x -> " $m curl -s -o /dev/null -w "%{http_code}\n" -X $m https://httpbin.org/anything/x done printf "GET example.com -> "; curl -s -o /dev/null -w "%{http_code}\n" https://example.com curl -s https://httpbin.org/headers | grep -i authorization || echo "no Authorization header seen" Tested with sbx 0.54.1 on macOS:
TOKEN=proxy-managed GET /anything/x -> 200 POST /anything/x -> 403 PUT /anything/x -> 403 DELETE /anything/x -> 403 GET example.com -> 403 no Authorization header seen Line by line: the agent sees a placeholder, not your secret. Reads go through. Writes and deletes are blocked by the proxy with a 403. example.com is blocked by the sandbox's default policy, since nobody allowed it. And because you declined the credential, nothing was added to the request. If you choose 1 instead, Docker's docs say the proxy attaches the stored secret to httpbin.org requests, while echo inside the sandbox still prints proxy-managed (Kit reference).
Stacking Kits: the one people miss
Kits are meant to stack. Your security team ships one mixin, your platform team ships another, you add yours. So what happens when they disagree?
Say the platform team ships a broad Kit that allows httpbin.org for every method. Next to your first folder, create team-httpbin/team-httpbin.yaml:
# syntax=docker/sandbox-kit:3 schemaVersion: "3" kind: mixin displayName: team httpbin description: Platform team default. Allows httpbin.org for every method. capabilities: - type: com.docker.sandbox/network-policy@2 config: runtime: allow: - hosts: [httpbin.org] Exit the first sandbox, remove it (sbx ls shows its name, which is shell- plus your folder name), and start a new one with both Kits:
# on your machine sbx rm shell-examples # asks y/N; this can't be undone sbx run shell --kit ./httpbin-readonly --kit ./team-httpbin . The spec has two rules for this (spec):
- Allow lists from different Kits are combined, and a narrow allow (like "GET only") is dropped when another entry already allows the same host outright.
- Deny rules win over allow rules, including across composed Kits (Kit reference).
Run the same checks again, plus a DELETE on a different path. Tested with sbx 0.54.1 on macOS:
GET /anything/x -> 200 POST /anything/x -> 200 PUT /anything/x -> 200 DELETE /anything/x -> 403 DELETE /delete -> 403 GET example.com -> 403 POST and PUT now go through: your "GET only" didn't survive the merge. DELETE is still blocked on every path, because that one was a deny. And example.com stays blocked, because neither Kit asked for it.
Takeaway: if something must never happen, write it as a deny. A narrow allow can quietly disappear when someone stacks a broader one on top.
Reading a Kit through an IAM lens
If you work in identity and access management, a lot of Kit design will look familiar. The comparisons are useful, as long as you know where each one stops.
| Kit idea | Closest IAM idea | Where it breaks down |
|---|---|---|
allow per host, method, path | A scoped grant, like OAuth scopes (RFC 6749 §3.3) | Scopes are named by the API. A Kit allow is raw host/method/path enforced by a proxy, so it can't say "only my own repos". And allows add up: the broadest one wins. |
deny wins, even across Kits | Explicit deny in AWS IAM (AWS docs) | AWS also has permission boundaries and SCPs that cap what others can grant. Kits have no ceiling layer: a deny is the only way to subtract. |
| Proxy-managed credential | Backend-for-frontend / token handler (RFC 10017 §6.1) | Same shape: the untrusted side holds a placeholder, a trusted middle adds the real token. But the proxy only injects a static header. No OAuth flow, no refresh, no audience binding. |
| Widening needs approval | An admin re-approving a permission change | There's no end-user consent screen. The host operator approves, and only changes to the recorded permission surface trigger it. |
required vs optional | Fail closed vs fail open | required fails closed. optional is fail-open by design for that one item, so mark anything security-relevant as required. |
The threats these map to are the ones identity people already worry about: an agent that over-reaches after a prompt injection (a confused deputy acting with your reach), a secret walking out the door, and permissions drifting wider as more pieces get composed.
The approval row deserves a closer look. The host keeps a record of exactly what it granted, which the spec calls the permission surface. If a new version of a Kit asks for more, like a new host, a removed deny or a new credential, the host stops and asks again. If it asks for the same or less, it can update quietly (spec).
Where the slip has limits
Kits are new, so it's worth being clear about what they don't do yet:
- The spec is experimental. The repository says so, with the final version targeted for Q4 2026. Expect field names to move.
- One runtime enforces it. As of InfoQ's 2 October report, Docker Sandboxes was the only runtime that does. A Kit's rules mean nothing to a runtime that ignores them (InfoQ).
- Cloud sandboxes enforce less. Method and path rules, like our
DELETEdeny, work locally. Cloud sandboxes currently enforce host rules only (capability support). Everything in this post is a local run. - A deny is only as wide as its pattern. Had we written the deny for
/anything/**only,DELETE /deletewould get through once the team Kit was stacked on top. - A hidden token is still a usable token. The agent can't read the secret, but it can still make authenticated calls to any allowed host while it runs. Keep scopes small on the real token too.
- CNCF status is open. Docker is bringing the spec to the CNCF, but the stage hasn't been announced.
Where to start
- List the hosts your agent actually needs, in one Kit. Start from the sandbox default and add only those.
- Turn every "it must never do X" into a
denyrule. - Mark credentials
proxyManaged: trueso the real value never sits inside the sandbox, andrequiredwhen the agent shouldn't run without them. - When you share a Kit, push it as an image and reference it by digest, so the permissions you reviewed are the ones that run.
- Treat a Kit update that asks for more like a pull request: someone reviews it before it's approved.
A Kit won't stop an agent from making a mistake. It decides how far that mistake can reach.
References
- Docker, "Docker and CNCF partner on an open spec for agent permissions": https://docker.com/blog/docker-sandbox-kit-spec-cncf
- Christian Dupuis, "From Dockerfile to Kit: the Docker Sandboxes Kit Specification": https://www.docker.com/blog/docker-sandbox-kit-spec
- Docker Sandbox Kit Specification v3 (GitHub): https://github.com/docker/sandbox-kit-spec
- Docker Docs, "Author kits": https://docs.docker.com/ai/sandboxes/customize/author/
- Docker Docs, "Kit capability support": https://docs.docker.com/ai/sandboxes/customize/author/capabilities/
- Docker Docs, "Kit reference": https://docs.docker.com/ai/sandboxes/customize/kit-reference/
- InfoQ, Docker Sandbox Kit spec coverage: https://infoq.com/news/2026/10/docker-sandbox-ai-agent
- AWS IAM, "Policy evaluation logic": https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html
- IETF, RFC 10017, "OAuth 2.0 for Browser-Based Applications" (BCP 212): https://datatracker.ietf.org/doc/rfc10017/
- IETF, RFC 6749, "The OAuth 2.0 Authorization Framework", §3.3: https://www.rfc-editor.org/rfc/rfc6749#section-3.3
Anoop Gopi is a Docker Captain. Views are his own and not Docker's.


