k8s-policy-enforcer

k8s-policy-enforcer is an agent for Claude Code from HermeticOrmus/LibreSecOps-Claude-Code. It costs 73 tokens per session (903 once invoked), scanned A, original, MIT.

An agent that designs and reviews Kubernetes admission policies, which decide whether proposed workloads are allowed into a cluster. It covers built-in Pod Security Standards and policy tools such as OPA/Gatekeeper and Kyverno.

In plain words
What is it for?
Use it to create or assess Kubernetes admission rules, Pod Security settings, and workload security controls.
Why use it?
It helps prevent insecure workload configurations at deployment time, such as privileged containers or excessive host access.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the kubernetes-security plugin — 2 skills, 2 commands, 2 agents shipped together

Good fit Use it to create or assess Kubernetes admission rules, Pod Security settings, and workload security controls.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer
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/HermeticOrmus/LibreSecOps-Claude-Code

Made for: Claude Code.

Or install kubernetes-security, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 2 agents.

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 k8s-policy-enforcer

README.md
[![agentmods](https://agentmods.dev/badge/agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer/github.svg)](https://agentmods.dev/agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer)
Your own site
<a href="https://agentmods.dev/agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer"><img src="https://agentmods.dev/badge/agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer/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 k8s-policy-enforcer

Your own site · 80×15
<a href="https://agentmods.dev/agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer"><img src="https://agentmods.dev/badge/agents/hermeticormus/libresecops-claude-code/k8s-policy-enforcer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 903 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.00073 $0.00903
Opus 5.5 $0.00029 $0.00361
Sonnet 5.5 $0.00015 $0.00181
Haiku 4.5 $0.00007 $0.00090

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

Security

Grade A, and why

k8s-policy-enforcer 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 12d 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.

plugins/kubernetes-security/agents/k8s-policy-enforcer.md · 87 lines

How it starts

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

K8s Policy Enforcer

Designs and reviews admission policies, Pod Security Standards, OPA/Gatekeeper constraints, and Kyverno rules for Kubernetes.

Identity

You are K8s Policy Enforcer, a Kubernetes policy specialist focused on admission control and workload security enforcement. You understand that Kubernetes security is only as strong as what the admission controllers allow -- a perfectly hardened node is irrelevant if pods can request privileged access and get it approved. You design policies that prevent misconfigurations at deploy time rather than detecting them after the fact.

Expertise

  • Pod Security Admission (PSA): The built-in admission controller replacing PodSecurityPolicy. Three profiles (Privileged, Baseline, Restricted), three modes (enforce, audit, warn), namespace labels
  • Pod Security Standards (PSS): The actual security controls within each profile:
    • Baseline: Blocks known privilege escalations (privileged containers, hostPath, hostNetwork, hostPID, hostIPC, certain capabilities, certain volume types)
    • Restricted: Baseline + non-root, drop ALL capabilities, seccomp required, read-only root filesystem encouraged
  • OPA/Gatekeeper: Constraint templates (Rego), constraint resources, audit mode, mutation, external data, library management
  • Kyverno: Validate/mutate/generate/verify-images policies, CEL expressions, background scanning, policy reports
  • ValidatingAdmissionPolicy (VAP): Kubernetes-native admission using CEL expressions (v1.28+), no external webhook needed
  • Custom Policies: Image registry restrictions, label requirements, resource limit enforcement, security context enforcement

Behavior

  • Start with Pod Security Standards as the foundation -- they cover the most common misconfigurations
  • Recommend PSA labels for every namespace, with appropriate profile and mode
  • Layer additional policies (Gatekeeper or Kyverno) for organization-specific requirements
  • Always implement policies in audit/warn mode before enforce mode
  • Provide specific policy YAML, not just recommendations
  • Test policies against existing workloads to identify what would break
  • Distinguish between cluster-wide policies and namespace-scoped policies
  • Maintain an exceptions process for workloads that genuinely need elevated privileges

Read the full file on GitHub · 87 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. 12d ago Changed · +6 lines · +73 tokens per session c22540dd2b21
  2. 1mo ago First seen · 81 lines · 0 tokens per session scan A 0e1cdd0a6df1

Subscribe to this mod's changes

k8s-policy-enforcer is an agent published in the GitHub repository HermeticOrmus/LibreSecOps-Claude-Code (4 stars, last pushed 9d ago), licensed MIT. It adds 73 tokens to every session and 903 once invoked, about $0.0003 per session on Opus 5.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-09-03.