Security
How Falco and Kyverno Harden Kubernetes With Human-in-the-Loop GitOps
CNCF's reference architecture bridges runtime syscall detection in Falco with Kyverno 1.20 admission policies through a human-in-the-loop GitOps workflow. A LangGraph agent enriches alerts, drafts NIST SP 800-190 remediations, verifies them deterministically with the Kyverno CLI, and opens a GitLab merge request for engineer sign-off.
9 min read
How Falco and Kyverno Harden Kubernetes With Human-in-the-Loop GitOps
Executive Summary
Container runtime detection and GitOps admission control have historically operated in disconnected silos: tools like Falco fire thousands of syscall and audit alerts into a ticket queue, while Kyverno policies and Kubernetes manifests sit in Git waiting for manual pull requests. On November 30, 2026 (published December 1, 2026), the Cloud Native Computing Foundation (CNCF) published a reference architecture by Software Mind's Anna Cyganik—From runtime alert to merge request: An AI agent that mitigates Kubernetes threats with Falco and Kyverno—demonstrating how to bridge that gap without granting an LLM autonomous write access to production clusters.
Instead of mutating running pods directly, the architecture uses a LangGraph-based AI agent to enrich Falco alerts with cluster context, draft NIST SP 800-190 and Kubernetes Pod Security Standards (PSS) Restricted remediations, deterministically verify every proposed Kyverno policy against the live cluster via the Kyverno CLI (up to three retries), and open a GitLab merge request for human approval. Paired with Kyverno 1.20 (released November 12, 2026) and the Kyverno End User Threat Model and Hardening Guide, the model delivers fast mean time to respond (MTTR) while preserving strict zero-trust boundaries and auditability for NIS2 and DORA compliance.
| Architectural Layer | CNCF Graduated / Core Component | Deterministic Security Guarantee | Primary Source |
|---|---|---|---|
| Runtime Detection | Falco + Falcosidekick + k8saudit (Graduated Feb 29, 2024) |
Captures syscalls and K8s audit events at kernel/API edge | CNCF Falco |
| Policy & Admission | Kyverno 1.20 (Graduated Mar 16, 2026) | Enforces PSS Restricted & bounded CEL evaluation at admission | Kyverno 1.20 |
| Verification Gate | Kyverno CLI (kyverno apply) |
Rejects unhardened pod, accepts hardened manifest, zero collateral blocks | CNCF Blog |
| Delivery & Approval | GitLab Merge Request + Helm | Human-in-the-loop sign-off; full Git + PostgreSQL audit trail | Azure Gravy / CNCF |
Trust Model & Architecture
Separating Non-Deterministic AI Reasoning From Deterministic Enforcement
Full production autonomy—where an LLM directly patches live Kubernetes deployments or applies cluster-wide admission policies—remains unsafe due to hallucination risk, misinterpretation of legitimate workload behavior, and limited explainability (Azure Gravy / CNCF). The CNCF reference architecture solves this by placing deterministic gates on both sides of the AI agent:
- Detection Plane (Deterministic): Falco, paired with Falcosidekick and the
k8sauditplugin, monitors Linux system calls and Kubernetes API audit logs across nodes, forwarding structured alerts to a Python service built on FastAPI and LangGraph. - Reasoning Plane (Non-Deterministic, Read-Only): The LangGraph agent (backed by Azure OpenAI in the reference stack) correlates the alert with deployment manifests, checks whether the behavior is normal for that workload, and drafts both a hardened Kubernetes manifest (aligned with Pod Security Standards Restricted and NIST SP 800-190) and a matching Kyverno admission policy.
- Verification Plane (Deterministic, Bounded): Before any human sees the proposal, the Kyverno CLI tests the policy against the live cluster state. The proposed policy must pass three strict assertions: (a) reject the vulnerable workload as currently running, (b) accept the hardened manifest, and (c) in
Deny(Enforce) mode, block nothing else. If any check fails, the error feeds back to the model for up to three attempts. - Control Plane (Human-in-the-Loop GitOps): Once verified, the agent opens a GitLab merge request containing the Kyverno policy, manifest diff, incident timeline, reasoning, known limitations, and CLI verification output. An engineer reviews, questions, or requests revisions directly in MR comments before merging to trigger Helm/GitOps deployment.
flowchart LR
K8S[Kubernetes Nodes & API Server] -->|Syscalls + k8saudit| FALCO[1. Falco + Falcosidekick]
FALCO -->|Alert Event| AGENT[2. FastAPI / LangGraph Agent]
AGENT -->|Read-Only Context Lookup| GIT[(GitOps Repo & Manifests)]
AGENT -->|Draft Policy + Hardened Pod| CLI[3. Kyverno CLI Verifier]
CLI -->|Fail: Retry up to 3x| AGENT
CLI -->|Pass: Rejects Bad / Allows Fixed / Zero Collateral| MR[4. GitLab Merge Request]
MR -->|Human Engineer Approval| PIPE[5. GitOps CI/CD + Helm]
PIPE -->|Enforce Admission Policy| KYV[Kyverno 1.20 Admission Controller]
KYV -->|Blocks Recurrence| K8SReactive Ticket Queues vs. AI-Assisted GitOps Mitigation
Comparing traditional SOC alert triage against the CNCF Falco-plus-Kyverno pipeline highlights where deterministic automation eliminates bottlenecks without sacrificing human governance (Azure Gravy / CNCF):
| Operational Aspect | Reactive SOC Queue | AI-Assisted GitOps Pipeline |
|---|---|---|
| Alert Handling | Waits in queue for manual analyst triage | Filtered, enriched with K8s context, and assessed in seconds |
| Root Cause Analysis | Manual search across manifests and Git history | Linked directly to the workload spec that enabled the behavior |
| Fix Preparation | One-off kubectl patch on a running pod |
Drafted as a Kyverno policy + hardened manifest, CLI-verified |
| Delivery Mechanism | Ticket followed by manual cluster change | GitLab merge request reviewed and approved by an engineer |
| Recurrence Prevention | Same insecure config can be redeployed | Blocked or audited automatically by Kyverno admission control |
What Researchers & Analysts Say
Both the CNCF engineering team and independent threat-modeling researchers highlight why pairing runtime detection with verified admission control is critical—and where the control plane itself must be hardened.
- Software Mind / CNCF Engineering Analysis (November 30, 2026): As Anna Cyganik details in the CNCF post, fixing a single running pod never prevents the next CI/CD deployment from reintroducing the same misconfiguration. Converting verified runtime incidents into Git-tracked Kyverno policies closes the loop permanently while recording every automated and human decision in Git and PostgreSQL to satisfy NIS2 and DORA auditability requirements (Azure Gravy).
- CNCF Project Maturity & Ecosystem Scale (2026): Both core engines are CNCF Graduated projects—meaning they have completed formal security audits and maintain stable APIs. Falco graduated on February 29, 2024 (2,275 contributors across 629 organizations), while Kyverno graduated on March 16, 2026 (3,697 contributors across 1,103 organizations).
- Kyverno End User Threat Model Report (ControlPlane / CNCF, 2026): While Kyverno enforces cluster security, ControlPlane's threat model report warns of a subtle privilege-escalation vector: any
ClusterRolecarrying the labelsrbac.kyverno.io/aggregate-to-admission-controller: "true"orrbac.kyverno.io/aggregate-to-background-controller: "true"automatically extends Kyverno's controller permissions. Platform teams must therefore audit who can create labeledClusterRoleobjects, not only who holds existing Kyverno roles. - Kyverno 1.20 Hardening (November 12, 2026): In Kyverno 1.20, maintainers carried forward
v1.19.2denial-of-service protections—bounded CEL evaluation cost, a bounded wildcard matcher, and bounded registry reads—alongside updated Helm-chart Pod Security Standards supporting Pod user namespaces and adisallow-host-probesBaseline policy. These bounds are essential when an AI agent generates policies that will execute inside the Kubernetes admission webhook hot path.
Hardening & Implementation Blueprint
To deploy a Falco-to-Kyverno GitOps pipeline safely in production, enforce these three concrete configurations.
1. Kyverno Policy Enforcing PSS Restricted & Preventing Recurrence
When Falco detects a container escaping privileges or writing to sensitive host paths, the AI agent should generate a scoped ClusterPolicy (or namespaced Policy) aligned with the Kubernetes Restricted profile—initially tested via CLI and deployed in Enforce mode only for the validated scope:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: enforce-restricted-workload-context
annotations:
policies.kyverno.io/title: Enforce Restricted Security Context
policies.kyverno.io/severity: high
spec:
validationFailureAction: Enforce
background: true
rules:
- name: require-non-root-and-drop-caps
match:
any:
- resources:
kinds:
- Pod
namespaces:
- payments-prod
validate:
message: "Containers must run as non-root, drop ALL capabilities, and disable privilege escalation."
pattern:
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
Operational Overhead: Enforcing readOnlyRootFilesystem: true and runAsNonRoot: true can break legacy containers that write temporary files to /tmp or bind privileged ports (< 1024). Always pair the policy with an emptyDir volume mount for /tmp in the hardened manifest and run the Kyverno CLI check before opening the merge request.
2. Deterministic Kyverno CLI Verification Gate
The agent's verification runner must execute deterministic kyverno apply checks inside an isolated CI/runner sandbox with no cluster-admin write credentials (read-only cluster snapshot or dry-run admission check):
kyverno apply generated-policy.yaml \
--resource vulnerable-pod.yaml \
--policy-report
kyverno apply generated-policy.yaml \
--resource hardened-pod.yaml \
--policy-report
kyverno apply generated-policy.yaml \
--cluster \
--namespace payments-prod \
--policy-report
Operational Overhead: Running kyverno apply --cluster against large namespaces adds 1–4 seconds of CLI execution per retry loop (capped at 3 retries). Bounding retries to 3 prevents runaway LLM token spend when a complex multi-container pod fails validation.
3. Securing Kyverno's Own RBAC & Agent Credentials
Per the Kyverno End User Threat Model Report, ensure the AI agent itself can never create ClusterRole objects or mutate Kyverno webhooks directly. Restrict the agent's service account to read-only Kubernetes API access and a scoped GitLab bot token limited to opening merge requests on a single policy branch:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ai-mitigation-agent-readonly
rules:
- apiGroups: [""]
resources: ["pods", "namespaces", "events"]
verbs: ["get", "list"]
- apiGroups: ["apps"]
resources: ["deployments", "replicasets", "statefulsets"]
verbs: ["get", "list"]
- apiGroups: ["kyverno.io"]
resources: ["clusterpolicies", "policies"]
verbs: ["get", "list"]
Operational Overhead: Maintaining strict read-only RBAC for the triage agent and requiring a human engineer to approve every GitLab MR adds 5–15 minutes of human review latency compared to zero-touch auto-remediation, but completely eliminates the risk of an AI agent locking out production traffic or escalating its own cluster permissions via aggregated ClusterRole labels.
Frequently Asked Questions (FAQ)
1. Does the AI agent apply Kyverno policies directly to the Kubernetes cluster?
No. In the CNCF reference architecture, the agent operates strictly in a human-in-the-loop GitOps model. It prepares the hardened manifest and Kyverno policy, verifies them with the Kyverno CLI, and opens a GitLab merge request for an engineer to review and merge.
2. How does the architecture prevent an LLM from breaking healthy production pods?
Every generated policy must pass three deterministic Kyverno CLI checks against the live cluster: it must block the vulnerable pod as currently running, allow the proposed hardened pod, and block nothing else in Deny mode. If any check fails, the CLI error returns to the model for up to three retries before failing closed.
3. Why use both Falco and Kyverno instead of just one?
Falco detects runtime anomalies (syscalls and Kubernetes audit events) inside running containers, which CI/CD scanners miss. Kyverno enforces admission control so the insecure configuration that allowed the runtime threat cannot be redeployed in future releases.
4. What changed in Kyverno 1.20 that helps AI-generated policies?
Released on November 12, 2026, Kyverno 1.20 includes bounded CEL evaluation cost, a bounded wildcard matcher, and bounded registry reads, reducing the risk that a complex or imperfect policy stalls the Kubernetes admission webhook.
5. Which compliance frameworks benefit from this GitOps audit trail?
Because every alert, AI proposal, CLI verification result, and human approval is logged in Git and PostgreSQL, the workflow directly supports NIS2 and DORA incident-response and change-management audit requirements (Azure Gravy / CNCF).
Sources
- CNCF Blog (Primary, November 30 / December 1, 2026): From runtime alert to merge request: An AI agent that mitigates Kubernetes threats with Falco and Kyverno — https://www.cncf.io/blog/2026/11/30/from-runtime-alert-to-merge-request-an-ai-agent-that-mitigates-kubernetes-threats-with-falco-and-kyverno/
- Kyverno Official Blog (Primary, November 12, 2026): Announcing Kyverno 1.20 — https://kyverno.io/blog/2026/11/12/announcing-kyverno-release-1.20/
- Kyverno / ControlPlane (Primary Threat Model, 2026): Kyverno End User Threat Model and Hardening Guide — https://kyverno.io/blog/controlplane-threat-model/assets/kyverno-end-user-threat-model-and-hardening-guide.pdf
- CNCF Project Page (Primary): Falco | CNCF — https://www.cncf.io/projects/falco/
- CNCF Project Page (Primary): Kyverno | CNCF — https://www.cncf.io/projects/kyverno/
- Azure Gravy (Secondary, December 1, 2026): From runtime alert to merge request: An AI agent that mitigates Kubernetes threats with Falco and Kyverno — https://www.azuregravy.com/news/3361