Simple pattern matching works (pattern, anyPattern)
You're only checking field existence
No cross-field validation needed
Test Before Deploying
Always test JMESPath expressions with kyverno jp before adding them to policies. Syntax errors fail silently in audit mode and block resources in enforce mode.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: adaptive-enforcement-lab-claude-skills-jmespath-for-kyverno3description: JMESPath for Kyverno4---56# JMESPath for Kyverno78## When to Use This Skill910**Use JMESPath when:**1112- Pattern matching can't express your logic13- You need conditionals or transformations14- Validation depends on multiple fields15- You're filtering or comparing arrays1617**Skip JMESPath when:**1819- Simple pattern matching works (`pattern`, `anyPattern`)20- You're only checking field existence21- No cross-field validation needed2223> **Test Before Deploying**24>25> Always test JMESPath expressions with `kyverno jp` before adding them to policies. Syntax errors fail silently in audit mode and block resources in enforce mode.26>2728---293031## Implementation3233**Install Kyverno CLI for testing:**3435```bash36# Install kyverno CLI37brew install kyverno/kyverno/kyverno3839# Test JMESPath expression40kyverno jp query -i manifest.yaml 'spec.template.spec.containers[*].name'41```4243**Simple validation example:**444546*See [examples.md](examples.md) for detailed code examples.*4748**What this does:**4950- Filters containers without memory limits: `containers[?!resources.limits.memory]`51- Extracts their names: `.name`52- Counts them: `| length(@)`53- Denies if count > 05455---565758## Examples5960See [examples.md](examples.md) for code examples.61## References6263- [Source Documentation](https://adaptive-enforcement-lab.com/enforce/policy-as-code/)64- [AEL Enforce](https://adaptive-enforcement-lab.com/enforce/)6566---67> Converted and distributed by [TomeVault](https://tomevault.io/claim/adaptive-enforcement-lab) — claim your Tome and manage your conversions.68<!-- tomevault:4.0:skill_md:2026-04-15 -->
Run npx skillmds@latest add tomevault-io/adaptive-enforcement-lab-claude-skills-jmespath-for-kyverno in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
JMESPath for Kyverno It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.