DevOps & SRE Prompts in 2026: AI Agents for Infrastructure, Monitoring, and Incident Response

Introduction

In 2026, the DevOps and SRE landscape has transformed dramatically. AI agents are no longer just code generators—they're proactive collaborators that can analyze logs, predict failures, and even suggest rollback strategies. But the key to unlocking their potential lies in how you communicate with them. This is where well-crafted prompts come in.

This guide provides 10 battle-tested prompts for infrastructure automation, monitoring, and incident management. Each prompt is designed to be a starting point—adapt them to your stack and workflows. Whether you're managing a Kubernetes cluster or a legacy monolith, these prompts will help you work smarter, not harder.

1. Infrastructure as Code (IaC) Troubleshooting

Prompt:

I'm working with Terraform and encountering an error when running `terraform plan`. Here's the exact error message: [paste error]. My current configuration file is: [paste relevant code]. Please explain the root cause and provide a step-by-step fix, including any necessary changes to the .tf file. Also, suggest preventative measures to avoid this in the future.

Why it works: This prompt gives the AI context (error + code), asks for a clear explanation and actionable fix, and encourages forward-thinking advice.

Example:
A user pasted a terraform plan error about a resource already existing. The AI identified it as a state drift issue and suggested running terraform import with the correct resource ID, then adjusting the configuration to match the real infrastructure.

2. Kubernetes Cluster Health Analysis

Prompt:

Analyze the following `kubectl get events` output from my Kubernetes cluster. Identify any patterns that could indicate node instability or pod scheduling issues. For each pattern, suggest a root cause and a specific remediation action. Also, recommend which Kubernetes metrics (e.g., from kube-state-metrics) I should monitor to catch this proactively.

Why it works: This prompt uses real cluster data and asks for pattern recognition and proactive advice.

Example:
The AI noticed repeated FailedScheduling events due to insufficient memory. It suggested adding resource requests/limits, using node affinity, or increasing cluster size. It also recommended monitoring kube_resource_* metrics.

3. CI/CD Pipeline Optimization

Prompt:

Review my GitLab CI/CD pipeline configuration (below). Identify bottlenecks and suggest optimizations to reduce build time by at least 20%. My pipeline currently takes 15 minutes. Consider parallelization, caching, and using smaller Docker images. Here's my .gitlab-ci.yml: [paste].

Why it works: It sets a clear goal (reduce build time), provides constraints, and asks for specific optimization strategies.

Example:
The AI suggested splitting the test job into parallel jobs, caching node_modules, and using a lighter base image like node:alpine. The pipeline time dropped to 10 minutes.

4. Monitoring Alert Triage

Prompt:

I received this alert from Prometheus: [alert details]. The alert fires when [condition]. Looking at the attached Grafana dashboard JSON, what do you think is the most likely cause? Please provide a list of possible causes ranked by probability, and for each, suggest a diagnostic command I can run to confirm. Also, recommend a runbook entry for this alert.

Why it works: It provides alert context, asks for a ranked hypothesis list, and requests actionable diagnostics.

Example:
For a high CPU alert, the AI suggested checking for a recent deployment, a failed batch job, or a memory leak. It provided commands like top and kubectl top pods to narrow it down.

5. Incident Response: Post-Mortem Drafting

Prompt:

Based on the following timeline of events from our incident (times in UTC, with error logs and actions taken), write a post-mortem report. Structure it as: summary, impact, root cause analysis, timeline, action items. For the root cause, use the "5 Whys" technique. Suggest at least 3 action items with priority levels. Timeline: [paste logs].

Why it works: It structures the output and uses a proven RCA framework.

Example:
The AI generated a post-mortem that identified a misconfigured health check as the root cause, and proposed action items like adding timeout settings and better alerting.

6. Security: Vulnerability Remediation

Prompt:

Here is a list of vulnerabilities from my container registry scan (output attached). For each vulnerability, explain the risk in simple terms, then provide a specific command or Dockerfile change to fix it. Prioritize by severity. Also, suggest a policy for continuous scanning.

Why it works: It asks for prioritization and concrete fixes, plus a long-term policy.

Example:
For a critical vulnerability in OpenSSL, the AI suggested updating the base image and rebuilding. For a medium one, it suggested using a distroless image.

7. SRE: SLI/SLO Design

Prompt:

I need to define SLOs for a new payment service. Propose a set of SLIs (e.g., availability, latency, error rate) with specific metrics and thresholds. Use Google's SRE workbook as a reference. For each SLI, explain how to measure it and what a reasonable SLO would be for a financial service. Also, suggest an error budget policy.

Why it works: It references industry standards and asks for context-aware recommendations.

Example:
The AI suggested an availability SLO of 99.95%, a latency SLO (p95 < 200ms), and an error rate < 0.1%. It also explained how to calculate error budgets.

8. Cost Optimization in Cloud

Prompt:

Here is my AWS billing report for the last month (CSV attached). Identify the top 5 cost drivers and suggest specific actions to reduce costs by at least 15%. Consider reserved instances, right-sizing, and eliminating idle resources. Prioritize by impact.

Why it works: It uses real data and asks for actionable, prioritized recommendations.

Example:
The AI noticed a high spend on EC2 instances, suggested switching to Spot Instances for non-critical workloads, and recommended using AWS Compute Optimizer.

9. Log Analysis & Anomaly Detection

Prompt:

Given this sample of application logs (attached), identify any anomalies or error patterns. For each, provide a potential root cause and a recommended fix. Also, suggest a regex pattern I can use in my log aggregator to detect this automatically.

Why it works: It uses real logs and asks for both immediate and proactive solutions.

Example:
The AI found a recurring Connection refused error, traced it to a misconfigured service discovery, and provided a regex to alert on similar errors.

10. Disaster Recovery Planning

Prompt:

I need to create a disaster recovery plan for our microservices architecture. Assume a regional outage. Outline a step-by-step runbook for failover to our secondary region, including checks for data consistency. Use AWS Multi-AZ and RDS for reference. Also, define RTO and RPO targets.

Why it works: It sets a specific scenario and asks for a detailed, actionable runbook.

Example:
The AI produced a runbook with steps like updating Route 53, verifying RDS replicas, and running smoke tests. It suggested an RTO of 1 hour and RPO of 15 minutes.

Conclusion

These prompts are just a starting point. The key to effective AI collaboration is clarity and context. Always provide relevant data, specify your goals, and ask for actionable output. As AI agents evolve, they will become even more integrated into our workflows, but the fundamentals of good prompting—specificity, context, and a clear ask—will remain essential.

Start experimenting with these prompts today, and you'll see immediate improvements in your infrastructure management, monitoring, and incident response. For more advanced techniques, consider exploring AI-powered tools like ASI Biont that can further automate your DevOps processes.

← All posts

Comments