← Writing

Fencing an alert agent: A2A, RBAC and an admission policy

16 November 2026

Why

  • One operator and, at the start, 72 alert rules (81 today). Three of them had a procedure beside them; the rest pointed at a runbook page that explained the theory, which is not the same as a procedure at 03:00.
  • The goal: every alert arrives with the first look already done, in the chat it fires into, without giving a model the power to change the cluster.

Design rule

Agents diagnose; they do not repair. Repairs stay in Git, behind a human review.

Flow

every firing alertAlertmanagertriage CronJobtriage agentTelegrampollA2Aevery 10 min, deduped by start time: ~72 runs → 14 tools, all read-onlyon demanddiagnose agentrunbook indexone Argo Workflowreadscreates1 · read-only tool grants2 · RBAC: create Workflows in argo, nothing else3 · admission policy: the tool server may not write anything else
The only write an agent can reach is one Workflow, and three independent fences hold it there.
  • A CronJob polls Alertmanager every 10 minutes and asks the triage agent over A2A JSON-RPC, deduplicated by alert start time. A six-hour alert went from about 72 runs and 72 messages to one.
  • Poll, not webhook: no ingress, no shared secret, nothing that must be up at 03:00.
  • Triage agent: 4 read-only tools (list, describe, events, pod logs).
  • Diagnose agent: 2 tools (read the runbook index, create one Argo Workflow).
  • The runbook index is generated from the alert rules, one row per alert. CI fails an alert that has neither an action nor a written waiver. 64 of the 81 alerts have no scripted action; for those, the answer is the runbook link.

Fences

  1. Tool grants: the triage agent has no write tool.
  2. RBAC: the submitter may create Workflows in argo: one verb, one resource, one namespace.
  3. ValidatingAdmissionPolicy: the kagent chart binds its tool server to a wildcard ClusterRole that its values cannot remove. Its kubectl calls over three days were get 1,034, describe 326, logs 116. The policy turns that measurement into a boundary: every write except a Workflow create in argo is denied.
kubectl create --dry-run=server --as=system:serviceaccount:kagent:kagent-tools -f pvc.yaml   # denied
kubectl create --dry-run=server --as=system:serviceaccount:kagent:kagent-tools -f wf.yaml    # allowed

A separate policy refuses the deletion of any PVC, PV or Namespace, by anyone.

Known failure

  • First live diagnosis: the agent saw egress-node=true on one node and the probe pod on another, concluded the egress policy “can never match”, and proposed relabelling nodes.
  • Wrong: Cilium tunnels a selected pod’s traffic to the gateway node, so a pod elsewhere is the supported case.
  • Countermeasure: five eval cases check that the agent reaches the known conclusion from the same symptoms.

What it bought

  • Each alert now arrives with a record of what was checked, when, and by which procedure in Git.
  • A new alert cannot merge without a decision: an action, or a written waiver with a reason.
  • An agent that can be wrong without being dangerous, and an eval corpus that says how often it is wrong.