docker-safety

docker-safety is a skill for Claude Code from catpilotai/catpilot-ai-guardrails. It costs 114 tokens per session (4,739 once invoked), scanned D, original, MIT.

A set of rules for building and running Docker containers more safely. Docker packages software and its dependencies into isolated containers.

In plain words
What is it for?
It is for checking Dockerfiles, Compose files, and container run commands for issues such as root users, unsafe privileges, unpinned image tags, and insecure secret handling.
Why use it?
It helps prevent container settings from exposing the host machine, leaking secrets into image history, or pulling changing and risky base images.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex; built for openclaw.

Part of the catpilot-guardrails plugin — 25 skills shipped together

Good fit It is for checking Dockerfiles, Compose files, and container run commands for issues such as root users, unsafe privileges, unpinned image tags, and insecure secret handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/catpilotai/catpilot-ai-guardrails/docker-safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add catpilotai/catpilot-ai-guardrails --skill docker-safety
Clone the repo
git clone --depth 1 https://github.com/catpilotai/catpilot-ai-guardrails

Made for: Claude Code.

Or install catpilot-guardrails, the plugin that ships this one along with the rest of its 25 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/docker-safety/github.svg)](https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/docker-safety)
Your own site
<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/docker-safety"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/docker-safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docker-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/docker-safety"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/docker-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00114 $0.04739
Opus 5.5 $0.00046 $0.01896
Sonnet 5.5 $0.00023 $0.00948
Haiku 4.5 $0.00011 $0.00474

Measured 1mo ago against content hash a933e0685878, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade D, and why

docker-safety scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

### Rule 2 — Non-root `USER` is mandatory; no images run as root

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

(`rm -rf /var/lib/apt/lists/*` for apt, `apk --no-cache` for apk,

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

RUN apt-get update && apt-get install -y python3 curl
src/skills/core/docker-safety/SKILL.md · 496 lines

How it starts

The opening of the file, as written. The whole thing — 496 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Baseline

Applies when: Writing or running a Dockerfile/Containerfile, docker-compose.yml, docker build/run/exec (or podman/nerdctl/buildah equivalents), or a Kubernetes manifest setting securityContext, hostNetwork, hostPID, hostIPC, privileged, or hostPath volumes.

Always:

  • Pin base images to an immutable digest (FROM <image>@sha256:...); floating tags (latest, major/minor only) are for non-deployed internal tooling only.
  • Declare and switch to a non-root USER before CMD/ENTRYPOINT; COPY --chown=app:app files the runtime needs to read.
  • Pass build-time secrets with BuildKit --mount=type=secret; pass runtime secrets via --env-file or a secret store, never baked into the image.
  • Run production containers with read_only/--read-only, no-new-privileges, and cap_drop: [ALL] with only required capabilities re-added.
  • Pin package versions, use the minimal-install flag, and clean the package cache in the same layer; verify checksums for downloaded binaries.

Never:

  • --privileged / privileged: true — disables seccomp, AppArmor, and capability dropping.
  • --net=host / network_mode: host or --pid=host / pid: host — shares the host's network or process namespace.
  • -v /:/host or mounting /var/run/docker.sock into the container — full host filesystem or Docker daemon control.
  • ENV/ARG for secrets, or COPY .env . — persists secrets in image history.
  • chmod -R 777 inside a container image.

Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.

Why

A Docker image and its run command together define the security posture of every workload they produce. The same image can ship as a hardened, non-root, read-only filesystem service — or as a root-owned container with the host's /var/run/docker.sock mounted in, one docker exec away from a host takeover.

The failures this skill blocks share a common shape: a single line in a Dockerfile, a docker-compose.yml, or a docker run flag that breaks the isolation boundary the container is supposed to provide.

Read the full file on GitHub · 496 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +20 lines a933e0685878
  2. 2mo ago First seen · 476 lines · 114 tokens per session scan D 24656937f2d4

Subscribe to this mod's changes

docker-safety is a skill published in the GitHub repository catpilotai/catpilot-ai-guardrails (2 stars, last pushed 8d ago), licensed MIT. It adds 114 tokens to every session and 4,739 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it D with 3 findings (asks for root, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

docker-safety compared with skills from other repositories

docker-safety next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
docker-safetycatpilotai/catpilot-ai-guardrailsSkill28d agoMITD114Claude Code
hermes-s6-container-supervisionNousResearch/hermes-agentSkill262ktodayMITA20Claude Code, Codex
docker-managementNousResearch/hermes-agentSkill262ktodayMITA14Claude Code, Codex
dockerAtomicBot-ai/Atomic-ChatSkill1.9kyesterdaynoneA44Claude Code, Codex
dockerG1Joshi/Agent-SkillsSkill151mo agoMITA38Claude Code, Codex
helmG1Joshi/Agent-SkillsSkill151mo agoMITA32Claude Code, Codex
kubernetesG1Joshi/Agent-SkillsSkill151mo agoMITA47Claude Code, Codex