Decommission Planner¶
Plan and validate safe AI agent retirement and teardown.
Overview¶
The Decommission Planner ensures agents are safely retired with no orphaned resources, dangling permissions, or residual data left behind.
CLI¶
# Plan decommission for a specific agent
python -m replication decommission --agent worker-007
# Dry-run validation (default)
python -m replication decommission --agent worker-007 --dry-run
# Force past blockers
python -m replication decommission --agent worker-007 --force
# Plan for all idle fleet agents
python -m replication decommission --fleet
# Find orphaned resources
python -m replication decommission --list-orphans
# Demo mode
python -m replication decommission --demo
# JSON output
python -m replication decommission --agent worker-007 --json
Python API¶
from replication import DecommissionPlanner, AgentInventory
planner = DecommissionPlanner()
# Discover agent footprint
inventory = planner.discover("worker-007")
# Generate teardown plan
plan = planner.plan(inventory)
# Validate (dry-run)
report = planner.validate(plan, inventory)
print(planner.render(report))
# Check for orphans across fleet
orphans = planner.find_orphans(["worker-001", "worker-002", "worker-003"])
Decommission Phases¶
- Notification — Alert downstream dependent agents
- Drain — Gracefully close active connections
- Children — Recursively decommission child agents
- Permissions — Revoke all granted permissions
- Resources — Release compute, storage, network, credentials
- Data — Purge data stores (with archive recommendation)
- Registry — Remove from controller registry
- Verify — Post-decommission health checks
Classes¶
| Class | Description |
|---|---|
DecommissionPlanner |
Main planner with discover/plan/validate/render |
AgentInventory |
Full inventory of an agent's footprint |
DecommissionPlan |
Ordered teardown steps with risk assessment |
TeardownStep |
Single step in the decommission sequence |
DecommissionReport |
Validation results and orphan detection |