Skip to content
Skills Library
Law & compliance · Building & coding

compliance-as-code

/compliance-as-code

Turns compliance controls into executable, version-controlled checks with automated evidence collection, so audits become a query instead of a fire drill. Use this whenever the user is preparing for SOC 2, ISO 27001, or PCI audits, mapping controls to infrastructure, detecting drift from a compliance baseline, manually screenshotting settings for an auditor, or proving a control is enforced rather than just documented. For enforcing rules at deploy time use `policy-as-code`; for who has access to audited systems use `iam-access-management`.

Licence
MIT
Last repository change
25.08.2026

Assessment and security

95/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content30 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 25.08.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Turns compliance controls into executable, version-controlled checks with automated evidence collection, so audits become a query instead of a fire drill. Use this whenever the user is preparing for SOC 2, ISO 27001, or PCI audits, mapping controls to infrastructure, detecting drift from a compliance baseline, manually screenshotting settings for an auditor, or proving a control is enforced rather than just documented. For enforcing rules at deploy time use `policy-as-code`; for who has access to audited systems use `iam-access-management`.

Original author description

Turns compliance controls into executable, version-controlled checks with automated evidence collection, so audits become a query instead of a fire drill. Use this whenever the user is preparing for SOC 2, ISO 27001, or PCI audits, mapping controls to infrastructure, detecting drift from a compliance baseline, manually screenshotting settings for an auditor, or proving a control is enforced rather than just documented. For enforcing rules at deploy time use `policy-as-code`; for who has access to audited systems use `iam-access-management`.

How it works

  1. 1. Map each control to a concrete, checkable assertion
  2. 2. Encode controls as code, run them continuously
  3. 3. Generate evidence automatically, not manually
  4. 4. Detect and alert on drift from baseline
  5. 5. Treat every finding as a ticket with an owner, not a checkbox
  6. Report
Original SKILL.md headings · 89 lines, 699 words
SKILL.md preview
---
name: compliance-as-code
description: Turns compliance controls into executable, version-controlled checks with automated evidence collection, so audits become a query instead of a fire drill. Use this whenever the user is preparing for SOC 2, ISO 27001, or PCI audits, mapping controls to infrastructure, detecting drift from a compliance baseline, manually screenshotting settings for an auditor, or proving a control is enforced rather than just documented. For enforcing rules at deploy time use `policy-as-code`; for who has access to audited systems use `iam-access-management`.
license: MIT
---

# Compliance as Code

The traditional audit is a controlled panic: weeks of screenshotting console settings, chasing
down who approved what, and hoping nothing changed between the evidence snapshot and the actual
audit date. That process proves compliance at one instant in time and says nothing about the
other 364 days of the year — which is exactly when the control usually drifts.

Compliance as code expresses each control as a check that runs continuously against real
infrastructure, producing evidence as a byproduct of normal operation instead of a special one-
time effort. The audit stops being an event you prepare for and becomes a report you already
have.

**If proving a control holds requires a human to go look, the control isn't actually enforced —
it's hoped for.**

## 1. Map each control to a concrete, checkable assertion

"Encrypt data at rest" is a policy statement, not a control you can automate. "Every RDS
instance has `storage_encrypted = true`" is a control. Break every framework requirement (SOC
2, ISO 27001, PCI-DSS, HIPAA) down to assertions that map onto real resource attributes, IAM
configuration, or pipeline gates. Many frameworks overlap heavily — build the control library
once and map multiple frameworks onto it rather than duplicating checks per framework.

**Done when:** every control in scope has at least one automated check that queries live
infrastructure state.

## 2. Encode controls as code, run them continuously

Tools like OPA/Rego, Chef InSpec, or cloud-native config rules let you express "this is what
compliant looks like" as a versioned artifact that runs on a schedule or on every change, not
just before an audit. Version control gives you the same review and history for a compliance
rule that you'd expect for application code — a control change should go through a pull
request, not a spreadsheet edit.

```rego
# compliant: every storage bucket must deny public read
deny[msg] {
  input.resource_type == "storage_bucket"
  input.public_access == true
  msg := "bucket must not allow public access"
}
```

**Done when:** compliance checks run on a schedule independent of any upcoming audit date.

## 3. Generate evidence automatically, not manually

An auditor wants proof a control held over a period, not a screenshot from the morning of the
audit. Pipe check results, timestamps, and remediation history into a store the audit process
reads directly, so "show me evidence for control X for the last quarter" is a query, not a
scavenger hunt through Slack and email threads.

- **Timestamp everything**: a control that's compliant today is worthless evidence for a claim
  about last quarter unless you can show continuous history.
- **Store evidence immutably**, so it can't be edited after the fact to look better than it
  was.

**Done when:** producing a quarter's evidence for any control takes a query, not a manual
evidence-gathering effort.

## 4. Detect and alert on drift from baseline

A control that passed at deploy time can silently fail six months later — someone opens a
security group "temporarily," a bucket policy gets loosened for a one-off debugging session and
never gets reverted. Continuous checks catch this the same day it happens rather than at the
next audit cycle, when the cause is long forgotten and the exposure window was months, not
hours.

**Done when:** a manual change that violates a control triggers an alert before the next audit,
not during it.

## 5. Treat every finding as a ticket with an owner, not a checkbox

A failed control needs a remediation path as concrete as a vulnerability finding: who owns it,
what fixes it, and by when. Controls that fail silently into a dashboard nobody reads provide
no more assurance than not checking at all — the goal is closed-loop remediation, not just
visibility.

**Done when:** every failing control has an assigned owner and a remediation deadline, tracked
the same way as any other production issue.

## Report

State which frameworks are in scope, what fraction of controls are automated versus still
manually attested, and how evidence is generated and stored. Name the control category still
verified by hand — that manual gap is where drift will hide undetected, and calling it out is
more credible than claiming full automation.

Versions

The database has no other skills named compliance-as-code.

Database snapshot: 13.11.2026 · package version 197515f05a64 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100compliance-audit
    Regulatory compliance auditing across GDPR, HIPAA, PCI DSS, SOC 2, and ISO frameworks with automated evidence collection and gap analysis. Use when conducting compliance assessments, preparing for certifications, or implementing regulatory controls.
  • 100security-compliance-auditor
    Use when Codex should act as the Compliance Auditor specialist from Agency Agents. Expert technical compliance auditor specializing in SOC 2, ISO 27001, HIPAA, and PCI-DSS audits — from readiness assessment through evidence collection to certification.
  • 100compliance-auditor
    Use this agent when you need to achieve regulatory compliance, implement compliance controls, or prepare for audits across frameworks like GDPR, HIPAA, PCI DSS, SOC 2, and ISO standards.
  • 100regulatory-compliance
    Use this skill when preparing for SOC 2, HIPAA, or PCI-DSS compliance, conducting audits, or implementing security controls. Triggers on SOC 2, HIPAA, PCI-DSS, compliance audit, security controls, risk assessment, control frameworks, and any task requiring regulatory compliance…
  • 100security-compliance-mapping-soc2-iso-pci-nist
    Guides mapping technical controls an engineering team has already implemented — secrets management, IAM/least-privilege, logging and audit trails, encryption at rest/in transit, SAST/DAST/SCA scanning, backup and DR — to SOC 2 Trust Services Criteria, ISO/IEC 27001 Annex A…
  • 100compliance-automation
    Generates draft compliance policies for SOC 2 Type I/II, ISO 27001, and HIPAA frameworks. Produces evidence collection checklists, control mapping matrices, and gap analysis reports from existing documentation. Use when asked to 'prepare for SOC 2 audit', 'generate compliance…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.