- name
SKILL.md
技能文件保留在发布者的仓库中。
在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add docker/skills --skill docker-sandboxes-network-credentials -a cursor -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add docker/skills --skill docker-sandboxes-network-credentials -a claude-code -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add docker/skills --skill docker-sandboxes-network-credentials -a codex -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add docker/skills --skill docker-sandboxes-network-credentials -a grok -y在 Grok Bot 聊天中发送复制的消息。Bot 会从 GitHub 获取这个 SKILL.md,并添加到你所有 Bot 共享的技能中。
Install this skill: https://github.com/docker/skills/tree/HEAD/skills/docker-sandboxes-network-credentials来自发布者
This skill owns sbx policy (network egress) and sbx secret (service
secrets and registry credentials). The proxy enforces egress policy and
injects stored credentials on matching domains. Proxy-managed sentinels are
not usable upstream credentials, but OAuth passthrough can expose real
tokens to the sandbox. Egress policy does not protect a real credential
once leaked outside the sandbox; revoke or rotate a leaked credential.
Activate this skill when:
Do not use this skill when:
docker agent run --sandbox or managing its
docker agent sandbox allowlist — use docker-agent-run. If the CLI
is unclear, establish whether the user runs Docker Agent or standalone
sbx before choosing commands.docker-sandboxes-lifecycle.sbxenv.yaml file — no skill in this catalog owns it;
use docker-docs for the format (this skill's rules on precedence and
injection scope still apply to what that file provisions).credentials:/permissions.network:
block in a spec.yaml — use docker-sandboxes-kits for the schema (this
skill's model of what those declarations mean at runtime still applies).sbx policy init <allow-all|balanced|deny-all>. balanced
is the recommended starting point (typical dev traffic — AI services,
package registries — allowed). This is a one-time setup.sbx policy reset is destructive: it deletes the entire local policy
store and stops the daemon and every currently running sandbox. The
daemon restarts on the next daemon-backed command. It is not a lightweight way to "start over" or a
routine diagnostic step — never propose it as a first troubleshooting
move for a single misbehaving rule. Use targeted sbx policy rm network
(by --id or --resource) to remove one rule instead; reserve
sbx policy reset for when the policy store itself needs to be rebuilt
from scratch, and warn the user that it will stop running sandboxes
before running it.sbx policy allow network RESOURCES /
sbx policy deny network RESOURCES. RESOURCES is a comma-separated list
of exact hosts, *.example.com single-label wildcards, **.example.com
multi-label wildcards, optional :port suffixes, CIDR prefixes, or **
for "all hosts".
sbx policy init balanced
sbx policy allow network "api.example.com,cdn.example.com"
sbx policy deny network ads.example.com
--sandbox NAME to scope it to
one sandbox's local policy instead:
sbx policy allow network --sandbox my-sandbox api.example.com
sbx create/sbx run accept
--deny-network RESOURCE (repeatable) to add a per-sandbox deny rule. This
is safe to expose even under centralized (org) governance because a local
deny can only narrow, never widen, egress — it can never override an
org-level allow into a broader grant.sbx policy check network [--sandbox NAME] TARGET to test what the
current policy would do for a host/URL before it matters, and
sbx policy log [SANDBOX] to see what was actually allowed or blocked
historically, with the matching rule.
sbx policy check network --sandbox my-sandbox api.example.com:443
sbx policy log my-sandbox --json
sbx secret set [SERVICE] stores a credential the proxy uses to
authenticate outbound requests on behalf of the agent. In the normal
proxy-managed flow, the sandbox sees a sentinel rather than the raw
secret; the proxy substitutes the real value on requests to the domains
the matching kit/binding declares.
sbx secret set github # interactive
printf '%s' "$ANTHROPIC_API_KEY" | sbx secret set anthropic
Storing a secret does not grant network access. Egress is governed
separately by sbx policy; check the target domain in the intended scope
before debugging authentication:
sbx policy check network --sandbox my-sandbox api.anthropic.com
oauth.passthrough: true without a refresh sentinel, the
proxy forwards the real token response to the sandbox. The built-in
devin kit uses this mode. Review the agent's credential configuration
before promising that it cannot read a token; do not enable passthrough
merely to bypass an authentication failure. Even with sentinels, the
agent can exercise the credential's permissions on allowed services —
restrict token privileges as well as network access.--sandbox NAME scopes one to a
single sandbox.--ref (1Password op://... or an AWS Secrets
Manager ARN — requires an authenticated op/aws CLI) or --command
(runs a shell command and uses its stdout). --refresh controls the
resolution/cache policy (default 55m, or on-demand).
sbx secret set anthropic --ref 'op://Private/Anthropic/api-key'
sbx secret set github --command 'gh auth token'
--command and --ref are resolved on the host, with your own
privileges, and treated as trusted execution — never point --command
at anything an untrusted file or an agent's own output could influence.--env value or as a --kit-arg /
--env-arg value. Both land as literal, unmasked text — in the
sandbox's environment, in sbx env plan's state file, and potentially in
shell history — defeating the entire point of the credential store. Use
sbx secret set (or 's / blocks, which
route through the same store) instead.sbx secret set --registry HOST --password-stdin (optionally
--username) stores pull credentials for a container registry, used
to pull private template images and kit artifacts. Unlike service
secrets, registry credentials are host-only by default: they authenticate
pulls on the host and are never injected into any sandbox.
gh auth token | sbx secret set --registry ghcr.io --password-stdin
--all-sandboxes and --sandbox widen this differently — do not
confuse them:
--all-sandboxes: credentials are used for host pulls and injected
by the proxy into every new sandbox's registry login (the
credential itself never enters the sandbox filesystem).--sandbox NAME: credentials are injected into that one sandbox
only.gh auth token | sbx secret set --all-sandboxes --registry ghcr.io --password-stdin
gh auth token | sbx secret set --sandbox my-sandbox --registry ghcr.io --password-stdin
--registry-auth-endpoint naming the exact
trusted HTTPS URL — otherwise the cross-host token exchange is rejected.sbx secret rm --registry HOST --sandbox NAME removes only that sandbox's
registry credential; host-only and global (all-sandboxes) entries are
untouched. This does not revoke the upstream token or prevent use of
another applicable credential.
sbx secret rm --registry ghcr.io --sandbox my-sandbox
--sandbox, sbx secret rm --registry HOST removes both the
host-only and global entries. Add --all-sandboxes to remove only the
global entry instead.For docker agent run --sandbox and docker agent sandbox commands,
use docker-agent-run.
For creating, reattaching to, and removing the sandboxes these policies
and secrets apply to, use docker-sandboxes-lifecycle.
For the format of secrets:/registries:/bindings: inside a checked-in
sbxenv.yaml file that provisions them at environment-create time, use
docker-docs; no skill in this catalog owns that file.
For a kit's own credentials: and permissions.network: declarations
(what a kit asks for, as opposed to what the user has approved), use
docker-sandboxes-kits.
references/sources.md — provenance for every rule above (help captures, source paths, docs URLs).checks/verification.md — Verification runbook for network policy and secret commands (unexecuted runbook; run manually with an isolated --app-name, no real secret values).Use this skill when configuring what a Docker Sandboxes (`sbx`) sandbox can reach on the network or which credentials it authenticates with, even if the user just says they want to "let the agent call
---name: docker-sandboxes-network-credentialsdescription: Use this skill when configuring what a Docker Sandboxes (`sbx`) sandbox can reach on the network or which…---# skills/docker-sandboxes-network-credentials/SKILL.md概览
Use this skill when configuring what a Docker Sandboxes (`sbx`) sandbox can reach on the network or which credentials it authenticates with, even if the user just says they want to "let the agent call an internal API", "block all network access", "give the agent a GitHub token", or "use a private registry image for a sandbox". Covers `sbx policy init/allow/deny/ls/inspect/log/check/rm network` (global and per-sandbox egress rules, deny-over-allow precedence) and `sbx secret set/set-custom/ls/rm/import` (service secrets, dynamic secrets via --ref/--command, and registry pull credentials with their host-pulls-only-by-default injection scope).
常见问题
从发布者处下载 skills/docker-sandboxes-network-credentials/SKILL.md,或复制路径后打开仓库。PlugMCP 只收录该技能,不托管文件。
发布者将它存放在 https://github.com/docker/skills。
Claude、Cursor、Codex 和 Grok Build 可以读取你从发布者仓库添加的 SKILL.md。在聊天中发送技能的 GitHub 文件夹链接,Grok Bot 就会安装它。
sbx policy ls [SANDBOX] [--wide] lists active policies/rules; --wide
adds rule IDs (needed for sbx policy rm network --id) and per-resource
status. sbx policy inspect <policy-or-rule> gives full detail including
each rule's exact removal command or the reason it is read-only (e.g.
org-managed). To remove a sandbox-scoped rule, retain --sandbox NAME;
omitting it targets the global policy instead:
sbx policy rm network --sandbox my-sandbox --resource api.example.com
sbx policy check network --sandbox my-sandbox api.example.com
Removing one rule does not determine the final decision; other matching
rules still apply.sbxenv.yamlsecrets:registries:sbx secret set-custom (experimental) covers a service sbx has no
built-in support for: the sandbox sees a placeholder value in an env var
you name (--env), and the proxy swaps in the real secret only on
requests to the --host pattern(s) you declare.sbx secret ls [--global|--sandbox NAME] [--service NAME] [--json] lists
what is stored, without revealing values. sbx secret rm [SERVICE] [--sandbox NAME] [--all|--registry HOST] [--force] removes it.sbx secret import [SERVICE] [--all] [--dry-run] [--force] offers to
import secrets already sitting in host environment variables (e.g.
OPENAI_API_KEY, GH_TOKEN) into the global store, prompting per entry
unless --all/--force. A service with an OAuth token already configured
is skipped — OAuth takes precedence at runtime over an imported API key.