Guide · Agent skill
How to use the Container Escape Playbook agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The Container Escape Playbook is an agent skill, a folder with a SKILL.md instruction file that an AI agent such as Claude reads when a task matches it. This one, named offensive-container-escape, tells the agent how to check whether it is inside a Docker, containerd or Podman container and how to attempt a breakout to the underlying host. It is written for authorized penetration testers and red teams, and this guide explains what the skill does, how to install it, how to trigger it, and where its limits are. By the end you will know how to set it up, how to phrase a request so it loads, and what it needs before you run it.
Quick start
- 1Download the ZIP. Get the offensive-container-escape skill ZIP from the directory page. The package contains SKILL.md.
- 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project.
- 3Or upload in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill.
- 4Confirm your scope. Make sure you have written authorization for the target and know the engagement scope before you start.
- 5Ask with a clear goal. Describe the task in plain terms, such as a Docker escape test inside an authorized engagement, so the agent loads the skill.
- 6Review enumeration output. Let the agent run the detection and enumeration steps first and read what it found before allowing any escape or write step.
What the skill makes the agent do
The skill is an offensive playbook. Its stated objective is to take a shell that is already inside a container and reach the host operating system. It is organized as a workflow: confirm the container, enumerate capabilities, mounts, namespaces and sockets, identify the most likely escape vector, execute the matching technique, validate host access, and then pivot to other systems.
The source file covers these vector families: privileged container breakout through host filesystem mounts and nsenter, Docker socket abuse through /var/run/docker.sock, dangerous Linux capabilities such as CAP_SYS_ADMIN, CAP_SYS_PTRACE and CAP_NET_ADMIN, the cgroup v1 notify_on_release escape, runc CVEs including CVE-2019-5736 and CVE-2024-21626 (Leaky Vessels), kernel exploits from inside containers, and Dockerfile misconfigurations such as --privileged and host namespace sharing. It maps these techniques to MITRE ATT&CK T1611 Escape to Host.
How to install the skill
Download the skill ZIP from the directory page. Unzip it into your user skills folder, ~/.claude/skills/, so that the agent can use it in every project. To scope it to one project instead, unzip it into that project's .claude/skills/ folder.
If you use the Claude apps rather than a local setup, you can upload the skill in the app under Settings, then Capabilities, then Skills.
- Personal install: ~/.claude/skills/ (available across projects)
- Project install: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills, then upload
How to trigger the skill with natural requests
You do not run the skill like a program. The agent decides to load it when your request matches the skill's description. The description says it applies when the engagement scope includes container breakout, Docker escape, container privilege escalation, host access from a container, or when you land inside a containerized environment and need to reach the host. Say those things plainly, and state your authorization and scope in the same message.
Vague requests such as 'help with my server' are unlikely to load it. Requests that name the goal and the setting work better.
- Our scope is a written container pentest. I have a shell in this container and need to check whether I can reach the host.
- This engagement includes Docker escape testing. Enumerate what this container can do before choosing a technique.
- I am validating that our container isolation holds. Check for privileged mode and an exposed Docker socket.
What the agent checks first
Most of the file is enumeration before any exploit. The agent is directed to confirm it is containerized, then map capabilities, mounts, namespaces and sockets. The commands in the file include checking /.dockerenv, reading /proc/1/cgroup for runtime identifiers, inspecting PID 1, reading CapEff from /proc/1/status and decoding it with capsh, and comparing namespace inodes to see whether host namespaces are shared.
The file names several enumeration tools: deepce, CDK (its evaluate command), amicontained, capsh and nsenter. Some of these are downloaded at runtime rather than bundled, which matters for the requirements below.
- Container check: /.dockerenv, /proc/1/cgroup, PID 1 command line, environment variables, hostname
- Capabilities: capsh --print, CapEff decoded with capsh --decode
- Namespaces and mounts: /proc/1/ns, /proc/1/mountinfo, findmnt, ip addr show
cat /proc/1/cgroup | grep -E 'docker|containerd|kubepods|podman'Escape vectors the file describes
Once enumeration points to a weakness, the file describes a technique for it. For a privileged container, the file covers listing block devices, mounting the host root filesystem into the container and reading host files, and using nsenter into host namespaces when host PID 1 is visible. It also covers direct device access. For an exposed Docker socket, the file shows how to check that the socket is writable and query the Docker API, then how to create and start a privileged container that binds the host root.
The file describes persistence on the host as well, including adding keys and accounts and scheduling jobs. This guide does not reproduce those steps. Treat them as part of what the skill contains, not as something to run without written authorization.
- Privileged mode: host disk mount, nsenter, device access
- Docker socket: check writability, query the API, create and start a container with the host root bound
- Capabilities, cgroup, runc CVE and kernel paths: described in the file
test -w /var/run/docker.sock && echo "WRITABLE" || echo "READ-ONLY"Safety notes: scripts and network
The skill runs scripts and uses the network. The file refers to downloading deepce from GitHub when outbound access is available, and to tools such as CDK being obtained at runtime. Before the agent fetches anything, confirm that your engagement permits outbound traffic from the target and that you are comfortable with the tools being pulled in.
The file's own guidance includes writing to host files and running exploit tooling. On a production system those actions can cause outages or data loss. Use a lab or an agreed test environment, and keep written scope in front of you before any write, mount or exploit step.
- Requires a Linux shell inside the target container
- Tools downloaded at runtime: deepce, CDK and others named in the file
- Needs python3 and curl for socket checks
- Needs network access to GitHub if the agent downloads deepce
- Not for production systems without explicit approval
Tips for getting useful results
Start with enumeration only and read the output before allowing any exploit step. The skill's workflow already orders the work this way, so ask the agent to stop after step 3 if you want a report first. Keep a record of each command the agent runs, because the file's techniques change host files and that record is your audit trail.
The source file is a SKILL.md and is written as an attack reference, not a hardening guide. If your goal is to defend a container, use the enumeration sections as a checklist to audit your own configuration rather than as an escape plan.
- Ask for enumeration first and a findings summary before any write or mount
- Log every command for the engagement report
- Use the skill to check your own isolation, for example whether --privileged or a mounted docker.sock is present
What people use it for
- Testing whether a privileged container can mount and read the host root filesystem during an authorized pentest.
- Checking whether a Docker socket mounted into a container is writable and what the Docker API exposes.
- Auditing which Linux capabilities a container holds, such as CAP_SYS_ADMIN, and whether they enable an escape.
- Building a lab exercise for a security course on container breakout and the matching defences.
- Reviewing a Kubernetes or container engagement for host namespace sharing such as hostPID or hostNetwork.
Frequently asked questions
Is the offensive-container-escape skill free to use?
The source file is licensed under MIT. That licence governs use of the skill's files, so check the licence text on the directory page for the exact terms. The tools the skill references, such as deepce and CDK, are separate projects with their own licences.
How do I install an agent skill in Claude?
Download the skill ZIP and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can instead upload it under Settings, then Capabilities, then Skills.
What does the container escape skill require?
It needs a Linux shell inside the target container, python3 and curl for socket checks, and network access to GitHub if the agent downloads deepce. Tools such as capsh, amicontained, deepce and CDK are referenced in the file and downloaded at runtime.
Does the skill run scripts on my machine?
Yes. The skill is marked as running scripts and using the network. It runs commands inside the container you are testing and may download tools, so confirm your engagement allows that before you use it.
Which container runtimes does the skill cover?
The description names Docker, containerd and Podman runtimes. It also covers runc CVEs, Kubernetes-style cgroup paths in its detection checks, and Dockerfile misconfigurations such as --privileged and host namespace sharing.
Can I use this skill for a legal penetration test?
Only with explicit written authorization for the specific target and scope. The skill's own guidance is aimed at authorized testers and red teams, and it describes persistence and backdoor steps that are illegal against systems you do not own.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are an authorized penetration tester or red team with written scope for a container or Kubernetes environment, or if you are building a lab on container breakout. Pick something else if you want a hardening guide, because this file describes attack steps rather than defences, or if you would be running it against production systems without approval.
Download the skill