Skip to main content
Agentic Ops: When (and When Not) to Use AI Agents for Incident Response

Agentic Ops: When (and When Not) to Use AI Agents for Incident Response

KU
· Founder & Chief Editor
• 8 min read•Updated •

AI agents for incident triage sound great in demos. The patterns that earn their keep, the ones that backfire, and where humans still beat agents.

Key takeaways

  • Use AI agents in incident response for read-only work first, gathering logs, metrics, recent deploys and runbooks into the incident channel within seconds of a page.
  • Gate every mutating action behind explicit human confirmation and narrow, pre-approved tools.
  • Do not let agents remediate novel failures autonomously or replace on-call judgment.

Use AI agents in incident response as read-only investigators: on every page, they pull logs, metrics, recent deploys and the runbook into the incident channel with links. Allow mutation only through narrow tools that a human approves one call at a time. Autonomous remediation of unfamiliar failures and "agent replaces on-call" are where this goes wrong.

Verified against

Model Context Protocol specification 2026-07-28 (tools), Kubernetes RBAC API rbac.authorization.k8s.io/v1, against modelcontextprotocol.io, kubernetes.io, the OWASP GenAI "Excessive Agency" entry and the Google SRE book. Checked October 2026.

Sort the work by blast radius, not by how impressive it looks

Agents are good at the work that is boring for humans and cheap to get wrong:

  • Context gathering. When a page fires, the agent fetches the last few minutes of logs for the service, the relevant dashboard panels, deploys in the window, and the linked runbook, then posts a summary. The responder starts with context instead of a blank terminal.
  • Searching history. "Have we seen this error before?" across past postmortems, with the closest matches linked.
  • Status updates. A periodic summary of what changed on the dashboards, so the incident commander is not also the comms lead.
  • Postmortem first drafts. Timeline from the alert history, deploy log and channel transcript, for a human to edit and interpret.

All of it is reading. A wrong summary costs minutes, not production.

Agents are acceptable, with guardrails, at suggesting remediation from a runbook when a known signature appears, and at preparing a specific action ("roll back checkout to revision 41") with a diff that a human approves. They are bad at reasoning about failure modes nobody has seen before, which is exactly the class of incident where you most need good reasoning.

This lines up with the Google SRE book's incident model: the operations role "should be the only group modifying the system during an incident." An agent that mutates on its own becomes a second, unaccountable ops lead.

The patterns that backfire

Autonomous remediation of unfamiliar failures. An agent that misreads a metric and acts on it turns one incident into two, and now someone has to untangle the agent's change from the original fault.

Auto-paging on agent judgment. "The agent thinks this looks concerning, page someone" generates pages without the signal quality of a tuned alert. People learn to ignore pages.

Long multi-step plans with no checkpoints. "Plan a rollback and execute it" lets the agent wander off-script, leaving intermediate state that is hard to reason about. Anthropic's agent guidance recommends checkpoints for human feedback and stopping conditions such as a maximum iteration count; in ops we cap it at one mutating step, then confirm.

Replacing on-call. On-call is noticing what is not in the runbook and making judgment calls under pressure. Agents only do the runbook part.

The build: narrow tools, read-only credentials, a confirmation gate

OWASP's GenAI Top 10 names the root causes of "Excessive Agency" as excessive functionality, excessive permissions and excessive autonomy. Each has a concrete control.

Excessive functionality: narrow tools. Expose get_recent_logs(service, minutes), query_metric(promql), list_deploys(service) and propose_rollback(service, revision). Never a general run_shell or execute_sql. An MCP tool definition for the read side looks like this:

JSON
{
  "name": "get_recent_logs",
  "title": "Recent service logs (read-only)",
  "description": "Return up to 200 log lines for one service from the last N minutes.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "service": { "type": "string", "enum": ["checkout", "payments", "search"] },
      "minutes": { "type": "integer", "minimum": 1, "maximum": 30 }
    },
    "required": ["service", "minutes"],
    "additionalProperties": false
  }
}

The enum and maximum are the guardrail: the model cannot ask for a service it should not see or a 24-hour log dump. Note that the MCP spec says clients "MUST consider tool annotations to be untrusted unless they come from trusted servers", so a server claiming a tool is read-only proves nothing. Enforce it with credentials.

Excessive permissions: a read-only identity. The agent's Kubernetes service account gets get, list and watch, nothing else:

k8s/incident-agent-rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: incident-agent-readonly
rules:
  - apiGroups: ["", "apps"]
    resources: ["pods", "pods/log", "events", "deployments", "replicasets"]
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: incident-agent-readonly
subjects:
  - kind: ServiceAccount
    name: incident-agent
    namespace: ops
roleRef:
  kind: ClusterRole
  name: incident-agent-readonly
  apiGroup: rbac.authorization.k8s.io

Check it before you trust it:

Terminal
kubectl auth can-i patch deployments -n prod --as=system:serviceaccount:ops:incident-agent
no
kubectl auth can-i get pods/log -n prod --as=system:serviceaccount:ops:incident-agent
yes

The role deliberately leaves out secrets: an agent that can read them is one prompt injection away from posting them in a channel.

Excessive autonomy: a confirmation gate. Write tools run under a separate identity, behind a gate that shows the exact change and waits for a named human:

ops/agent_gate.py
import subprocess

ALLOWED = {"rollback"}  # one pattern, well tested

def execute(action: str, service: str, revision: int, approved_by: str | None) -> str:
    if action not in ALLOWED:
        return f"refused: {action} is not an approved action"
    if not approved_by:
        return "pending: needs a human approval in the incident channel"
    cmd = ["kubectl", "rollout", "undo", f"deployment/{service}",
           f"--to-revision={revision}", "-n", "prod"]
    print(f"AUDIT approved_by={approved_by} cmd={' '.join(cmd)}")
    return subprocess.run(cmd, capture_output=True, text=True, check=True).stdout

The gate runs as a different service account from the read-only agent, so the model never holds write credentials directly. Log every tool call, read or write, with the incident ID. Add a per-incident token and tool-call budget so a stuck investigation cannot loop all night. The general version of this design is in our post on AI agent tool design with boundaries and confirmations.

Errors you will see, and what they mean

Error textWhat happenedFix
Error from server (Forbidden): deployments.apps "checkout" is forbidden: User "system:serviceaccount:ops:incident-agent" cannot patch resource "deployments" in API group "apps" in the namespace "prod"The read-only agent tried to mutateWorking as intended; route the action through the gate
{"code": -32602, "message": "Unknown tool: ..."}The model invented a tool nameTighten tool descriptions; never add a catch-all tool to silence it
"isError": true with a validation messageArguments outside the schema, such as 120 minutesReturn a clear message so the model retries within limits
query processing would load too many samples into memory in query executionPrometheus rejected an overly broad PromQL query from the agentCap the range and step in the tool, or offer canned queries

Trust drift is the slow failure

Months in, the team stops checking the agent's summaries, and a wrong one sends the responder down the wrong path. Our counter is citation discipline: every claim links to the log query, dashboard panel or deploy record it came from, so verifying is one click. Review the agent in each postmortem too: did it help, mislead, or stay out of the way?

Where this breaks

None of this pays off without decent telemetry. If your logs are unstructured and your alerts are noisy, the agent summarizes noise faster. Small teams with a handful of incidents a quarter may not recoup the build cost; a good runbook and on-call rotations with runbooks that do not burn people out matter more. Prompt injection is real here: log lines and ticket text are attacker-influenced input, which is why read-only credentials matter more than prompt wording. And verifying that a remediation actually worked is its own hard problem, covered in the verification gap in agent-driven Kubernetes remediation.

Questions people ask

Can AI agents handle incident response on their own?

Not safely for anything novel. Agents summarize logs, metrics and deploy history well, and they can propose known runbook fixes. They reason poorly about failures nobody has seen, which is where autonomous action does the most damage. Keep a human as the only party that changes production, as the Google SRE incident model recommends, and let the agent prepare and explain the change.

What permissions should an incident response agent have?

Read-only by default: get, list and watch on pods, logs, events and deployments, plus read access to metrics and the deploy log. No secrets, no shell, no raw SQL. Mutating actions run through a separate identity behind a confirmation gate. OWASP lists excessive permissions as a root cause of excessive agency, and RBAC enforces the limit even when the model misbehaves.

How do you stop an agent from making an incident worse?

Limit it in three places. Offer narrow tools with strict input schemas, give it credentials that cannot mutate, and require named human approval for each write action, one step at a time. Add a per-incident tool-call and token budget, log every call, and make summaries cite their sources so responders can catch a wrong reading quickly.

The call we'd make

Start with a read-only investigation agent that fires on every page and cites its sources; it is low risk and saves the first minutes of every incident. Add postmortem drafting next. Add exactly one confirmation-gated write action, usually rollback of the latest deploy, only after the read side has earned trust. Skip autonomous remediation and agent-driven paging entirely. For running the human side of the process, see postmortems that drive change, and for orchestrating several agents, multi-agent systems explained.

Sources

Explore topics:AI
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). Agentic Ops: When (and When Not) to Use AI Agents for Incident Response. DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/agentic-ops-ai-incident-response

Markdown

[Agentic Ops: When (and When Not) to Use AI Agents for Incident Response](https://www.devopsness.com/blog/agentic-ops-ai-incident-response) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

607 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.