Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

policy-as-code

Skill by sickn33

Provides policy as code examples using OPA Rego, Kyverno and Checkov to enforce compliance in CI/CD and infrastructure. Aimed at DevOps, platform and security engineers.

  • Score 92
  • 50k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install policy-as-code

Built from the published package, never by AI.

git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/policy-as-code ~/.claude/skills/policy-as-code

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install policy-as-code in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill gives an AI assistant guidance and code examples for policy as code. It includes OPA Rego policies that check Terraform plan JSON for public S3 ACLs, unencrypted RDS and EBS volumes, and required tags. It also includes Kyverno ClusterPolicies for Kubernetes pods, such as required labels, privileged container limits, resource limits, image tag rules and approved registries, plus Checkov custom checks written in Python.

The examples are meant to run in CI/CD. They show how to evaluate plans with opa eval or Conftest and how to output Checkov results as SARIF for GitHub Advanced Security. The source says the examples cover selected controls only, not full compliance, and that teams must resolve providers, regions and image signatures themselves. It is aimed at engineers who want to enforce compliance through automation.

Written from the project's SKILL.md and checked against it.

What it can do

  • OPA Rego policies for TerraformDenies public S3 ACLs, unencrypted RDS and EBS, and missing required tags in plan JSON.
  • Kyverno Kubernetes policiesEnforces labels, no privileged containers, resource limits, no latest tag and approved registries.
  • Checkov custom checksAdds Python checks for S3 versioning and RDS backup retention of at least 7 days.
  • CI evaluation commandsShows terraform plan, opa eval and Conftest commands to test plans in a pipeline.
  • SARIF reportingShows how to write Checkov results to a SARIF file for code scanning.

What you need

  • Terraform
  • Open Policy Agent (opa) CLI
  • Conftest
  • Kyverno with compatible CRDs
  • Checkov

Try asking

  • Write an OPA Rego policy that denies public S3 buckets in a Terraform plan.
  • Create a Kyverno policy that blocks privileged containers in all pods.
  • Build a Checkov custom check that requires RDS backup retention of 7 days.

Good to know

  • Examples cover selected controls only and do not claim full compliance.
  • No generic region policy is provided; region checks need a reviewed adapter.
  • NetworkPolicy checks need integration tests and scoped RBAC.
  • Terraform plan JSON can contain secrets and needs restricted artifact handling.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/policy-as-code/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md13 KB
  • references/details.md6 KB

Alternatives to policy-as-code

All alternatives →

Compare with function_health, windows-privilege-escalation or github-actions-advanced

policy-as-code: common questions

Does this skill check full compliance?

No. The source says the examples cover selected controls, not full compliance, and teams must apply controls through their own change process.

Why does opa eval not fail the pipeline on findings?

The source says opa eval normally exits successfully even when deny contains findings, so it recommends a reviewed aggregate decision or Conftest that fails on findings.

Does banning the latest tag make images safe?

No. The source says banning latest does not make another mutable tag trustworthy, so digest and signature verification are needed separately.

How do I install policy-as-code?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is policy-as-code free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is policy-as-code safe to use?

It scores 92 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to policy-as-code?

Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.

policy-as-code Install

Add to stack

Loading.