k8s-policy

Detect Kyverno and Gatekeeper policies and inspect violation reports.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/spigell/my-agents --skill k8s-policy-spigell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: k8s-policy
Source: https://github.com/spigell/my-agents/tree/main/agents/shared/src/tools/ask_kubernetes_expert/skills/k8s-policy
Command: npx skills add https://github.com/spigell/my-agents --skill k8s-policy-spigell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you manage Kubernetes security and compliance by creating, validating, and auditing policy behavior using Kyverno and Gatekeeper, so misconfigurations are caught before they reach production.

Core Features & Use Cases

  • Policy Engine Detection & Readiness: Detects whether Kyverno and/or Gatekeeper are installed before attempting policy operations.
  • Kyverno Policy Management: Lists ClusterPolicies and retrieves policy details and policy reports to understand what is enforced and what has failed.
  • Gatekeeper (OPA) Constraint Management: Lists constraints/templates and retrieves specific constraint details to review enforcement logic and expected inputs.
  • Audit-First Workflow: Supports an audit workflow that uses policy reports to identify violations before switching enforcement posture.

Quick Start

Use the k8s-policy skill to detect your cluster’s policy engines, then list Kyverno ClusterPolicy reports in the default namespace to identify current violations.

Frequently Asked Questions about k8s-policy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Kubernetes policy violations before enforcing new rules?

To audit Kubernetes policy violations, use an audit-first workflow to retrieve policy reports from Kyverno or Gatekeeper. This identifies failed resource configurations so you can review violations before switching to active enforcement.

Does this Skill support managing both Kyverno ClusterPolicies and Gatekeeper constraints?

Yes, it supports managing both Kyverno ClusterPolicies and Gatekeeper constraints. It detects which policy engines are installed, lists active policies, and retrieves constraint details to validate enforcement logic.

How do I list Kyverno ClusterPolicies to check resource configurations?

You can list Kyverno ClusterPolicies by detecting the policy engine and retrieving policy details and reports. This lists what is enforced and checks current resource configurations against defined security rules.

What's the best way to detect if Gatekeeper or Kyverno is installed in my cluster?

The best way to detect installed policy engines is through automated readiness checks. This detects whether Kyverno and Gatekeeper are installed in your cluster before attempting policy operations.

Can I retrieve Gatekeeper constraint details to review expected inputs?

Yes, you can retrieve Gatekeeper constraint details and templates. This allows you to inspect specific constraint configurations to review the expected inputs and enforcement logic applied to resources.

Why review policy reports before applying Kubernetes security enforcement?

Reviewing policy reports before security enforcement catches misconfigurations before they reach production. This audit-first process validates resource compliance and prevents blocking deployments with unexpected policy violations.