A Kubernetes runtime alert can identify suspicious activity, but turning it into a durable fix often requires investigation, configuration work and review. A proposed workflow links Falco detection to an AI agent, Kyverno policy checks and a GitLab merge request, keeping deployment under engineer approval rather than giving the agent direct write access to the cluster.
The design, described by Anna Cyganik of Software Mind, treats the model as an analyst and fix author within a controlled delivery process. Falco detects activity, deterministic code filters and verifies proposals, and a human reviewer decides whether a change should be merged. The approach aims to connect runtime security with the GitOps repository that governs future deployments.
From detection to a proposed fix
Falco runs on Kubernetes nodes and monitors system calls and Kubernetes audit events. Its alerts are sent by webhook to an agent built with Python, FastAPI and LangGraph, using an LLM from Azure OpenAI. The service enriches alerts with Kubernetes context, including the affected pod, its owner, images and related alerts, before returning an assessment with risk, confidence, a MITRE ATT&CK technique and an investigation plan.
Before an alert reaches the model, deterministic filters handle repeated events and known benign platform activity. The workflow keeps risk and confidence as separate values: missing context should reduce confidence rather than lower the assessed risk. It also groups alerts from the same workload into one incident. Only cases that meet configured gates—risk of at least 0.8 and confidence of at least 0.7, among other conditions—qualify for mitigation drafting.
For an eligible incident, the agent proposes a Kyverno policy and a hardened version of the affected workload manifest. The controls are tied to the observed attack steps and draw on established guidance, including the Restricted profile of the Kubernetes Pod Security Standards and NIST SP 800-190. The agent does not apply either change itself.
Verification and human approval
Kyverno’s command-line interface checks each proposal against the live cluster before a merge request is opened. In the described process, the current workload must fail the proposed policy, the hardened manifest must pass, and a policy in Deny mode must not block other workloads. If verification fails, the result is returned to the model for another attempt, up to three times. When safe enforcement cannot be established, the policy can use Audit mode or be narrowed.
The merge request contains the proposed policy and manifest along with the incident timeline, assessment, reasoning, known limitations and verification results. An engineer can request changes in comments; the agent can revise the proposal and run verification again. Once a reviewer approves and merges the request, the existing CI/CD pipeline deploys it. The service account is read-only for the cluster, so the agent cannot bypass Git review.
Using GitOps makes the mitigation part of the repository’s configuration rather than a temporary change to a running pod. The change follows existing review and branch-protection practices, can be rolled back through Git, and can prevent the same insecure configuration from returning in a later release. The workflow was tested with GitLab CI; the described repository-based approach can also be reconciled by pull-based GitOps controllers such as Argo CD or Flux.
Results from a test cluster
The live test used a three-node Kubernetes cluster running Falco, Kyverno and Azure OpenAI. The target was demo-shop, a deliberately vulnerable service with an OS command injection flaw. It ran as root, with a writable root filesystem and no security context. A single HTTP request exploited the flaw, read container credentials and dropped and ran a binary.
Falco generated two alerts in the same second. The agent assessed their risk at 0.98 and 0.99 and mapped them to MITRE ATT&CK techniques. One minute and 45 seconds later, it opened a merge request containing a Kyverno policy in Deny mode and a hardened manifest. Verification passed on the first attempt, with no other workloads affected. After a reviewer requested a dedicated user, the agent updated the proposal and pushed a verified revision about 50 seconds later.
Following the merge, Kyverno rejected the vulnerable configuration. The same exploit could no longer read /etc/shadow or write its binary to the read-only filesystem, and Falco reported no further alerts for that workload. The underlying application flaw remained; the mitigation limited what an attacker could do and did not replace a code fix.
Boundaries and operational measures
The test figures represent one scenario, not expected production averages. The implementation suggests that production teams also track AI-triage false-positive rates and the share of agent-authored merge requests accepted without changes. Those measures can help assess whether the workflow is useful and reliable in a particular environment.
Its central boundary is explicit: the AI proposes, deterministic checks verify, and an engineer decides. Alert assessments, proposals, verification results and approvals are recorded through Git and the application database, supporting review and audit needs. Falco and Kyverno provide the detection and policy-enforcement components, while the model can be replaced without changing the overall workflow. The result is a route from runtime signal to reviewed, repeatable Kubernetes configuration—not autonomous production remediation.