Skip to main content

Why compliance needs automated review

Compliance frameworks like SOC2, HIPAA, and GDPR require specific coding practices around data handling, access control, and audit logging. Manual reviews catch some violations, but they’re inconsistent — especially when the reviewer isn’t a security specialist. This cookbook sets up rules that enforce compliance requirements on every PR.

Step 1 — Define your compliance Memories

Start by teaching Kody the high-level compliance principles:

Step 2 — Create audit trail rules

Audit logging rule

Data retention rule

Step 3 — Create data handling rules

PII exposure prevention

Encryption requirement

Step 4 — Create access control rules

Step 5 — Add a PR-level compliance check

Step 6 — Configure for enforcement

  1. Enable Request Changes so compliance violations block merge
  2. Set all compliance rules to Critical severity
  3. Use rule inheritance to apply compliance rules across all repos in the organization

Checklist

  • Compliance Memories teach the high-level principles
  • Audit logging rule covers all data mutation paths
  • PII exposure rule covers logs and error responses
  • Encryption rule covers entity/model definitions
  • Access control rule covers all new endpoints
  • Request Changes enabled for critical findings
  • Rules are set at organization level for consistency
  • A test PR verified the rules fire correctly
For more on configuring rules, see Kody Rules.