Home › Prompt examples › IT ops & DevOps AI prompts: 21 copy-ready examples

IT ops & DevOps AI prompts: 21 copy-ready examples

21 prompts from 7 it ops & devops guides, ready to copy into any AI chat assistant.

Replace the [brackets] with your details. Every prompt comes from one of our full guides, which also covers which tool to use, the steps and the risks. Want a prompt for something else? Use the prompt builder.

Tasks on this page

AI prompts to write a shell or PowerShell script

When to use: Generate and explain admin scripts before running them. Full guide: Write a shell/PowerShell script

Read-only first
Write a PowerShell 7 script using the [module] module that LISTS (does not change) [objects] where [condition]. Output name, last change date and the reason it matched to a CSV. Explain each line in a comment.
Add a safe change step
Now add the change: [action]. Support -WhatIf and -Confirm, stop on the first error, and write every change to a log file. List separately every line that modifies or deletes something.
Explain before I run
Explain this script line by line for someone new to PowerShell. Flag anything that changes, deletes or needs admin rights, and anything that would behave differently on a large directory:

[paste script]

AI prompts to explain logs and error messages

When to use: Paste logs and get a likely root cause and next steps. Full guide: Explain logs and errors

Rank the causes
Here's an error from [system/version] after [recent change]. Give the 3 most likely causes, ranked, quoting the log line that supports each. Then give a read-only command to confirm each one.

[paste masked log]
Explain the message
Explain this error in plain words: what component raised it, what it was trying to do, and what usually causes it. Don't suggest fixes yet.

[paste]
Write the incident note
Using this log and what we found ([findings]), write a short incident note: what happened, impact, root cause, fix, and one prevention step.

AI prompts to draft a runbook

When to use: Turn a messy procedure into a step-by-step runbook. Full guide: Draft a runbook

Messy notes to runbook
Turn these notes into a runbook with these sections: Purpose, When to use, Prerequisites and access needed, Steps (numbered, one action each), How to verify, Rollback, Escalation contacts (as placeholders). List anything unclear as questions at the end.

[paste notes]
Free runbook template
Write a blank, reusable runbook template for [type of task, e.g. restarting a service or rotating a certificate], with short guidance under each heading and one example step.
Find the gaps
Review this runbook as a new on-call engineer. Where would you get stuck? Which steps assume access or knowledge not listed? Which steps change or delete something without a check first?

[paste runbook]

AI prompts to make infrastructure-as-code changes

When to use: Agent edits Terraform/Kubernetes files and opens a PR. Full guide: Infrastructure-as-code changes

Plan first
In this repo, I want to [change, e.g. add a staging copy of the web app with smaller instance sizes]. Before editing, list the files you'll change and why. Don't run apply or any command that changes real infrastructure.
Make the change
Make the change on a new branch, run terraform fmt and validate, and open a pull request. In the description, list every resource that will be created, changed or destroyed.
Review a diff
Review this infrastructure diff. Flag anything that destroys or replaces a resource, widens network or IAM access, or hard-codes a secret.

[paste diff]

AI prompts to set up a CI pipeline

When to use: Create or fix CI workflows (GitHub Actions/GitLab CI). Full guide: CI pipeline setup

Build and test
Write a GitHub Actions workflow for a [language] project that installs dependencies, runs [test command] on every pull request, and caches dependencies. Use minimal permissions (contents: read). No deploy steps.
Fix a failing run
This CI run fails. Explain the cause from the log, then propose the smallest change to the workflow file. Don't disable or skip tests.

[paste log + workflow]
Harden it
Review this workflow for security: overly broad permissions, unpinned actions, secrets printed to logs, and steps that run on untrusted pull requests.

[paste]

AI prompts to turn alerts into tickets

When to use: Route monitoring alerts through an AI step into tickets or chat. Full guide: Alert-to-ticket automation

Design the flow
Design an alert-to-ticket workflow for [monitoring tool] to [ticket or chat tool]. Steps, which alert fields to pass to the AI step, the AI prompt, how to set severity, and what happens if the AI step fails. The AI must never close or suppress alerts.
The AI step prompt
Write the prompt for the AI step. Input: alert JSON with [fields]. Output: JSON with title (max 80 chars), one-line summary, suggested severity (P1-P4) with reason, and likely owner team. If unsure, set severity to P2 and say why.
Test cases
Give me 6 realistic test alerts (including one duplicate and one malformed payload) to check this workflow, and the output I should expect for each.

AI prompts to build a helpdesk agent for staff

When to use: Internal agent answering IT questions from a knowledge base. Full guide: Helpdesk agent for staff

Scope the agent
Help me scope an internal IT helpdesk agent. Here are our top 20 ticket types: [list]. Sort them into: answer from knowledge base, hand off to a person, never handle (account changes, access requests). Explain each.
Agent instructions
Write the instructions for an IT helpdesk agent: answer only from the connected knowledge base, link the article used, never ask for passwords, hand off to [queue] when unsure, and never change accounts or permissions.
Test questions
Write 15 test questions for this agent, including 3 it should refuse (password requests, access changes) and 3 that aren't in the knowledge base.

More prompt examples

All prompt examples · Writing & editing · Coding · Research · Customer support · Data analysis · Automation & agents · Image & video · Personal productivity · Education & learning · Marketing · Sales · HR & recruiting · Finance & accounting · Legal & compliance · Healthcare admin · Cybersecurity · Product & design · Personal life & home · Travel · Content creation · Small business

See also: Best AI tools for it ops & devops

Report an error on this page