AI DevOps agents for small teams: what they can do safely
What an AI agent for DevOps does well for a team without an ops person, where it goes wrong, and the rules that let it work on real infrastructure: read-only first, reviewed changes, approvals bound to what you reviewed, narrow credentials, no secrets in the chat.
TL;DR
- An AI agent for DevOps is a language model that can use tools (a shell, your cloud's API, Git, your CI) in a loop to do operations work, not only answer questions about it.
- For a small team it is most useful for writing Dockerfiles, CI workflows and infrastructure code, reading logs and investigating incidents.
- The risk is in what it may change: destructive commands, secrets reaching the model or logs, prompt injection from content it reads, credentials broader than the task, and changes nobody reviewed.
- The safe pattern: the agent proposes, you review a plan or a pull request, your approval covers exactly that, and CI or the IaC tool applies it with narrow, short-lived credentials.
On this page
An AI agent for DevOps is a language model that can use tools, such as a shell, your cloud's API, Git and your CI, to do operations work rather than only talk about it. For a small team without an ops person it is useful, and what makes it safe or dangerous is not the model but what it is allowed to change. Product facts below come from each vendor's own documentation, checked on 11 November 2026.
What an AI agent for DevOps is
A chatbot answers. An agent acts. Anthropic (opens in a new tab) describes Claude Code (opens in a new tab) as a tool that "reads your codebase, edits files, runs commands, and integrates with your development tools"; AWS (opens in a new tab) describes its DevOps Agent as a teammate that "autonomously investigates incidents, provides root cause analysis and mitigation steps". Both describe the same loop: the model chooses a tool, runs it, reads the result and decides what to do next, until the task is done or it needs you.
The word "agent" covers several kinds of product today:
- Coding agents that you run in your terminal, your editor or a cloud sandbox: Claude Code, GitHub (opens in a new tab) Copilot's cloud agent and others. They are general-purpose, so they do ops work when you point them at it: a Compose file, a Terraform (opens in a new tab) module, a failing workflow.
- Cloud vendors' operations agents: AWS DevOps Agent and Azure (opens in a new tab) SRE Agent connect to your monitoring, your incidents and your code, investigate problems and propose mitigations.
- Agents inside a delivery platform: Harness's DevOps Agent builds pipelines in Harness; GitLab (opens in a new tab) Duo Agent Platform has a flow that fixes failing CI/CD pipelines.
- Open-source investigators: HolmesGPT, which looks into incidents on any stack, and K8sGPT, which explains problems in Kubernetes (opens in a new tab) clusters.
- Deploy tools built around agents, such as OpsCrew, where agents do a fixed job (from your repository to a hardened server) inside approvals the tool enforces.
What each one actually does, what it costs and who it suits is in AI DevOps agents compared.
What AI agents do well for a small team
Agents help most with work that is tedious, well documented and easy to check.
| Work | What the agent does | Risk if it gets it wrong | How you check it |
|---|---|---|---|
| Deployment files | Writes a Dockerfile, a Compose file, a reverse proxy config | Low until deployed | Review the pull request; build it in CI |
| CI/CD | Writes or fixes a GitHub Actions (opens in a new tab) or GitLab CI workflow | Medium: workflows hold secrets | Review the diff, especially triggers and permissions |
| Infrastructure code | Drafts Terraform or OpenTofu (opens in a new tab) for a server, DNS, a firewall | High once applied | Read the plan before anything is applied |
| Investigation | Reads logs, metrics and recent changes; suggests a cause | Low if read-only | Check its evidence, not only its conclusion |
| Upkeep | Proposes dependency and image updates, flags expiring certificates | Low to medium | CI tests and a staging deploy |
| Changes on a live server | Runs commands over SSH | High: no review, no undo | Avoid; turn it into code instead |
| Documentation | Writes a runbook from what it set up | Low | Follow it once yourself |
The closer the agent's output is to a reviewable file, the safer and more useful it is; the closer it is to a command on a live system, the more it depends on you catching a mistake in a prompt dialog. So the strongest use for a small team is not "an agent that runs production" but "an agent that writes the production setup as code, and keeps reading it afterwards". If you are deploying an app you built with an AI tool, the guide to deploying an AI-built app to your own server and how to deploy a web app to a VPS show what that code looks like.
What goes wrong
Most of these risks appear in OWASP's Top 10 for LLM applications (2025 edition), and the agent vendors' own security pages describe the controls against them.
- Destructive or wrong actions. OWASP calls this Excessive Agency (LLM06): an agent with more functionality, permissions or autonomy than its task needs can do damage when its output is wrong or manipulated. In ops terms:
terraform destroy,docker volume prune, aDROP TABLE, a firewall rule that locks you out. - Secrets reaching the model or the logs. Whatever the agent reads goes into its context: a
.envfile, aterraform.tfstate, the output ofenv. OWASP lists Sensitive Information Disclosure as LLM02. - Prompt injection. An agent that reads a README, an issue, a web page or a log line can be steered by instructions hidden in it. OWASP's LLM01 calls this indirect prompt injection, and Anthropic's security page lists safeguards against it while warning that "no system is completely immune to all attacks".
- Credentials broader than the task. A root SSH key, a cloud token that can delete every server, a classic GitHub token that reaches every repository. Whatever the agent can do with them, a mistake or an injection can do too.
- Changes nobody reviewed. A fix typed on the server at night works, and six weeks later nobody knows it exists. The next deploy overwrites it, or it becomes the one thing nobody dares to touch.
There is also cost. OWASP's LLM10 is Unbounded Consumption, and the vendors' agents are billed by use: AWS DevOps Agent, for example, at $0.0083 per agent-second of work, as listed on 11 November 2026. Cap what an agent may spend, as you would cap any other metered service.
Is it safe to let AI run commands on your server? goes through each risk in depth, with the controls that contain it.
Six rules for letting an agent near your infrastructure
These rules come from OWASP's mitigations, the cloud providers' guidance on least privilege and the controls agent vendors document. They work with any agent.
1. Read-only by default
Most of an agent's value in operations is reading: logs, metrics, configuration, recent commits. Give it that first. HolmesGPT, for example, says that by design it has "read-only access" and respects your RBAC permissions. Claude Code's plan mode has Claude (opens in a new tab) read files and run commands to explore, "but does not edit your source"; in a session where auto mode is available, a classifier rather than you approves those commands, so plan mode is a way of working, not a read-only credential. An agent that can only read can still be wrong, but it cannot break anything.
2. Changes as code, reviewed before they apply
Have the agent write each change as code: a pull request for the app and its workflows, an infrastructure plan for servers, DNS and firewalls. Terraform's plan -out saves exactly what would change, and terraform apply with that file "performs the operations in the saved plan without prompting you for confirmation", so the plan you read is the plan that runs. HashiCorp also advises that you "always re-check the final non-speculative plan before applying".
The agent vendors converge on the same idea. GitHub's Copilot cloud agent pushes to a single branch and "cannot approve or merge a pull request"; by default, workflows on its changes do not run until someone with write access approves them. Azure SRE Agent's Review mode has an administrator approve write actions before the agent runs them.
3. Approvals bound to exactly what was reviewed
"Yes, go ahead" in a chat is an approval of whatever the agent does next. Approving a saved plan file, or a plan's hash, is an approval of that change and nothing else: if the plan changes, the approval no longer fits. Merging a reviewed pull request is the same idea for code.
4. Narrow, short-lived credentials, and none for the agent itself
AWS's IAM guidance says to "grant only the permissions required to perform a task" and to have workloads use temporary credentials instead of long-lived keys. GitHub Actions can request "a short-lived access token directly from the cloud provider" through OpenID Connect, valid for one job. GitHub recommends fine-grained personal access tokens, limited to specific repositories, over classic ones.
For an agent, the best credential is often none. If it writes a pull request and CI applies it, the production credentials live in CI, scoped to the job, and never enter the agent's session.
5. Secrets stay out of the context
Do not paste tokens into a chat, and do not let the agent read files that hold them. Claude Code, for example, supports deny rules such as Read(./.env); Claude Code for DevOps shows a tested setup. Put secrets where your platform keeps them (GitHub's encrypted secrets, your cloud's secret store) and have the code read them at run time.
6. Sandboxes, allow-lists and a record
Run agents where a mistake stays small: Claude Code's sandbox limits which files and network hosts its shell commands can reach, and for more isolation Anthropic suggests running Claude Code itself in a container, a virtual machine or its sandbox runtime. Allow-lists and deny rules cut down prompts for routine commands, but Anthropic notes that a Bash rule matches the command text and "isn't a security boundary around the program". And keep a record: Git history for changes, and the audit logs the platforms offer (AWS DevOps Agent's activity is captured by CloudTrail, for example).
A ladder for adopting one
A small team can climb in steps and stop at the one that fits.
- Ask. Paste an error (without secrets) and get an explanation. No access at all.
- Read. Let the agent read the repository, logs and metrics, through read-only tools or a read-only token. Good for investigations.
- Write code. The agent opens pull requests: Dockerfiles, workflows, infrastructure code. You review and merge; CI deploys.
- Apply through plans. The agent prepares an infrastructure change; you approve the exact plan; the tool applies that plan and nothing else.
- Act on its own. The agent applies some changes without asking, inside limits: a vendor's autonomous mode, or an allow-list of commands. For a small team without anyone watching, this step needs the most caution and the narrowest scope.
Most small teams get most of the value at steps 2 to 4.
Where Claude Code fits
Many small teams already have a capable agent: the coding agent they use for the app. Claude Code can write the deployment, run commands with your approval, connect to tools through MCP, run skills and run unattended in CI, and it has the controls the rules above need: permission modes, allow and deny rules, hooks that can block a command before it runs, and a sandbox. Claude Code for DevOps covers each from Anthropic's documentation, with a hook we tested that refuses infrastructure-changing commands. To get an app Claude Code built online, see Claude Code built your app. Here is how to put it online.
Do you still need a person?
For one app on one server, often not full-time. Someone still has to own production: decide what matters, approve changes, answer when it breaks at night and test that backups restore. An agent can do much of the routine work and none of the accountability. Do you need a DevOps engineer for a small app? walks through what a small production app needs, what can be automated, and when to hire. If you are weighing outside help, OpsCrew vs hiring a DevOps freelancer compares the two.
How OpsCrew applies these rules
OpsCrew, the open-source tool this blog belongs to, is a crew of AI agents that takes an app from a GitHub repository to a hardened production deployment on your own cloud. Its documentation describes how it follows the rules above:
- Every change is a plan you approve by its hash. OpsCrew shows the plan with its cost and its SHA-256 hash, and your approval is bound to that hash, so a plan that changes needs a new approval (how the AI works). Removing a server or an app asks you to type its name.
- No secret goes to the model. The AI steps send parts of your code, never a key or a password, and no secret goes into a plan, a log, a report or a pull request (security).
- A model only where judgment helps. Two of its eight agents can use a model (reading your app, and changing its code in a pull request); the other six follow fixed rules, and with
--no-aiits analyze and adapt steps call no model at all. - Typed tools, not a shell. In Claude Code, OpsCrew's plugin gives the agent tools that never call a model, and each tool that changes something waits for your approval in a dialog that Claude cannot answer for you (the plugin). Its log and advice tools only read:
opscrew logsruns fixed, read-only Docker (opens in a new tab) commands, andopscrew advisechanges nothing until you apply a proposal through an approved plan (advice). - Narrow tokens. The guide lists the exact permissions each token needs, such as a fine-grained GitHub token for one repository (security).
How it works shows the steps from repository to live site. It is free; you pay your provider for the server.
Key facts
| Fact | Value | Source |
|---|---|---|
| OWASP risk for agents that can take damaging actions | LLM06:2025 Excessive Agency (excessive functionality, permissions or autonomy) | OWASP Top 10 for LLM Applications, LLM06:2025 Excessive Agency (opens in a new tab)Verified on |
| Claude Code's starting permission mode in a terminal | Auto (a classifier reviews actions) from v2.1.283; claude -p starts in Manual from v2.1.302Anthropic: auto mode reduces prompts but does not guarantee safety. | Claude Code, Permission modes (opens in a new tab)Verified on |
| AWS DevOps Agent price | 0.0083 USD per agent-secondInvestigations, evaluations and on-demand SRE tasks; billed per second of agent work. | AWS DevOps Agent pricing (opens in a new tab)Verified on |
Frequently asked questions
What is a DevOps agent?
An AI agent that does operations work by using tools: it reads your repository, logs and metrics, runs commands or API calls, and writes changes such as configuration, infrastructure code or a fix. Vendors use the name for different things, from AWS's incident investigator to coding agents that open pull requests.
Is it safe to give an AI agent SSH access to a server?
Only with limits: a user without root where possible, approval before each command, no secrets in the session, and ideally a sandbox or a tool that runs fixed, read-only commands. Changes are safer as code applied by CI than as commands typed by the agent on the server.
Sources
- OWASP Top 10 for LLM Applications 2025 (opens in a new tab)
- LLM06:2025 Excessive Agency (opens in a new tab)
- LLM01:2025 Prompt Injection (opens in a new tab)
- Claude Code, Security (opens in a new tab)
- Claude Code, Permission modes (opens in a new tab)
- Claude Code, Configure permissions (opens in a new tab)
- Claude Code, Sandboxing (opens in a new tab)
- Security best practices in IAM (opens in a new tab)
- OpenID Connect in GitHub Actions (opens in a new tab)
- Managing your personal access tokens (opens in a new tab)
- terraform plan command (opens in a new tab)
- terraform apply command (opens in a new tab)
- AWS DevOps Agent pricing (opens in a new tab)
- Overview of Azure SRE Agent (opens in a new tab)
- Risks and mitigations for GitHub Copilot cloud agent (opens in a new tab)
- HolmesGPT repository (opens in a new tab)
Related articles
- Deploying
Claude Code built your app. Here is how to put it online
Can Claude Code deploy apps? It writes the code, the Dockerfile and the workflow, and can run deploy commands you approve, but it is not a host. The path from its code to a live URL on your own server.
- Security
Is your vibe-coded app ready for production? A checklist
An ordered checklist for taking an app built with Lovable, Bolt, Replit, v0, Cursor or Claude Code to production: secrets, database access, configuration, dependencies, the server, backups and monitoring.
- Deploying
A preview of every pull request, on your own server
What per-pull-request preview environments need on your own server, a tested do-it-yourself setup with Docker Compose, Caddy and GitHub Actions, and what OpsCrew's previews add.