Simple Agility On-Call Automation

The second loop the Simple Agility stack runs against its observability plane is operational rather than commercial: an alert fires, something diagnoses it, something acts, a human is kept in the loop at the right level. Today that "something" is a human on Telegram. This page documents the intended shape — the on-call agent, the escalation ladder, and above all the interfaces each product must expose to be operable by an agent — so that products being built now grow the right surfaces instead of retrofitting them.

Status honesty (verified 2026-08-18): jakemon routes 33 alert rules to Telegram with a Watchdog heartbeat; none of the 33 carries a runbook label; there is no incident runbook page in the wiki (all 16 type: runbook pages are developer procedures); no on-call agent exists; jakemon has no Model Context Protocol (MCP) surface. Wikantik's scoped admin:<area> grants and admin MCP are the only product-side pieces already in place. Everything below marked planned is sequenced in SimpleAgilityRoadmap.

The on-call agent is stack-level, not a jakemon component

jakemon is config, dashboards and data by rule — no application code. The on-call agent therefore lives in the stack-level agent runtime (not yet built), the same component that will host the Search Engine Optimization (SEO) actuator from the feedback-loop pattern. One runtime gives one place for agent scheduling, action ledgers, circuit breakers, blast-radius limits and the human-oversight policy switch, shared by every agent that acts on the stack.

The loop

  1. Alert — Alertmanager fires; a webhook receiver delivers the alert payload (labels, annotations, firing time) to the agent runtime. Telegram to a human continues in parallel until the agent has a track record.
  2. Runbook — the alert names its runbook; the agent fetches that page from Wikantik via the knowledge MCP. See The alert-to-runbook binding below, which is a convention that has to be built, not one that exists.
  3. Diagnose — the agent reads the plane: current alert state, Prometheus Query Language (PromQL) and Loki Query Language (LogQL) queries, the correlation_id trail from the telemetry contract. Today raw Hypertext Transfer Protocol (HTTP) on the Local Area Network (LAN); the plane is expected to grow an agent-facing read surface (an MCP server exposing alert state, metric queries, log queries and dashboard links) — a jakemon deliverable.
  4. Act — through the product's scoped, audited operational surfaces (see Required product interfaces), climbing the escalation ladder only as needed.
  5. Record and close — action, rationale and outcome go to the runtime's ledger; the alert resolves, or the agent escalates to a human with the ledger attached; every invasive step produces a follow-up item (below).

The alert-to-runbook binding

The hop from "an alert fired" to "here is the procedure" needs to be deterministic — an agent must not be searching for its runbook during an incident. Neither end of the binding exists yet, so the convention is defined here before anything is written against it.

On the alert (jakemon): every rule carries a runbook label whose value is the exact Wikantik page slug.

- alert: WikantikDown
  expr: up{job="wikantik"} == 0
  for: 5m
  labels:
    severity: critical
    service: wikantik
    runbook: IncidentWikantikDown
  annotations:
    summary: "Wikantik on {{ $labels.instance }} has been unreachable for 5m"

On the page (Wikantik): type: runbook is already in use for developer procedures ("how to write an MCP tool"), so incident runbooks are distinguished rather than mixed in — a filter on type: runbook alone must not return build instructions to an agent handling an outage.

Structure each incident runbook the way the agent will use it: what fired and what it means; how to confirm it is real (the exact PromQL/LogQL); the ordered remediation steps annotated with their escalation rung; what to check to confirm the fix; when to stop and page a human. A runbook whose steps do not name their rung forces the agent to guess how invasive it is allowed to be.

Written with the alert rule, not after the first incident — an alert without a runbook is an incomplete change.

The escalation ladder

Agents should be willing to escalate to invasive tools — but escalation has obligations, and whether the agent may act invasively before a human looks is a company policy decision, configured in the runtime, not fixed here.

RungMeansObligations
1Product's scoped admin Application Programming Interface (API) / MCP tools (rebuild an index, reflow a page, rotate a credential, restart a connector)ledger entry
2Container-level operations through the deployment tooling (restart a service, redeploy a pinned version)ledger entry; human notified
3ssh / docker exec / direct database accessconcurrently page the human on-call so a person oversees the actions; wait for human acknowledgment if company policy says so; ledger entry with the exact commands
after any rung ≥ 2trace what would have prevented the escalation — which scoped surface, runbook step, alert or metric was missing — and file it as a work item on the product or the plane. Escalations are supposed to become rarer because each one improves a surface.

Agent identities and credentials

The runtime hosts several agents with different powers, and they do not share an identity. Getting this wrong once — one AllPermission service account reused by everything — silently removes the ladder, because every rung becomes reachable from rung 1.

Required product interfaces (the point of this page)

A Simple Agility product is on-call-automatable when it exposes:

  1. Scoped, audited operational actions as an admin API and/or admin MCP tools, gated by a fine-grained permission the agent's credential can hold without holding everything. Wikantik's admin:<area> grants (AdminPermission, AdminAuthFilter) with a dedicated per-integration account are the template.
  2. Incident runbooks in Wikantik, one per failure mode the product knows about, following the binding convention above and referenced by the plane's alert runbook labels.
  3. The telemetry contract/metrics, structured logs with event and correlation_id, a liveness endpoint — because the agent diagnoses from the plane, never by reading the product's files.
  4. Read-your-own-state endpoints an agent can call to confirm an action took effect (index status, connector run history, queue depth) — the product's view, so the agent is not inferring success from a metric lagging a scrape interval.
  5. Idempotent, safe-to-retry actions, so an agent that loses a response can call again without double effect.

And from the plane: alert rules that carry runbook, service and instance labels, a webhook receiver for the runtime, and the planned read surface.

What the runtime will own (so products and jakemon do not)

Scheduling; the action ledger; circuit breakers ("stop after N actions per hour per service"); blast-radius limits ("one page per run" for the SEO actuator; "one restart per service per day" for on-call); the human-oversight policy switch per rung; agent identity and credential custody; the escalation obligations above. Neither a product nor jakemon should implement these.

See also