The Deska blog
AI Coding Agents for DevOps and SRE Work: IaC, Incidents and Toil
Evaluate how AI coding agents for DevOps and SRE automate IaC, manage incidents, and reduce toil using tools like Claude Code and OpenCode in a unified canvas.
10 min read
The rise of AI coding agents for DevOps and SRE work marks a shift from simple autocomplete snippets to autonomous entities capable of managing complex infrastructure lifecycles. While software engineers use these agents to write features, Site Reliability Engineers (SREs) and DevOps professionals are beginning to leverage them for Infrastructure as Code (IaC) generation, incident remediation, and the elimination of operational toil. These agents operate best when they have access to the same tools a human uses: a terminal, a browser for documentation, and a code editor.
The Evolution of Automation in SRE
Traditional automation in DevOps relied on static scripts and highly structured pipelines. If a deployment failed, a human had to parse the logs, identify the misconfiguration, and manually apply a fix. AI coding agents change this dynamic by interpreting error messages and suggesting or applying changes to Terraform files, Kubernetes manifests, or Helm charts.
The primary advantage of using AI coding agents for DevOps is their ability to handle non-deterministic tasks. While a Bash script follows a rigid path, an agent can observe the output of a kubectl describe command and decide whether to check the logs of a sidecar container or inspect a Resource Quota. This level of autonomy requires a robust environment where the agent can interact with various CLI tools securely.
Reducing Operational Toil with AI Agents
Toil is the kind of work tied to running a production service that tends to be manual, repetitive, and devoid of enduring value. AI agents excel at reducing this burden by taking over routine chores:
- Updating dependencies across multiple repositories simultaneously.
- Refactoring legacy CloudFormation templates into modern Terraform modules.
- Writing boilerplate unit tests for custom CI/CD pipeline logic.
- Cleaning up orphaned cloud resources based on cost report data.
By delegating these tasks to agents, SRE teams can focus on high-level architecture and reliability engineering. The goal is not to replace the engineer but to increase their leverage.
Managing Incidents on an Infinite Canvas
Incident response is perhaps the most demanding aspect of the SRE role. When a production outage occurs, the mental load of switching between monitoring dashboards, terminal tabs, and incident logs can slow down resolution times.
A specialized environment like the Deska canvas changes how engineers visualize an incident. Instead of buried tabs, you can place a terminal running k9s next to a panel displaying New Relic metrics and another panel where an AI agent like Claude Code is analyzing the latest stack trace. This spatial arrangement allows the engineer to maintain a birds-eye view of the entire system.
You can run multiple agents side by side as panels within Deska. For example, you might have Codex CLI focused on querying Prometheus metrics while OpenCode suggests patches for the application code. This multi-agent approach ensures that each tool focuses on its specific strength within the context of the incident.
Integrating AI into IAC Workflows
Infrastructure as Code (IaC) is often prone to syntax errors or configuration drift. AI coding agents can assist by:
- Generating initial resource definitions from natural language descriptions.
- Validating Terraform plans against security best practices.
- Automating the migration of resources between cloud providers.
A local-first approach is critical here. Since IaC files often contain sensitive architectural details, keeping the code and the agent's execution environment on your local machine is safer than using web-based IDEs that require uploading your entire repository to a remote server. Deska ensures that your code and sessions stay local, using your own API keys for the LLM providers.
Comparing Agent Architectures for Infrastructure
Different agents approach DevOps tasks with different philosophies. It is important to choose the right tool for the specific infrastructure challenge at hand.
| Agent Tool | Primary Strength | Integration Style |
|---|---|---|
| Claude Code | High reasoning for complex debugging | Terminal-based interaction |
| Codex CLI | Rapid command generation and execution | CLI wrapper |
| OpenCode | Open-source flexibility for custom tasks | Modular panel integration |
These tools differ in approach when it comes to state management and tool use. Some are better at exploration, while others are optimized for precise edits to large YAML files. Using them side by side in a workspace allows you to cross-reference their outputs.
Mobility and Remote Monitoring
SREs are frequently on call, meaning they need to monitor systems outside of traditional office hours. While a full desktop environment is ideal for deep work, a mobile companion app allows an engineer to check on the status of an agent-led remediation.
Through a secure relay that does not expose ports to the internet, you can pair your mobile device with your desktop. This enables you to see the progress of an AI agent as it works through a runbook or to run a quick command via Ask Deska to restart a service while you are away from your desk.
FAQ
How do AI agents for DevOps handle secret management?
Agents should never have direct access to raw secrets like API tokens or private keys in plain text. It is best practice to use environment variables or a secrets manager that the agent can reference by name. When running agents locally, they inherit the permissions of your local terminal, so you must carefully manage the IAM roles configured in your shell.
Can AI agents write HCL and YAML accurately?
Large language models are highly proficient at structured data formats like HCL for Terraform and YAML for Kubernetes. However, they can occasionally hallucinate parameters or use deprecated API versions. Always review the execution plan or use a linter before applying changes to production environments.
Is it safe to give an AI agent terminal access?
Granting terminal access to an agent is a powerful but sensitive privilege. Using a local-first workspace provides a layer of control. You can observe every command the agent intends to run and intervene if a command looks destructive. This human-in-the-loop requirement is essential for high-stakes SRE work.
Getting Started with AI-Driven DevOps
Adopting AI agents for infrastructure management is an iterative process. Start by using agents for low-risk tasks like writing documentation or generating Prometheus queries. As you gain confidence in the agent's ability to navigate your specific environment, you can move toward more complex IaC refactoring and incident assistance.
To explore how a spatial workspace can improve your DevOps workflow, you can download Deska for free. By arranging your terminals, browser panels, and AI agents on a single infinite canvas, you create a dedicated command center for your infrastructure that remains local, secure, and under your control.