feat: add docker-destructive-guardrails skill - #17
Conversation
Review: docker-destructive-guardrailsThe skill content and eval coverage are solid — the two-tier container model is well-reasoned, the flag semantics are audited against real Interface gaps with docker-agent's safety mechanismdocker-agent has a layered safety system ( 1. Tier 1 auto-proceed is blocked by the runtime in Balanced/Strict mode The skill says:
But 2. Autonomous mode bypasses Tier 2's hard guarantees The skill is emphatic that 3. The skill documents 4.
Smaller issues
Suggested next stepBefore merging, I'd suggest a short sync with the docker-agent safety team to agree on:
The behavioral policy itself is in good shape — this is about making sure the two layers agree on what they're each enforcing. |
|
Sources:
Locations to update:
The dialogue in This one matters more than the usual doc nit because it's the specific rule the skill is trying to protect the user from getting wrong: an agent following the current phrasing could conclude a stopped container's image is safely prunable, which is the exact "surprising deletion" outcome this skill exists to prevent. Suggested phrasing: "any image not referenced by any container (running or stopped)" — or, if you want to preserve the "system prune -a is deceptively broad" framing, note that |
AI agents need explicit guardrails so they never run an irreversible Docker command without the user's consent. Adds a confirm-before- destroy policy: docker-compose-patterns documents its own destructive commands, and a new docker-destructive-guardrails skill covers the generic Docker CLI, audited against real `--help` output instead of picked ad hoc. Container commands get a two-tier model so cleaning up an agent's own disposable test container doesn't need the same friction as deleting a volume. All four skills cross-reference each other for routing. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
The image prune -a description said images are protected by a running container, but Docker considers any container — running or stopped — a reference. That gap could lead an agent to conclude a stopped container's image is safely prunable, the exact surprising deletion this skill exists to prevent. Also document docker stop, which the runtime's safety classifier flags as destructive but the skill was silent on; tighten the cross-skill index header and the compose external-volume carve-out; and add an eval check guarding allow_implicit_invocation. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
ba7e366 to
018416e
Compare
|
|
||
| `docker kill` is always Tier 2 (see the reference for why no stopped-container exception exists for it). Also Tier 2: `docker rm -f` on a *running* container, any unscoped sweep regardless of container state (e.g. `docker rm -f $(docker ps -aq)`, "remove/kill all containers"), a container the agent didn't create and has no context on, and any action taken on the agent's own initiative rather than an explicit user ask. These carry the same confirmation bar as every flat-rule command in this skill: state exactly what will be lost and get explicit confirmation before running anything — no exception carved out. | ||
|
|
||
| ### `docker stop` — reversible, outside the tier model |
There was a problem hiding this comment.
[medium] Tier 1 incorrectly includes the host-wide docker container prune sweep.
docker container prune cannot meet the stated Tier 1 conditions because it always removes every stopped container on the host, rather than one specifically identified container. Yet this paragraph explicitly lists it as Tier 1, while Tier 2 says any unscoped sweep requires confirmation. For example, when an agent cleans up its own test container while another stopped container exists, following the Tier 1 listing can remove both without confirmation. Remove docker container prune from Tier 1 so it follows the existing Tier 2 rule for unscoped sweeps.
| ### `docker stop` — reversible, outside the tier model | |
| Applies only to `docker rm <name>` on an already-stopped container and `docker rm -f <name>` on a container the agent itself created and started earlier in the same session purely for testing or debugging. All of the following must hold: the container is already stopped, or was created/started by the agent itself this session for testing/debugging; there's no known unpersisted state at risk; and the action targets one specific, identified container rather than an unscoped sweep. When every condition holds, the agent removes the container, states what it did, and proceeds — no blocking confirmation is required first. |
| Confidence | Score |
|---|---|
| 🟢 strong | 100/100 |
|
@glours can you look at the reviewer's feedback? |
|
@melmennaoui the mechanical fixes (image prune -a scope, docker stop, cross-skill index header, skill.yaml carve-out, allow_implicit_invocation eval check) are in. The remaining open item is the four-point interface gap with docker-agent's runtime classifier (Tier 1 blocked in Balanced/Strict, Tier 2 bypassed in Autonomous, Before we pick a direction here, we'd like the your team's input on your three suggested discussion points:
cc @aheritier @dgageot @trungutt @hamza-jeddad, how do you want to run this sync? |
Tier 1 and Tier 2 both matched the same case — an agent's own still-running test container removed without an explicit user ask — with no stated precedence, so the text could justify either outcome. The cross-skill index also still described docker-sandboxes-lifecycle's sbx guardrails as an unmerged, pending PR, so an agent routing off it would treat existing guidance as nonexistent. Also close eval-coverage gaps for three documented commands, add the skill's required CODEOWNERS entry, and trim an overstated frontmatter claim. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
What I did
AI agents need explicit guardrails so they never run an irreversible Docker command without the user's consent. Adds a confirm-before- destroy policy: docker-compose-patterns documents its own destructive commands, and a new docker-destructive-guardrails skill covers the generic Docker CLI, audited against real
--helpoutput instead of picked ad hoc.Container commands get a two-tier model so cleaning up an agent's own disposable test container doesn't need the same friction as deleting a volume. All four skills cross-reference each other for routing.
Related issue
N/A
Checklist
task validateandtask evalpass locally.(not mandatory) A picture of a cute animal, if possible in relation to what you did
