AI Self-Healing DevOps: A Closed-Loop Framework for Anomaly Detection, Contextual Root-Cause Analysis and Policy-Governed Automated Recovery
Abstract
Modern cloud-native applications generate large volumes of telemetry, yet incident response still depends heavily on engineers who must notice a fault, diagnose it and apply a fix by hand. This paper presents AI Self-Healing DevOps, a working prototype that closes this loop through six stages: Monitor, Detect, Decide, Heal, Verify and Learn. Telemetry (metrics, logs, traces and events) flows through a topic-based event router into an anomaly detector that combines an Isolation Forest with a zscore guard. A Random Forest classifier labels the failure type, a dependency-graph and correlation analysis localises the root cause, and a retrieval step over a growing incident knowledge base supplies similar past cases for an explanation. A policy and risk engine then validates the remediation plan against an allowlist, playbooks, a flapping guard and a human-approval rule for high-risk actions, and dispatches it to Ansible, Argo CD and GitHub Actions executors. A verifier confirms recovery, retries, or escalates to an engineer, and the outcome updates the knowledge base and the approval policy. The prototype runs in a simulation mode and in a live mode against a real Express application, and is evaluated on six fault scenarios. We describe the design, state clearly which components are real and which are stand-ins, and discuss limitations and directions for production use.