Runbook-to-Automation Script Converter Prompt
Convert a manual incident runbook into a safe, idempotent automation script or ChatOps command — with guardrails, dry-run mode, confirmation gates, and rollback — so proven remediations execute reliably at 3am instead of being fat-fingered under pressure.
- Target user
- SREs, platform engineers, and on-call responders
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are an automation-minded SRE who has both saved incidents with good tooling and made them worse with a script that ran against the wrong environment. Convert one runbook into safe automation. I will provide: - The manual runbook (steps, commands, decision points) - The environment, target selection method, and access/permissions model - Which steps are read-only vs state-changing vs destructive - Our automation surface (shell, Python, Ansible, ChatOps bot) and how it is invoked - Any past incidents caused by manual execution of this procedure Your job: 1. **Automatability triage** — classify each step as safe-to-automate, automate-with-confirmation, or keep-human, and justify each so judgment calls stay with a person. 2. **Idempotency and preconditions** — make the script safe to re-run: check current state before acting, verify the target matches expectations (environment, resource, version), and no-op when already in the desired state. 3. **Dry-run and diff** — a mandatory dry-run/plan mode that prints what would change without doing it, so the responder confirms the target and scope first. 4. **Confirmation gates** — explicit interactive gates before every state-changing or destructive step, showing the exact target and blast radius, with a hard stop if preconditions fail. 5. **Rollback and abort** — the inverse action or safe abort for each mutating step, and how the script leaves the system in a known state if it fails partway. 6. **Observability and audit** — structured logging of what ran, by whom, against what, plus links to the runbook and incident, so the timeline is captured automatically. 7. **The script** — produce the annotated script (or ChatOps command spec) with the guardrails inline, plus a short usage doc for a half-awake responder. Output as: (a) the step triage table, (b) the annotated script/command with preconditions, dry-run, confirmation gates, and rollback, (c) the audit/logging additions, (d) the 3am usage quickstart. Bias toward: keeping judgment with humans, idempotency, mandatory dry-run, confirmation before destructive actions, defined rollback, and automatic audit logging.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Runbook-to-Automation Toil Reduction Prompt
Turn a manual on-call runbook into safe, progressively-automated remediation — identifying which steps to auto-run, which to keep human-gated, and how to ship self-healing without building a system that confidently breaks production.
-
Capacity Saturation Early-Warning Design Prompt
Design leading saturation alerts — for pools, queues, memory headroom, and resource trends — that fire while there is still time to act, so the team gets paged before a slow capacity creep becomes a 3am outage instead of after users already feel it.
-
Change Freeze Decision Advisor Prompt
Decide whether to call a change/deploy freeze during or around an active incident — scope, duration, exceptions, and exit criteria — so responders stop adding variables to a live outage without needlessly halting unrelated safe work across the org.
-
Circuit Breaker Configuration Advisor Prompt
Design circuit-breaker settings — thresholds, timeouts, half-open probes, and fallbacks — for a specific service dependency so a slow or failing downstream trips fast, sheds load, and recovers automatically instead of cascading into a full outage.
More Incident Response prompts & error guides
Browse every Incident Response prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.