Skip to content
Back to skills

Agent Incident Damage Audit

BSecurity

After an agent session deleted or damaged something, assess the full blast radius, check whether the loss can be recovered, verify the session's own fix, and propose mechanical guards that work even when the model's reasoning is wrong.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsgobashdockergitsecurity

Security analysis

B85/100
  • highPerforms destructive filesystem operations

Pro shows the line behind each finding and how to fix it

Scanned November 30, 2026

npx -y skills add williamblair333/Uncle-J-s-Refinery --skill agent-incident-damage-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Incident Damage Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Incident Damage Audit
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/williamblair333-agent-incident-damage-audit/badge)](https://www.skillsdirectory.com/skills/williamblair333-agent-incident-damage-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-incident-damage-audit
description: After an agent session deleted or damaged something, assess the full blast radius, check whether the loss can be recovered, verify the session's own fix, and propose mechanical guards that work even when the model's reasoning is wrong.
---

# Agent Incident Damage Audit

## When to use
- Another Claude session (or a background agent) ran a destructive command and lost data. Examples: a VM teardown that deleted an attached ISO, an `rm -rf`, or a `git reset --hard`.
- The user asks "what else did it break?", "can I get it back?" or "how do we stop this happening again?"

## Steps

### 1. Reconstruct the timeline from the transcript
- Find the exact window, for example "10:11–10:22".
- Trace the chain: what the session moved or created, what it attached the data to, and which command deleted it.
- Find the command's underlying behaviour. A `just` recipe may wrap something like `virsh undefine --remove-all-storage`. Read the recipe and the flag's meaning: that flag deletes *every* attached storage file, including a CD/DVD ISO.
- Find the claim that licensed the action. Example: a pre-mortem line saying "the ISO is never modified" that nobody verified.

### 2. Check that nothing else was damaged
Check each asset class directly. Don't infer from the transcript.
- **Sibling resources:** e.g. `virsh list --all`, and confirm each domain's disk file still exists.
- **Neighbouring data:** list sibling folders, such as other ISOs.
- **Side-effect config:** note anything new and say whether it's harmless. Example: an auto-created libvirt storage pool from `virt-install`.
- **Every risky command in the transcript:** sweep for `rm`, `sudo`, `chmod`, `git push`, `virsh` and merges or branch deletes. Confirm each one touched only the project's own repo or scratch area.

### 3. Assess whether the loss can be recovered
Check these in order and report each one:
- Is there an open file handle to copy it back from? For example, check for a process that still has the file open.
- Does the filesystem have snapshots (btrfs, zfs, LVM)? Plain ext4 has none.
- How much time and write activity has passed? Undelete on a live disk is a long shot for large files.
- If it can't be recovered, give the re-acquisition path: where to download it, where to put it, and the expected checksum from the transcript.

### 4. Verify the session's own fix
- Read the fix commit at `file:line`. Confirm it narrows the delete correctly, e.g. remove only the VM's own disks and leave the CD/DVD media alone.
- Note whether it added a test or a memory note.
- State the branch and the push/merge status plainly ("on `feat/x`, not pushed or merged").

### 5. Root-cause the process failure, not just the command
- Find the existing rule that should have caught it, cited at `file:line`.
- Ask whether anything mechanically enforces that rule. If the model simply ignored it, rewording the rule won't help.
- Separate the failure modes:
  - **An unchecked claim:** a statement about runtime behaviour that nobody verified.
  - **No check at the moment of deletion:** e.g. the "rollback" or "test cleanup" step never got its own review.

### 6. Propose guards, most important first
The best fix works even when the model's reasoning is wrong:
1. **A PreToolUse Bash guard** that blocks known data-destroying commands: `virsh undefine --remove-all-storage`, `vol-delete`, `rm -rf`, `dd of=`, `mkfs`, `git clean -fdx`, `git reset --hard`, `docker volume rm` and `docker volume prune`.
   - Also inspect `just` recipes and scripts that *contain* those commands.
   - Allow scratchpad, `/tmp` and ignored build folders.
   - Otherwise require a dry run (e.g. `domblklist --details`, `ls`) and user confirmation.
2. **Evidence-gated clearances.** A pre-mortem CLEAR about RECOVERY, DATA or SECURITY must cite a `--help`/man-page line, a `file:line`, or a command and its output. The token-writing script refuses to issue a clearance token without that citation.
3. **Skill rules:**
   - "The rollback is an action too": it gets its own check before it runs.
   - "Name the files": list every file a delete will remove before running it.
4. **A regression test from the real transcript.** Feed the incident's pre-mortem text to the token check and assert it refuses. Feed the incident command to the guard and assert it blocks.

Changes to hooks go through a branch, a pre-mortem and a PR. Propose the work and wait for "go".

### 7. Self-correct before building
- Find the exact file that owns each change. A hook name may be a folder of several scripts. Use the installed hook listing to find the one that actually writes the token.
- Widen any search that backs a "nothing exists" claim. Search all `.sh` files in the repo index, not just `hooks/**`, then restate the finding.
- Check memory for an existing guard, such as an `rm -rf` guardrail, before building a duplicate.

## Report shape
1. **The verdict first:** what was lost and whether anything else was damaged.
2. **What happened:** a numbered timeline.
3. **Is anything else broken?** One bullet per asset class checked.
4. **Can it be recovered?** One bullet per avenue, ending with the re-acquisition path.
5. **The fix:** commit, `file:line`, the verification, and the branch status.
6. **The lesson:** the process gap the fix doesn't close.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.