kyverno

kyverno is a command for Claude Code from nitinjain999/platform-skills. It costs 133 tokens per session (2,687 once invoked), scanned A, original, Apache-2.0.

A helper for Kyverno, a Kubernetes policy engine that checks or changes resources according to declared rules. It focuses on Kyverno’s newer policies written with CEL, a language for expressing conditions and transformations.

In plain words
What is it for?
Use it to enforce labels and other requirements, change or generate resources, test policies with the Kyverno command-line tool, inspect policy reports, debug behavior, and migrate older policies.
Why use it?
It helps create, test, audit, debug, and update policies without manually piecing together the required rules and test data.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the platform-skills plugin — 1 skill, 43 commands shipped together

Good fit Use it to enforce labels and other requirements, change or generate resources, test policies with the Kyverno command-line tool, inspect policy reports, debug behavior, and migrate older policies.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/nitinjain999/platform-skills/kyverno
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/nitinjain999/platform-skills

Made for: Claude Code.

Or install platform-skills, the plugin that ships this one along with the rest of its 1 skill, 43 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kyverno

README.md
[![agentmods](https://agentmods.dev/badge/commands/nitinjain999/platform-skills/kyverno/github.svg)](https://agentmods.dev/commands/nitinjain999/platform-skills/kyverno)
Your own site
<a href="https://agentmods.dev/commands/nitinjain999/platform-skills/kyverno"><img src="https://agentmods.dev/badge/commands/nitinjain999/platform-skills/kyverno/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kyverno

Your own site · 80×15
<a href="https://agentmods.dev/commands/nitinjain999/platform-skills/kyverno"><img src="https://agentmods.dev/badge/commands/nitinjain999/platform-skills/kyverno.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00133 $0.02687
Opus 5 $0.00067 $0.01344
Sonnet 5 $0.00027 $0.00537
Haiku 4.5 $0.00013 $0.00269

Measured 11d ago against content hash f06b7521cfb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

kyverno scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/kyverno.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write, test, audit, debug, and migrate Kyverno policies using the new CEL-based policy types.

All new policies use apiVersion: policies.kyverno.io/v1. Legacy ClusterPolicy (kyverno.io/v1) still works but is deprecated in v1.17 and planned for removal in v1.20.


Interactive Wizard (fires when no arguments are provided)

When invoked with no arguments, ask before proceeding:

Q1 — Mode?

What do you need?
  1. generate — write a new production-ready Kyverno policy
  2. test     — write kyverno-test.yaml fixtures and run kyverno-cli
  3. audit    — analyse PolicyReport data from a running cluster
  4. debug    — diagnose why a policy is not behaving as expected
  5. migrate  — convert a legacy ClusterPolicy or PodSecurityPolicy

Enter 1–5 or mode name:

Q2 — Context (after mode selected, one at a time):

  • generate: Describe the policy — what should it validate, mutate, or enforce? (e.g. "require app.kubernetes.io/team label on all Deployments"):
  • test: Paste or describe the policy to test:
  • audit: Paste the PolicyReport JSON or run: kubectl get policyreport -A -o json | jq '[.items[].results[] | select(.result == "fail")]'
  • debug: Describe the symptom — is the policy not blocking, not mutating, or not appearing in PolicyReport?
  • migrate: Paste the existing ClusterPolicy or PodSecurityPolicy YAML to migrate:

Then proceed into the relevant mode below.


Mode: generate

Write a production-ready Kyverno policy from a description.

Steps:

  1. Ask for: policy type (ValidatingPolicy / MutatingPolicy / GeneratingPolicy / ImageValidatingPolicy), target resource kinds, whether cluster-wide or namespace-scoped, and whether to start in Audit or Deny mode
  2. Start in validationActions: [Audit] unless the user explicitly requests Deny — blocking admission with an untested policy is high blast radius
  3. Generate the policy with:
    • apiVersion: policies.kyverno.io/v1
    • annotations block: policies.kyverno.io/title, category, severity, description
    • matchConstraints.resourceRules targeting only the required kinds and operations
    • matchConditions to exclude system namespaces (kube-system, kube-public, and platform tooling namespaces) — this replaces the old exclude block
    • For ValidatingPolicy: validations with CEL boolean expressions; use messageExpression for dynamic messages that include the resource name
    • For MutatingPolicy: mutations with patchType: ApplyConfiguration (prefer for adds/merges) or patchType: JSONPatch (for precise path operations); use jsonpatch.escapeKey() for special characters in paths
    • For GeneratingPolicy: variables with dyn() for inline resource definitions; generate with generator.Apply(namespace, [resources]); set evaluation.synchronize.enabled: true
    • For ImageValidatingPolicy: matchImageReferences with glob or CEL; attestors with cosign keyless or key-based; validations using verifyImageSignatures() CEL function
  4. Show the kyverno-cli command to dry-run: kyverno apply <policy.yaml> --resource <manifest.yaml> --detailed-results

Read the full file on GitHub · 200 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 200 lines · 133 tokens per session scan A f06b7521cfb0

Subscribe to this mod's changes

kyverno is a command published in the GitHub repository nitinjain999/platform-skills (41 stars, last pushed today), licensed Apache-2.0. It adds 133 tokens to every session and 2,687 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.