Harness compliance

From Intense-Visions/harness-engineering · View interactive version

Harness compliance is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > SOC2, HIPAA, GDPR compliance checks, audit trails, and regulatory checklists. Scans codebases for compliance-relevant patterns, classifies data by sensitivity, audits implementation against framewor

How to use this skill

Skill file

Harness Compliance

SOC2, HIPAA, GDPR compliance checks, audit trails, and regulatory checklists. Scans codebases for compliance-relevant patterns, classifies data by sensitivity, audits implementation against framework-specific controls, and generates gap analysis reports with remediation plans.

When to Use

Process

Phase 1: SCAN -- Detect Applicable Frameworks and Data Patterns

  1. Identify applicable compliance frameworks. Scan for indicators:
  1. Inventory data stores. Map all locations where user data is persisted:
  1. Trace data flows. Map how user data moves through the system:
  1. Check for existing compliance artifacts. Look for:
  1. Detect sensitive data patterns. Grep for fields and patterns that indicate regulated data:

Phase 2: CLASSIFY -- Data Sensitivity and Regulatory Scope

  1. Classify data fields by sensitivity. Apply a tiered classification:
  1. Map regulatory scope per data class. Determine which frameworks apply to each data class:
  1. Identify cross-border data flows. For GDPR compliance:
  1. Document data retention policies. For each data class:
  1. Produce the data classification matrix. Output a structured inventory:

Phase 3: AUDIT -- Check Against Framework Controls

  1. SOC2 Trust Services Criteria audit. Check implementation against key controls:
  1. HIPAA Security Rule audit. If PHI is present:
  1. GDPR compliance audit. If EU data is processed:
  1. PCI-DSS audit. If payment data is present:
  1. Audit trail verification. For all applicable frameworks:

Phase 3.5: INTERNAL COMPLIANCE -- Project Conventions

  1. Verify branch naming convention. Before creating a branch and again before

opening a PR, run harness verify (or harness verify --json for parsable

output) and act on the result -- do not just describe the rule to the user.

leading/trailing hyphen), max 60 chars after the prefix

(prefixes, enforceKebabCase, customRegex, ignore, maxLength). If

customRegex is set, it fully replaces the prefix/kebab/length checks --

read the project config before suggesting a branch name.

to the user and offer to rename (git branch -m <new-name>) before

continuing. Do not push or open a PR from a non-compliant branch.


Phase 4: REPORT -- Generate Gap Analysis and Remediation Plan

  1. Score compliance posture per framework. For each applicable framework:
  1. Produce the gap analysis. For each control not fully met:
  1. Generate audit-ready checklists. Produce framework-specific checklists:
  1. Create remediation plan. Organize gaps into actionable work:
  1. Output the compliance report. Generate docs/compliance/audit-report-YYYY-MM-DD.md:

```

Compliance Audit Report — YYYY-MM-DD

Frameworks Assessed: SOC2, GDPR

Data Classifications: 12 critical, 28 sensitive, 45 internal, 15 public

SOC2 Status: 78% (18/23 controls met, 3 partial, 2 not met)

NOT MET:

CC7.2 — No security event alerting configured

CC8.1 — No deployment audit trail

PARTIAL:

CC6.1 — RBAC exists but 4 endpoints lack authorization checks

CC6.3 — TLS in transit, but database encryption at rest not configured

CC6.2 — Passwords hashed, but no MFA available

GDPR Status: 65% (11/17 controls met, 4 partial, 2 not met)

NOT MET:

Article 17 — No data deletion endpoint implemented

Article 30 — No processing activities register

PARTIAL:

Article 15 — Data export exists but incomplete (missing analytics data)

...

Remediation Plan: 7 items (2 critical, 3 important, 2 improvement)

Estimated total effort: 45 engineering-hours

```


Harness Integration

Success Criteria

Examples

Example: SaaS Application with SOC2 and GDPR Requirements

Phase 1: SCAN
  Frameworks detected:
    - SOC2: docs/compliance/soc2/ directory exists, audit logging in src/audit/
    - GDPR: EU customers present (detected from i18n locales and privacy policy)
    - PCI-DSS: Not applicable (payments via Stripe, card data never touches servers)
  Data stores: PostgreSQL (primary), Redis (cache/sessions), S3 (file uploads)
  Third-party processors: Stripe, SendGrid, Segment, Datadog

Phase 2: CLASSIFY
  Critical: None (no SSN, card data handled by Stripe)
  Sensitive: email, phone, address (users table), IP address (access_logs)
  Internal: order_history, preferences, usage_metrics
  Public: username, display_name, avatar_url
  Cross-border: Primary DB in us-east-1, CDN globally, Segment data to US
  GDPR gap: No SCCs documented for US-based sub-processors

Phase 3: AUDIT
  SOC2: 78% compliant (18/23)
    CC6.3 — PostgreSQL not using column-level encryption for sensitive fields
    CC7.2 — Datadog alerts exist but no security-specific monitors
  GDPR: 65% compliant (11/17)
    Article 17 — DELETE /api/users/:id exists but does not cascade to S3 files or Segment
    Article 30 — No Records of Processing Activities document

Phase 4: REPORT
  Generated: docs/compliance/audit-report-2026-03-27.md
  Remediation plan:
    Critical (week 1-2):
      1. Implement cascading deletion across PostgreSQL, S3, Segment, SendGrid
      2. Create Records of Processing Activities document
    Important (week 3-6):
      3. Add column-level encryption for email, phone, address fields
      4. Create security-specific Datadog monitors for auth failures
      5. Document SCCs for all US-based sub-processors
    Improvement (week 7-12):
      6. Implement data export endpoint including Segment analytics data
      7. Add automated retention enforcement with TTL-based cleanup jobs

Example: Healthcare Platform with HIPAA Requirements

Phase 1: SCAN
  Frameworks detected:
    - HIPAA: patient, diagnosis, prescription models in src/models/
    - SOC2: Required by enterprise customers, docs/compliance/soc2/ present
  Data stores: PostgreSQL (primary), Redis (session cache), AWS S3 (medical records)
  Third-party processors: Twilio (patient notifications), AWS (infrastructure)
  BAA status: AWS BAA signed, Twilio BAA signed

Phase 2: CLASSIFY
  Critical (PHI):
    - patient_records: name, DOB, SSN, diagnosis_code, treatment_plan
    - prescriptions: medication, dosage, prescribing_physician
    - medical_images: stored in S3 bucket 'patient-records-prod'
  Sensitive: provider email, staff credentials, appointment schedules
  PHI field count: 23 fields across 8 tables

Phase 3: AUDIT
  HIPAA Security Rule: 72% compliant
    164.312(a)(1) — Access control exists but no automatic session logoff
    164.312(b) — Audit log captures reads but not all PHI access events
    164.312(c)(1) — No integrity checksums on medical records in S3
    164.312(e)(1) — TLS 1.2 in transit, AES-256 at rest in PostgreSQL and S3
  SOC2: 81% compliant
    All findings overlap with HIPAA gaps

Phase 4: REPORT
  Generated: docs/compliance/hipaa-audit-2026-03-27.md
  Remediation plan:
    Critical (week 1-2):
      1. Add automatic session timeout (15 min idle) for clinical users
      2. Extend audit logging to capture all PHI read events with user context
      3. Add SHA-256 integrity checksums to S3 medical record objects
    Important (week 3-6):
      4. Implement minimum necessary access — restrict PHI queries to treating providers
      5. Add PHI access review report for compliance officer (monthly)
    Improvement (week 7-12):
      6. Implement emergency access ("break the glass") with post-access audit
      7. Add automated HIPAA compliance regression tests to CI pipeline

Rationalizations to Reject

| Rationalization | Reality |

| ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| "We're not in the EU so GDPR doesn't apply to us" | GDPR applies to any organization that processes data of EU residents, regardless of where the organization is based. If a single EU user can sign up, GDPR scope must be assessed. |

| "Our lawyers will handle the compliance questions — just document what we have" | Legal review and technical implementation are distinct. Lawyers cannot attest that Article 17 deletion cascades to S3 and Segment. The technical implementation must be audited separately. |

| "We already did a SOC2 audit last year — this codebase is the same" | SOC2 Type II assesses controls over time. Adding a new data store, third-party processor, or API endpoint can invalidate previous control attestations. Audits are point-in-time snapshots, not permanent certificates. |

| "The audit isn't for three months — we can fix the gaps before then" | Gaps found now require implementation, testing, and evidence collection time. Auditors expect evidence of sustained control operation, not freshly deployed fixes. A gap fixed the week before an audit is still a finding. |

| "That field is technically a username, not PII" | Data classification cannot be done by naming convention. A username combined with any other identifying field (email, IP, phone) is PII under GDPR. Classification must be based on the realistic re-identification risk, not the field name. |

Gates

Escalation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.