SRE agent: alert → AI investigation → human-reviewed fix MR on GitLab. How to orchestrate.
I'm an SRE, and most of my time goes to investigating issues triggered by alerts. I already do most of the investigation with an agent (HolmesGPT), but I still start it by hand and act on the result myself. It's the same loop every time:
- an alert fires
- I run HolmesGPT against the alert and check its findings
- if the cause is on the platform side, I open an MR to our GitOps repo
- if the cause is in the application, I hand it over to the engineering team
I want to automate this loop: investigation, a GitLab issue routed to the right team, and a proposed fix MR.
Requirements
Measurable (most important). I need one number: successfully resolved events, per team. Resolved means:
- a human confirmed the root cause was correct
- the fix MR was merged
- verification passed (e.g. the alert cleared after deploy)
- no recurrence within 30 days
- Open to other teams. SRE comes first, but QA and engineering should be able to adopt it without a redesign. They investigate differently (failing tests, bug reports), so the investigation step must be pluggable, and everything after it shared.
- Human in the loop. Humans can edit the investigation report before a fix starts, iterate on the MR, and are the only ones who can merge.
My design ideas:
SRE flow
- Alertmanager → GitLab pipeline → read-only HolmesGPT investigation (k8s, Thanos, Elasticsearch, ArgoCD, git log)
- Output: a GitLab issue with the report and a small YAML contract (scope, allowed repo paths, verification criteria). Application causes go to the owning team's project.
- Gate 1: humans review and edit the issue
- mr-agent opens a Draft MR
- Gate 2: iterate on it with u/mr-agent comments, and a human merges
- ArgoCD deploys → the agent verifies
Other teams plug in their own investigation step that produces the same issue contract. mr-agent, the gates, verification and the KPIs are shared.
Stack: self-hosted GitLab CI/CD, Kubernetes, ArgoCD, HolmesGPT, and an in-house AI MR agent (mr-agent) that handles fix, iterate, review and verify.
Open question: who orchestrates?
- A) Deterministic GitLab CI pipeline.
- Separate jobs, with GitLab events, labels and permissions enforcing the gates.
- The LLM only works inside a step.
- Predictable, but the human picks the next step.
- B) LLM orchestration.
- One mr-agent orchestrate job runs on every event.
- It decides the next action (re-investigate, fix, iterate, hand over), and humans steer in plain language.
- Gates stay hard because code controls which tools exist in each state: open_mr only after a human approves, and never merge.
Where I'm stuck
I'm leaning towards A, but it's turning into a complicated pipeline:
- trigger jobs, manual jobs, comment webhooks, a delayed verify job, and dedup and grouping rules
- I'm not sure that splitting this into many deterministic steps is the right way to do it
- I still need humans to steer the process while it's being resolved, not only approve or reject at fixed points
B appeals to me because it needs far less configuration. My worry is asynchronicity:
- The human gates can take hours or days: someone edits the report tomorrow, or comments on the MR next week.
- An agent can't run and wait that long, so it has to stop at each gate, save its state somewhere (the GitLab issue), and resume on the next event: issue edit, comment, merge, or the 1h timer for verification.
- Every resume has to rebuild context correctly and notice what the human changed in the meantime.
- Two events arriving at the same time must not cause two conflicting actions.
Questions
- How would you design the pipeline and the orchestration for this?
- Do you see any problems with this design?
I'm open to a completely different design, so feel free to share how you'd approach the problem. If you know tools that already solve part of this, please point me to them. I'm leaning towards whatever needs the least configuration, glue code and scripting :-)