Abstract
Production systems already emit precise, machine-readable descriptions of what is wrong: a stack trace in Sentry, an SLO burn in Prometheus, a red CI job. Today those signals stop at a human pager. We argue they should start a repair loop that ends in a validated, deployed fix, with a person in the loop where policy requires one and not by default everywhere.
The research record supports the idea in parts. Search-based repair fixed real bugs cheaply in 2012 [1]. Meta deployed learned fix patterns and end-to-end repair in production in 2019 [2][3]. LLM-based repair outperformed every earlier technique by 2023 [4][5], and agents now repair bugs autonomously [6][7]. Separately, LLMs have been shown to help with root-cause analysis on real cloud incidents [11][12]. What is missing is the loop that connects them: signal, intent, reproduction, patch, validation, deploy, and a metric that proves recovery.
The loop that is still manual
The Google SRE book frames reliability as a function of two quantities: how long a system runs between failures (MTTF) and how long it takes to repair (MTTR). For emergency response, MTTR is the one that matters, and the book notes that human involvement is itself what slows recovery. It also reports that engineers working from a prepared playbook achieve roughly a 3x improvement in MTTR over improvising [13].
Two other ideas from the same tradition shape what a self-healing system must respect:
- Error budgets. The gap between an SLO and measured reliability is a budget. While it lasts, teams ship; when it is spent, releases slow down [14]. Faster restoration directly preserves budget, which means more room to ship.
- Recovery as a delivery metric. DORA treats recovery as one of its core software delivery metrics, now named failed deployment recovery time: the time to recover from a deployment that needs immediate intervention. DORA notes that this replaced the earlier MTTR framing [15].
A playbook is a compiled context for a human: the right steps, written in advance, retrieved under pressure. That is the same move we make for agents (Paper 01). The question is how much of the playbook’s execution can be handed to machines, and how to keep it safe.
What automated repair has shown
The headline numbers below are each system’s own reported results, on its own benchmark. They are not comparable with each other. Together they show the trajectory.
Reported automated repair results
Each paper's own benchmark and success definition. Not directly comparable. Hover for details.
GenProg [1]: 55 of 105 C defects repaired. Getafix [2]: a correct fix among the top 5 suggestions for 526 of 1,268 Java bugs. Passerine at Google [7]: plausible patches for 73% of machine-reported and 25.6% of human-reported bugs. SWE-bench [8] and SWE-bench Verified [9]: issue resolution rates reported at release.
GenProg
Le Goues et al. use genetic programming over a program’s own code, validated by its test suite, and repair 55 of 105 real defects in C programs, at about $8 per successful repair [1].
Getafix at Meta
Bader et al. learn fix patterns from past human fixes for static-analysis warnings and rank candidates by context. It was deployed at Facebook as the first industrial tool to learn fix patterns from human-written fixes [2].
SapFix at Meta
Marginean et al. report the first end-to-end deployment of automated repair, from test design to a fix in production code. It reverts or patches crashes found by Sapienz, then hands every patch to an engineer for approval [3].
AlphaRepair
Xia and Zhang show a pre-trained code model can repair bugs zero-shot, without bug-fix training data, producing 3.3x more fixes than the best baseline on Defects4J 2.0 [4].
APR in the era of LLMs
Xia, Wei and Zhang evaluate 9 pre-trained models on 5 datasets in 3 languages and find that applied directly, they outperform all existing repair techniques. Larger models fix more, and code after the bug helps [5].
RepairAgent
Bouzenia, Devanbu and Pradel let an LLM agent drive the repair loop with tools. It fixes 164 Defects4J bugs, 39 that no prior technique fixed, at about 270,000 tokens per bug [6].
Agent-based repair at Google
Rondon et al. run the Passerine agent on 178 bugs from Google’s issue tracker. Machine-reported bugs are far easier than human-reported ones, both for plausible and for semantically correct patches [7].
Signals are better inputs than prose
The Google result deserves a closer look, because it is the strongest argument for starting repair from production signals.
Machine-reported vs human-reported bugs
Passerine agent, Gemini 1.5 Pro, 20 samples per bug, as reported by Rondon et al. Share of bugs.
Plausible: at least one patch passes the bug-reproducing tests. Semantically equivalent: at least one patch matches the ground-truth fix on manual review. Source: [7].
A machine-reported bug arrives with a stack trace, a failing assertion or a sanitizer report. That is what Sentry, Prometheus and CI produce. A human-reported bug arrives as a paragraph. The first is close to a test; the second has to be interpreted. SapFix follows the same logic: it targets crashes revealed by Sapienz test cases and checks that a candidate patch makes the crash stop reproducing [3].
Reproduction is also what keeps automated repair honest. Benchmarks have repeatedly found that passing tests is weaker evidence than it looks. OpenAI’s annotators flagged 61.1% of sampled SWE-bench [8] tasks for unit tests that could reject valid solutions [9], and SWE-Bench+ found that 31.08% of one agent’s passing patches were suspicious because the tests were too weak to verify them [10]. A self-healing loop therefore needs its own failing test, written before the patch, that fails on the current code and passes after the fix.
A fix is only as trustworthy as the test that proves it. The repro test comes first, and it is part of what gets validated.
From alert to root cause
Patching is half the job. The other half is knowing what broke and why. Two Microsoft studies are directly relevant:
- Ahmed et al. (ICSE 2023) evaluate LLMs on more than 40,000 real Microsoft incidents for recommending root causes and mitigation steps, in zero-shot, fine-tuned and multi-task settings [11].
- RCACopilot (EuroSys 2024) combines incident-type-specific diagnostic handlers with an LLM that predicts a root-cause category and explains it. On a year of real incidents it reaches RCA accuracy of up to 0.766, and its diagnostic collection component has been used at Microsoft for over four years [12].
Both share a lesson: the model is only as good as the diagnostic context it gets. RCACopilot works because handlers collect the right data first. In Chad, that data comes from memory: the alert is matched to the intents and changes that touch the failing code, which is a ClickHouse query, not an LLM reading the git log.
Anatomy of a self-healing incident
Below is the full loop, from the alert to the metric coming back under its SLO.
One incident, closed end to end
From a Prometheus alert to a validated, deployed fix. Illustrative timeline and metric.
Metric shape, timestamps, file names and query timing are example values chosen to show the sequence. Who validates (a human reviewer or an AI verifier) is a policy choice per repository. Illustrative.
- Alert. Prometheus reports an SLO breach, Sentry groups a new exception, or a CI job turns red. The signal is logged in ClickHouse with everything else.
- Intent match. A columnar query joins the signal’s files, services and timestamps to recent git changes and the intents behind them. The result is a short list of candidate causes and the acceptance criteria they were supposed to meet.
- Debugger loop. A Debugger agent starts with an empty context and a compiled one of about 6k tokens: best practices, the matched intent, related changes, validated past fixes for similar signals, and the target files.
- Repro test. The first artifact is a failing test that reproduces the signal on current code.
- Patch. A Builder loop writes the smallest change that makes the repro pass without breaking the suite.
- Validation. A human reviewer or an AI verifier checks the patch against the intent and the repro. Which one is a per-repository policy.
- Deploy. The change ships through the normal pipeline, ideally behind a canary.
- Recovery. The same metric that fired the alert confirms the fix. Only then is the action stored as a validated input → output pair.
Where the time goes
Whether automation shortens recovery depends on stage durations and on how often automated fixes are accepted. A rejected automated fix still costs its minutes before the humans take over, so automation is not free. The model below makes that explicit.
Where the minutes go
A manual incident vs an automated loop, stage by stage. Defaults are illustrative assumptions. Change them.
Expected = p · automated + (1 − p) · (automated time spent up to the rejected review + manual time from diagnosis on). A rejected fix still costs its minutes, so a low acceptance rate can make automation slower than doing it by hand. Minutes are illustrative inputs, not measurements of Chad or of any team.
Two things stand out when you play with it. First, deploy and verification time do not shrink with automation; pipelines and canaries take what they take. Second, the acceptance rate p dominates. That is why Chad treats validation and memory as the product, not the patch generator.
How Chad applies it
- Signals are triggers. Sentry, Prometheus, Datadog and CI events wake a Debugger agent the same way a human message does. Humans can still step in at any moment: to redirect, correct or approve.
- Memory first. Every GitHub event, human input and tool signal is logged in ClickHouse. Git history is stored as rows of line additions and deletions linked to intents, so the change behind an alert is found in milliseconds.
- Small loops. Debugging, writing the repro, patching and verifying are separate loops with separate compiled contexts. No loop carries the transcript of the previous one (Paper 02).
- Validation gates memory. A fix is validated by a human or by an AI verifier, deployed, and confirmed by the recovering metric. Only then does it enter memory, where it becomes context for the next similar incident.
- The system lives. The same loop that fixes regressions also handles the Improver role: recurring signals become intents for structural fixes, not just patches.
Limits & next steps
Automated repair has well-known failure modes. Plausible patches can overfit weak tests [10], and the Google study shows a large gap between plausible and semantically correct fixes [7]. Not every alert is a code bug: capacity, configuration and upstream outages need mitigation, not a patch, and the RCA literature treats them separately [11][12]. Some incidents are too risky for any automated action, which is why validation policy is configurable per repository.
The stage durations in this paper are illustrative inputs, not measurements. We have no published numbers yet for Chad’s acceptance rate or time to restore. We will publish them, with the incident logs behind them, as part of our benchmark on real repositories (Paper 13).
References
- Le Goues, C., Dewey-Vogt, M., Forrest, S., Weimer, W. A Systematic Study of Automated Program Repair: Fixing 55 out of 105 Bugs for $8 Each. ICSE, 2012.
- Bader, J., Scott, A., Pradel, M., Chandra, S. Getafix: Learning to Fix Bugs Automatically. OOPSLA, 2019.
- Marginean, A. et al. SapFix: Automated End-to-End Repair at Scale. ICSE-SEIP, 2019.
- Xia, C. S., Zhang, L. Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learning. ESEC/FSE, 2022.
- Xia, C. S., Wei, Y., Zhang, L. Automated Program Repair in the Era of Large Pre-trained Language Models. ICSE, 2023.
- Bouzenia, I., Devanbu, P., Pradel, M. RepairAgent: An Autonomous, LLM-Based Agent for Program Repair. ICSE, 2025.
- Rondon, P. et al. Evaluating Agent-based Program Repair at Google. arXiv:2501.07531, 2025.
- Jimenez, C. E. et al. SWE-bench: Can Language Models Resolve Real-World GitHub Issues?. ICLR, 2024.
- OpenAI. Introducing SWE-bench Verified. August 2024.
- Aleithan, R. et al. SWE-Bench+: Enhanced Coding Benchmark for LLMs. arXiv:2410.06992, 2024.
- Ahmed, T. et al. Recommending Root-Cause and Mitigation Steps for Cloud Incidents using Large Language Models. ICSE, 2023.
- Chen, Y. et al. Automatic Root Cause Analysis via Large Language Models for Cloud Incidents. EuroSys, 2024.
- Beyer, B., Jones, C., Petoff, J., Murphy, N. R. (eds.) Site Reliability Engineering, Chapter 1: Introduction. O'Reilly / Google, 2016.
- Beyer, B., Jones, C., Petoff, J., Murphy, N. R. (eds.) Site Reliability Engineering, Chapter 3: Embracing Risk. O'Reilly / Google, 2016.
- DORA. DORA's software delivery performance metrics. Google Cloud, accessed November 2026.