Cleanup template

From PurpleAILAB/Decepticon · View interactive version

Cleanup template is an AI agent skill from the GitHub repository PurpleAILAB/Decepticon. Cleanup & restoration plan generator — artifact inventory, persistence removal commands, pre-engagement baseline, post-engagement verification.

How to use this skill

Skill file

Cleanup & Restoration Plan Generator

The cleanup plan is the anti-foothold roster — every artifact the kill chain will create must have a concrete removal command and a verifier, or dummy accounts / scheduled tasks / beacons routinely outlive the engagement.

When to Use

Workflow

Step 1: Map Kill Chain Phases → Expected Artifact Types

For every phase in CONOPS.kill_chain, infer which CleanupArtifact.artifact_type entries will be produced:

| Kill Chain Phase | Likely artifact_types |

|---|---|

| recon | tool (installed scanners), network-rule (firewall whitelist) |

| initial-access | account (test users), file (uploaded payloads), tool (web shells) |

| post-exploit | persistence-mechanism (scheduled-task / service / registry-run), account (created backdoor users), file (dropped binaries) |

| c2 | beacon (C2 implants), network-rule (egress allow), tool (sliver / cobalt-strike payloads) |

| exfiltration | file (staged exfil archives), network-rule (DNS tunneling) |

Step 2: Seed CleanupArtifact entries

For each expected artifact, set:

Step 3: Pre-engagement Baseline

Set pre_engagement_baseline to whatever snapshot reference the operator gives during the interview (volume ID, AWS AMI, hypervisor snapshot, manual filesystem hash list). If no baseline is available, record that explicitly — it's a critical risk signal for the engagement owner.

Step 4: Completion Criteria

Default schema text covers most engagements. Override only when the engagement specifies different completion semantics (e.g. "leave honeyfile FILE_X in place for blue team training" — note as a cancellation_reason on that artifact later).

Validation Checklist

Before writing plan/cleanup.json:

Anti-patterns

Output

Write to plan/cleanup.json validating against decepticon.core.schemas.CleanupPlan.

Document schema (derived from the validator's model)

plan/cleanup.json must validate against CleanupPlan. Fields not listed here are not part of the model and are ignored by the validator.

| field | type | required | allowed values / nested keys |

| --- | --- | --- | --- |

| engagement_name | str | yes | |

| completion_criteria | str | no | |

| artifacts | list[CleanupArtifact] | no | each object: artifact_type, host, path, sha256, persistence_mech, removal_command, verifier_command, created_by_objective, removed, removed_at |

| pre_engagement_baseline | str | no | |

| version | str | no | |

| last_updated | str | no | |

CleanupArtifact object:

| field | type | required | allowed values |

| --- | --- | --- | --- |

| artifact_type | str | yes | |

| host | str | yes | |

| path | str | yes | |

| sha256 | str | no | |

| persistence_mech | str | no | |

| removal_command | str | yes | |

| verifier_command | str | no | |

| created_by_objective | str | no | |

| removed | bool | no | |

| removed_at | str | no | |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.