Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Kyverno CLI

$ kyverno Foundation Low Risk
Kyverno / CNCF · Cloud & Infra · Apache-2.0 · macos / linux / windows

The kyverno CLI evaluates Kyverno policies against local YAML manifests or live clusters without installing the in-cluster admission controller. It supports --output-format json on kyverno apply and -o json on kyverno test, plus --explain rule tracing.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
brew install kyverno
CLI vs MCP Decision CLI Preferred vs MCP

kyverno apply and kyverno test validate local policy directories offline with -o json and --explain far faster than any MCP round-trip.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Outputs structured JSON via --output-format json (apply) and -o json (test), plus --explain and --fail-only for terse agent feedback.

  • kyverno apply --policy-report --output-format json
  • kyverno test -o json --fail-only and --explain
Trust & Safety 23 / 25

Purely read-only policy evaluation by default (never mutates the live cluster even when --cluster is used); can optionally write mutated YAML only if -o file path is specified.

  • Read-only evaluation; never mutates live cluster resources
Setup & Portability 15 / 15

Single static Go binary available via Homebrew, Krew, and GitHub Releases across macOS, Linux, and Windows.

  • Cross-platform binary via brew install kyverno
Utility & Efficiency 12 / 15

Catches Kubernetes policy and CEL violations locally in CI or pre-commit before manifests reach the cluster.

  • Offline policy and CEL validation
Maintenance & Lineage 9 / 10

CNCF incubating project (kyverno/kyverno) maintained under Apache-2.0.

  • Official CNCF kyverno/kyverno repository
Docs & Verifiability 8 / 10

Clear kyverno.io/docs/kyverno-cli/ documentation and examples.

  • Official Kyverno CLI documentation

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

Requires no credentials for local manifest/test validation; uses ~/.kube/config (KUBECONFIG) only when --cluster is passed.

Side Effects
Read-Only Local Write
Cost & Quotas

CLI is free (Apache-2.0) and runs locally without API billing.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Kyverno CLI Agent Rules
- Keep evaluations local by default (`kyverno apply -r <file>`); only pass `--cluster` for intentional live audits.
- Use `--policy-report --output-format json` (for `apply`) or `-o json` (for `test`) for structured parsing.
- Use `--explain` when debugging why a policy rule matched or skipped.

Agent-Ready Command Recipes

Safe Read-Only Queries

Evaluate a policy against local manifests as JSON
kyverno apply policy.yaml --resource deploy.yaml --policy-report --output-format json

Applies Kyverno policies locally in read-only mode and outputs a structured JSON policy report.

Run Kyverno policy unit tests as JSON
kyverno test ./policies -o json --fail-only

Executes kyverno-test.yaml suites locally and emits failing assertions in JSON.

Strengths for Agents

  • + Offline, read-only policy validation with structured JSON output on both apply and test.
  • + --explain traces rule matching and variable evaluation cleanly for debugging.
  • + Zero cluster mutations even when auditing live resources with --cluster.

Caveats & Pitfalls

  • ! Flag names differ slightly between subcommands (--output-format json on apply vs -o json on test).
  • ! Mutating policies require --output to inspect transformed manifests.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI