π DuoVaccine β The AI Immune System for Your Codebase
π Inspiration
It was 3 AM. Production was down. Four engineers scrambled through hundreds of commits, merge requests, and pipeline logs trying to find what broke. Four hours later, we found it β a single MR that removed query optimizations.
Cost? $\$50{,}000$ in downtime. Engineer morale? Destroyed.
The worst part? Three months later, the exact same type of bug hit us again.
That's when it clicked. We have Covishield and Covaxin to protect humans from viruses. Why doesn't our codebase have a vaccine? Not just a scanner that says "you have a bug" β but a full immune system that:
- π¬ Diagnoses the root cause like a doctor
- π Treats it by auto-generating fixes
- 𧬠Extracts the Incident DNA β a genetic fingerprint of the failure
- π Vaccinates your CI/CD pipeline so the same class of bug never reaches production again
Your production breaks once. Never the same way twice. π
ποΈ How We Built It
DuoVaccine is built entirely on GitLab's Duo Agent Platform using Anthropic Claude as the reasoning engine.
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββ
β DuoVaccine Agent β
β (Anthropic Claude 4.0) β
β β
β 8-Phase Clinical Pipeline: β
β DETECT β REWIND β DIAGNOSE β RESPOND β
β LEARN β IMMUNIZE β IMPACT β RADAR β
β β
β 21 GitLab-Native Tools β
β 1 Agent + 2 Flows β
βββββββββββββββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββββββ
β Flow 1: β β Flow 2: β
β Incident β β Pre-Merge β
β Immunity β β Immunity Check β
β (Reactive) β β (Preventive) β
βββββββββββββββββββ ββββββββββββββββββββββββ
The 8-Phase Clinical Pipeline
| Phase | Name | Biology Analogy | What It Does |
|---|---|---|---|
| 1 | DETECT | ER Triage | Reads incident from GitLab, classifies severity |
| 2 | REWIND | Patient History | Time-travels through commits, MRs, diffs |
| 3 | DIAGNOSE | Lab Analysis | Claude reasons through causal chain with confidence $\geq 90\%$ |
| 4 | RESPOND | Surgery | Auto-generates fix commit + merge request |
| 5 | LEARN | DNA Extraction | Extracts 6-gene Incident DNA fingerprint |
| 6 | IMMUNIZE | Vaccination | Generates CI/CD rules blocking this bug class |
| 7 | IMPACT | Discharge Report | Calculates $\Delta T_{saved}$ and $\$_{protected}$ |
| 8 | RADAR | Outbreak Scan | Scans codebase for similar vulnerabilities |
Incident DNAβ’ β Our Core Innovation
Every incident has a unique 6-gene fingerprint:
$$DNA_{incident} = {G_{trigger}, G_{rootcause}, G_{blast}, G_{detection}, G_{layer}, G_{change}}$$
Where:
- $G_{trigger}$ β What activated the failure
- $G_{rootcause}$ β Category (N+1 query, memory leak, race condition)
- $G_{blast}$ β Blast radius (services and users affected)
- $G_{detection}$ β How it was discovered
- $G_{layer}$ β System layer (database, API, frontend, infra)
- $G_{change}$ β Change type (removal, addition, modification)
Immunity Score
$$S_{immunity} = \frac{\sum_{i=1}^{n} V_{applied}(i)}{T_{known}} \times 100$$
Where $V_{applied}$ = vaccine rules deployed, $T_{known}$ = total known DNA patterns. A score of $100\%$ means full immunity.
Impact Calculation
$$Impact = T_{industry} - T_{vaccine} \times C_{hourly}$$
$$= (252\text{ min} - 3\text{ min}) \times \frac{\$200}{\text{min}} = \$49{,}800\text{ saved per incident}$$
That's an $84\times$ speedup over industry average MTTR.
π§ What We Learned
Anthropic Claude's reasoning is incredible β it doesn't just pattern-match, it actually traces causal chains across multiple files and commits. Giving it real GitLab diffs and asking "what caused this outage?" produces genuinely insightful root cause analysis with confidence scoring $\geq 94\%$.
The Duo Agent Platform is powerful but opinionated β the YAML schema for agents and flows has specific requirements (
routers,entry_point,unit_primitives) that took 6 failed pipeline attempts to get right.The medical metaphor unlocked creativity β once we framed incidents as "infections" and fixes as "vaccines", the entire architecture fell into place naturally.
Speed optimization matters β we reduced from $n = 20+$ tool calls to $n \approx 10$, and from 8 approval prompts to just 2, achieving sub-3-minute full investigation.
π§ Challenges We Faced
- Catalog sync failures β stale filename references in
.ai-catalog-mapping.jsoncaused 4 consecutive tag failures - Platform approval prompts β GitLab requires user approval for write operations. We minimized write calls: $8 \rightarrow 2$
- Flow YAML schema β
routersandflow.entry_pointfields are required but undocumented. Significant trial and error needed - Balancing depth vs speed β full 8-phase pipeline with rich output completing in $T < 180$ seconds
π What Makes DuoVaccine Unique
| Feature | DuoVaccine | Other Tools |
|---|---|---|
| Investigates production incidents | β | β Most only scan code |
| Identifies Patient Zero (exact MR) | β | β |
| Auto-generates fix MR | β | β Most only suggest |
| Incident DNAβ’ fingerprinting | β | β Nobody else has this |
| CI/CD vaccine rule generation | β | β |
| Business impact in $\$$ | β | β |
| Vaccination Certificate π | β | β |
| Reactive + Preventive flows | β | β One or the other |
| Medical metaphor | β | β |
DuoVaccine doesn't just find bugs β it creates immunity. Every incident makes your codebase stronger. π
Built With
- anthropic-claude
- gitlab-api
- gitlab-ci/cd
- gitlab-duo-agent-platform
- python
- yaml
Log in or sign up for Devpost to join the conversation.