Skip to content
Hogin Hogin
Go back

Guardrails for AI SRE agents: automating remediation without losing control

9 мин чтения

AWS DevOps Agent and Azure SRE Agent — both GA since March 2026 — can find an incident’s root cause faster than any on-call engineer. But neither vendor lets them directly roll back a deploy, restart a pod, or scale production: between the agent’s diagnosis and the actual change, there’s almost always a human clicking a button. Here’s how to design that approval gate yourself, on top of an incident pipeline you already run, rather than waiting for a vendor to build it for you.

Table of contents

Open Table of contents

What AI SRE agents already do

AWS DevOps Agent reached GA on March 31, 2026, and Azure SRE Agent on March 10, 2026 (InfoQ). Both share the same working model: the agent subscribes to alerts, correlates them with recent deploys, reads logs and traces, formulates a likely root cause, and proposes a specific action — but production changes in the “restart, rollback, scale” category still go through explicit human confirmation. PagerDuty is meanwhile building an MCP factory so several such agents from different vendors can plug into one incident pipeline through a shared protocol instead of a dozen bespoke integrations.

We already covered what an AI SRE agent actually is and where it breaks — what data it needs, what access it should never get. This post isn’t a repeat of that overview; it’s the next step: how to actually wire an approval gate into an on-call process you already run, whether the agent is your own or a vendor’s.

Three levels of autonomy

Before designing the gate, it helps to split “autonomy” into levels — because the whole guardrail architecture lives at the boundary between the second and the third.

Three levels of autonomy: read-only triage, proposed fix, auto-remediation

Most of the value AI SRE agents claim in 2026 is already captured in the first two levels: diagnosis that used to take 20–30 minutes of manual log-and-graph correlation compresses to seconds. The third level adds reaction speed, but it’s the one that requires real guardrail engineering — and the approval gate belongs exactly at the boundary between “proposed” and “executed.”

An approval gate on top of your existing on-call tool

The key architectural decision is not to build approval into the agent’s own code, but to push it into the tool the on-call engineer already works in — Slack, PagerDuty, Opsgenie. That way the approval gate inherits, for free, what those systems already have configured: RBAC, on-call schedules, and message history as a ready-made audit log.

Approval gate: the agent posts a proposal, an executor bot runs it separately from the agent

This drives a few concrete architectural requirements:

What to log for audit

An approval gate without an audit trail is just a slower version of auto-remediation with an extra click. The whole construction’s value is being able to reconstruct the decision chain precisely after an incident:

The line: what should never run without approval

Even if an agent shows consistently high diagnostic accuracy, some categories of action shouldn’t move to auto-remediation at all, regardless of approval history:

What unites these categories: the cost of a wrong automatic action here isn’t “had to roll back a deploy” but “data is gone” or “access is compromised” — an asymmetry no accuracy percentage compensates for.

Comparison: without a gate vs. with a gate

Without an approval gateWith an approval gate
Who executes the changethe agent itselfan executor with its own narrow role
Agent’s access to productiondirectnone
Approvalimplicit (trust in the model)an explicit action by a specific person
Audit trailagent logs (may be incomplete)diagnosis + approver + command + outcome
Risk on a wrong diagnosisimmediate wrong actionstopped at the proposal stage
Speed on correct diagnosesmaximumseconds for the on-call reaction

What you need to build a minimal approval gate

You’ll need an incident channel in Slack, an incoming webhook for the agent to publish proposals to, and a separate service account in the cluster — not the one the agent itself runs under.

First, a narrow RBAC role for the executor that can do exactly what’s needed to roll back a deployment, and nothing more:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: sre-agent-executor
  namespace: prod
rules:
  - apiGroups: ["apps"]
    resources: ["deployments", "replicasets"]
    verbs: ["get", "list", "watch", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: sre-agent-executor-binding
  namespace: prod
subjects:
  - kind: ServiceAccount
    name: sre-agent-executor
    namespace: prod
roleRef:
  kind: Role
  name: sre-agent-executor
  apiGroup: rbac.authorization.k8s.io

Next, the executor that listens for Slack reactions and runs kubectl rollout undo only after confirmation from a known approver:

# simplified Slack Events API handler
on_reaction_added() {
  local reaction="$1" user="$2" message_ts="$3"

  [[ "$reaction" == "white_check_mark" ]] || return 0
  is_authorized_approver "$user" || return 0

  local proposal
  proposal=$(fetch_proposal_by_ts "$message_ts")   # the agent's structured proposal
  is_proposal_expired "$proposal" && return 0

  log_audit_entry --approver "$user" --diagnosis "$proposal" --ts "$message_ts"

  kubectl --as=system:serviceaccount:prod:sre-agent-executor \
    -n prod rollout undo deployment "$(jq -r .target <<<"$proposal")"
}

The agent itself only needs read-only access to the observability stack and permission to post into a Slack channel — it never sees a production kubeconfig at all.

How to verify it works

Confirm the narrow role really is narrow — the executor can do what it should, and nothing beyond that:

kubectl auth can-i patch deployments \
  --as=system:serviceaccount:prod:sre-agent-executor -n prod
# yes

kubectl auth can-i delete secrets \
  --as=system:serviceaccount:prod:sre-agent-executor -n prod
# no

Then run a full test proposal: the agent (or a stub for it) posts a message to Slack, you react with ✅, and the executor’s log should get an entry with your name, the exact diagnosis text, and the kubectl rollout undo outcome. If an entry shows up without your explicit reaction, the gate isn’t working — and that’s worth finding before the agent starts proposing real fixes against production.

Bottom line

The value of a 2026 AI SRE agent isn’t that it can act on its own — it’s how much faster it reaches a diagnosis compared to manual log-and-graph correlation. Auto-remediation can and should expand gradually, but the only safe way to do it is an explicit approval gate — a separate executor with a narrow role, an explicit confirmation from a specific person, and a full audit trail from diagnosis to outcome — not growing trust in the model’s accuracy. Trust in a model shifts from incident to incident; a narrow RBAC role and a mandatory click from the on-call engineer don’t.


Share this post:

Next Post
Sidecar-free service mesh: Cilium Service Mesh next to Istio Ambient