Configure network egress policies and manage service or registry credentials for Docker sandboxes using the sbx CLI.
- GitHub stars
- 626
- Files
- 5
- Last commit
- Nov 10, 2026
- License
- Apache-2.0
- Allowed tools
- —
What does the docker-sandboxes-network-credentials skill do?
docker-sandboxes-network-credentials is an agent skill. Configure network egress policies and manage service or registry credentials for Docker sandboxes using the sbx CLI.
Summary generated from the skill's SKILL.md.
About the docker-sandboxes-network-credentials skill
Developers managing isolated environments can use this skill to control network egress and manage sensitive credentials for Docker sandboxes via the sbx CLI. It allows for the configuration of global or per-sandbox network policies, enabling or blocking access to specific hosts, CIDR prefixes, or wildcards. The system follows a deny-over-allow precedence to ensure security when multiple rules overlap.
Beyond network control, the skill manages service secrets and registry credentials. It provides a way to inject API keys or OAuth tokens into sandboxes through a proxy, which prevents raw secret values from being exposed directly to the agent. Users can also handle dynamic secrets using host-side references or shell commands, and manage registry authentication for pulling private images. This is essential for teams needing to grant agents access to internal APIs or private container registries without compromising security.
What an agent can do with it
- 1Restrict sandbox network accessAn agent can be configured to block all network traffic or only allow connections to specific internal API hosts.
- 2Securely provide API credentialsYou can give an agent a GitHub token or an Anthropic API key without exposing the actual value inside the sandbox environment.
- 3Authenticate private container registriesA developer can set up credentials to pull private template images or kits from a registry that requires authentication.
- 4Test network policy outcomesBefore applying a new rule, you can verify if a specific host or URL will be allowed or blocked by the current policy.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the docker-sandboxes-network-credentials skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the docker-sandboxes-network-credentials skill in Plugin
/plugin marketplace add docker/skills /plugin install docker-skills@docker
Install the docker-sandboxes-network-credentials skill in Claude Code
~/.claude/skills/docker-sandboxes-network-credentials/SKILL.md
$ npx degit docker/skills/skills/docker-sandboxes-network-credentials ~/.claude/skills/docker-sandboxes-network-credentialsInstall the docker-sandboxes-network-credentials skill in Claude Code (project)
.claude/skills/docker-sandboxes-network-credentials/SKILL.md
$ npx degit docker/skills/skills/docker-sandboxes-network-credentials .claude/skills/docker-sandboxes-network-credentialsInstall the docker-sandboxes-network-credentials skill in Codex
~/.agents/skills/docker-sandboxes-network-credentials/SKILL.md
$ npx degit docker/skills/skills/docker-sandboxes-network-credentials ~/.agents/skills/docker-sandboxes-network-credentialsInstall the docker-sandboxes-network-credentials skill in Gemini CLI
~/.gemini/skills/docker-sandboxes-network-credentials/SKILL.md
$ npx degit docker/skills/skills/docker-sandboxes-network-credentials ~/.gemini/skills/docker-sandboxes-network-credentialsInstall the docker-sandboxes-network-credentials skill in Claude.ai
npx degit docker/skills/skills/docker-sandboxes-network-credentials docker-sandboxes-network-credentials && zip -r docker-sandboxes-network-credentials.zip docker-sandboxes-network-credentials # claude.ai → Customize → Skills → + → Create skill → Upload a skill → docker-sandboxes-network-credentials.zip
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachabledocker/skills/skills/docker-sandboxes-network-credentials is public and reachablegithub.com/docker/skills/tree/HEAD/skills/docker-sandboxes-n ↗Pass
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-10github.com/docker/skills/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/docker/skills/blob/HEAD/skills/docker-sandboxes-n ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/docker/skills/blob/HEAD/skills/docker-sandboxes-n ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 228 linesgithub.com/docker/skills/blob/HEAD/skills/docker-sandboxes-n ↗Pass
SKILL.md
View on GitHubDocker Sandboxes: Network Policy & Credentials
Overview
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.
When to use this skill
Activate this skill when:
- The user wants to allow, deny, or inspect which hosts a sandbox (or all sandboxes) can reach.
- The user wants to give an agent an API key, OAuth token, or other service credential without exposing the raw value inside the sandbox.
- The user wants to pull a private template image or kit from a registry that requires authentication.
- The user is debugging a blocked network request or a credential that isn't being injected.
Do not use this skill when
Do not use this skill when:
- The task is running
docker agent run --sandboxor managing itsdocker agent sandboxallowlist — usedocker-agent-run. If the CLI is unclear, establish whether the user runs Docker Agent or standalonesbxbefore choosing commands. - The task is creating, reattaching to, or removing a sandbox itself — use
docker-sandboxes-lifecycle. - The task is declaring secrets/registries/bindings inside a checked-in
sbxenv.yamlfile — usedocker-sandboxes-envfor the file format (this skill's rules on precedence and injection scope still apply to what that file provisions). - The task is declaring a kit's own
credentials:/permissions.network:block in aspec.yaml— usedocker-sandboxes-kitsfor the schema (this skill's model of what those declarations mean at runtime still applies).
Core guidance
Network policy: global, per-sandbox, and precedence
- The global network policy must be initialized once before creating the
first sandbox:
sbx policy init <allow-all|balanced|deny-all>.balancedis the recommended starting point (typical dev traffic — AI services, package registries — allowed). This is a one-time setup. sbx policy resetis 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 targetedsbx policy rm network(by--idor--resource) to remove one rule instead; reservesbx policy resetfor when the policy store itself needs to be rebuilt from scratch, and warn the user that it will stop running sandboxes before running it.- Add rules with
sbx policy allow network RESOURCES/sbx policy deny network RESOURCES.RESOURCESis a comma-separated list of exact hosts,*.example.comsingle-label wildcards,**.example.commulti-label wildcards, optional:portsuffixes, 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 - Deny always wins over allow for the same hostname/CIDR when both match. An allowed hostname is not checked against CIDR deny rules for its resolved IP.
- A rule applies globally by default. Pass
--sandbox NAMEto scope it to one sandbox's local policy instead:sbx policy allow network --sandbox my-sandbox api.example.com - At creation time only,
sbx create/sbx runaccept--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. - Use
sbx policy check network [--sandbox NAME] TARGETto test what the current policy would do for a host/URL before it matters, andsbx 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 policy ls [SANDBOX] [--wide]lists active policies/rules;--wideadds rule IDs (needed forsbx 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:
Removing one rule does not determine the final decision; other matching rules still apply.sbx policy rm network --sandbox my-sandbox --resource api.example.com sbx policy check network --sandbox my-sandbox api.example.com
Service secrets: how injection works
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.
Storing a secret does not grant network access. Egress is governed separately bysbx secret set github # interactive printf '%s' "$ANTHROPIC_API_KEY" | sbx secret set anthropicsbx policy; check the target domain in the intended scope before debugging authentication:sbx policy check network --sandbox my-sandbox api.anthropic.com- OAuth passthrough is an exception, not a no-secret-exposure guarantee.
When a kit sets
oauth.passthrough: truewithout a refresh sentinel, the proxy forwards the real token response to the sandbox. The built-indevinkit 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. - Service secrets are global by default;
--sandbox NAMEscopes one to a single sandbox. - Dynamic secrets resolve the value on the host at use time instead of
storing it directly:
--ref(1Passwordop://...or an AWS Secrets Manager ARN — requires an authenticatedop/awsCLI) or--command(runs a shell command and uses its stdout).--refreshcontrols the resolution/cache policy (default55m, oron-demand).sbx secret set anthropic --ref 'op://Private/Anthropic/api-key' sbx secret set github --command 'gh auth token'--commandand--refare resolved on the host, with your own privileges, and treated as trusted execution — never point--commandat anything an untrusted file or an agent's own output could influence. - Never pass a secret as a plain
--envvalue or as a--kit-arg/--env-argvalue. Both land as literal, unmasked text — in the sandbox's environment, insbx env plan's state file, and potentially in shell history — defeating the entire point of the credential store. Usesbx secret set(orsbxenv.yaml'ssecrets:/registries:blocks, which route through the same store) instead. 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--hostpattern(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.
Registry credentials: host-pulls-only by default, two distinct injection scopes
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-sandboxesand--sandboxwiden 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.- Neither flag: host-pulls-only, injected nowhere.
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- For a registry whose Bearer auth endpoint lives on a different hostname
than the registry itself, pass
--registry-auth-endpointnaming the exact trusted HTTPS URL — otherwise the cross-host token exchange is rejected. sbx secret rm --registry HOST --sandbox NAMEremoves 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- Without
--sandbox,sbx secret rm --registry HOSTremoves both the host-only and global entries. Add--all-sandboxesto remove only the global entry instead.
Related skills
-
For
docker agent run --sandboxanddocker agent sandboxcommands, usedocker-agent-run. -
For creating, reattaching to, and removing the sandboxes these policies and secrets apply to, use
docker-sandboxes-lifecycle. -
For declaring
secrets:/registries:/bindings:inside a checked-insbxenv.yamlfile that provisions them at environment-create time, usedocker-sandboxes-env. -
For a kit's own
credentials:andpermissions.network:declarations (what a kit asks for, as opposed to what the user has approved), usedocker-sandboxes-kits.
References
references/sources.md— provenance for every rule above (help captures, source paths, docs URLs).
Assets
- None.
Checks
checks/verification.md— Verification runbook for network policy and secret commands (unexecuted runbook; run manually with an isolated--app-name, no real secret values).
Files in this skill
5docker-sandboxes-network-credentials skill questions
How do I install the docker-sandboxes-network-credentials skill in Claude Code?
Run npx degit docker/skills/skills/docker-sandboxes-network-credentials ~/.claude/skills/docker-sandboxes-network-credentials. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the docker-sandboxes-network-credentials skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How do I set up initial network access for my sandboxes?
You must initialize the global network policy once before creating sandboxes using 'sbx policy init' with a mode like 'balanced' or 'deny-all'.
What happens if a network rule is both allowed and denied?
In the event of a conflict where both an allow and a deny rule match the same hostname or CIDR, the deny rule takes precedence.
Can I use dynamic secrets from external managers?
Yes, you can use the --ref flag for 1Password or AWS Secrets Manager, or the --command flag to run a shell command and use its output as the secret.
Are registry credentials automatically available inside the sandbox?
By default, registry credentials are host-only and are never injected into a sandbox unless you specifically use the --all-sandboxes or --sandbox flags.