💡 Inspiration
Every software engineering team dreads 2 AM production alerts: unhandled exceptions, calculation regressions, and broken CI/CD pipelines. Today, Mean Time to Resolution (MTTR) averages over 3 hours of manual log parsing, stressful debugging, and repeated runner compute storms.
We asked: What if GitLab Duo could act as an autonomous, multi-agent SRE team that diagnoses, safely tests, and merges verified code fixes in under 60 seconds — before a human developer is even paged?
That vision led us to build GitLab Duo SRE: Autonomous Incident Resolver — a self-healing DevSecOps system running serverless on Google Cloud Run.
🚀 What It Does
When an incident is reported via a GitLab Issue or a failed pipeline, our event-driven multi-agent platform kicks off an autonomous 9-stage DevSecOps loop:
- Plan (Triage & Recall):
IncidentParserAgentextracts stack traces and affected microservices.KnowledgeRetrieverAgentqueries Neo4j AuraDB GraphRAG memory to recall prior resolution patterns. - Secure (The Adversarial Gate): Before any code is touched,
CriticReflectorAgentenforces strict negative constraints (e.g., zero schema changes, zero network calls, fail-closed authorization). - Create (AST Synthesis):
CodebaseAnalystAgentandFixPlannerAgenttraverse the Abstract Syntax Tree (AST) to generate minimal, surgical patches. - Verify (Sandbox Red/Green Runner): The patch is mounted into an isolated Linux sandbox where
ValidationAgentverifies the Red-to-Green transition usingpytest. - Secure (SAST Scan):
SecurityValidatorinspects the diff for secrets, injection vulnerabilities, and security regressions. - Govern (Risk & Blast Radius):
RiskScorerAgentdeterministically scores the blast radius into Low Risk (pre-cleared for auto-merge), Medium Risk (requires developer review), or High Risk (read-only diagnostic report). - Release (Automated MR):
SynthesisAgentopens a GitLab Merge Request with comprehensive test proof, executive summaries, and auto-merges low-risk fixes. - Configure & Deploy:
DeploymentServicevalidates staging and rolls out the verified container revision to Google Cloud Run. - Monitor & Govern:
SustainabilityAgentaudits Software Carbon Intensity (SCI v1.0), andKGBuilderAgentstores the learned pattern back into Neo4j graph memory.
🛠️ How We Built It
- GitLab Duo Native Reasoning: Native Duo AI Gateway and specialist Claude 3.5 Sonnet agent models coordinate through the Model Context Protocol (MCP).
- Backend Orchestrator: Built with FastAPI and Python 3.10, containerized on Docker, and deployed serverless on Google Cloud Run (
us-central1). - GraphRAG Long-Term Memory: Neo4j AuraDB graph database maps past
(:Incident)-[:RESOLVED_BY]->(:Patch)nodes, enabling instant knowledge recall. - Mission Control Frontend: A glassmorphic React interface with Server-Sent Events (SSE) that visualizes the active agent DAG, cognitive reasoning streams, live execution terminals, and interactive AST diffs.
- Isolated Sandbox: Micro-sandboxes execute red/green reproduction cycles and pytest suites with sub-second isolation.
🧗 Challenges We Faced
- Recursive Webhook Loops: When our bot pushed remediation branches (
fix/inc-...), CI pipelines ran and initially triggered secondary pipeline failure webhooks. We engineered strict loop-prevention filters inWebhookServiceto ensure only failures onmainare remediated. - Adversarial Safety Gates: LLMs often generate overly broad fixes that can introduce side effects. Implementing
CriticReflectorAgentas a strict pre-patch adversarial evaluator was essential to lock negative constraints before code generation. - State Persistence Across Serverless Cold Starts: On Cloud Run, instances scale to zero when idle. We designed a dual SSE streaming and JSON persistence mechanism to ensure completed incident audits are preserved across container instances.
🏆 Accomplishments We're Proud Of
- Sub-60s MTTR: Slashed incident resolution time from an industry baseline of 180 minutes to under 60 seconds.
- Zero Third-Party Model Lock-In: Built 100% native to GitLab Duo and MCP.
- Green Software Impact (SCI v1.0): Saved ~74 grams of CO2e per incident and achieved an 18x to 76x sustainability efficiency ratio by preventing CI retry compute storms.
- Enterprise-Grade Governance: Strict three-tier risk scoring ensures no high-risk patch ever auto-merges without human approval.
📚 What We Learned
- Specialized Multi-Agent DAGs Beat Monolithic Prompts: Splitting duties into distinct agents (Critic, Analyst, Planner, Validator) drastically increases patch reliability and eliminates hallucinations.
- Graph Memory Supercharges Triage: Connecting prior resolutions via Neo4j GraphRAG enables instant recognition of recurring error signatures.
🔮 What's Next
- Multi-Repo Dependency Graphs: Expanding blast-radius analysis across distributed microservice architectures.
- Canary Rollback Watchdogs: Automated integration with GitLab Prometheus / OpenTelemetry alerts to automatically roll back revisions if latency spikes.

Log in or sign up for Devpost to join the conversation.