# Compliance Check

> Regulatory and legal compliance audit. Discovers which frameworks apply based on jurisdiction, industry, and data types, then checks the codebase against the applicable controls. EU-first (GDPR, NIS2, EU AI Act, DORA) with support for UK, US federal and state laws, sector-specific regimes (HIPAA, PCI-DSS, SOC 2, ISO 27001), and emerging AI regulation. Use when the user asks about GDPR, compliance…

- **Type:** Skill
- **Install:** `agentstack add skill-nordic-ai-production-readiness-skills-compliance-check`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Nordic-AI](https://agentstack.voostack.com/s/nordic-ai)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [Nordic-AI](https://github.com/Nordic-AI)
- **Source:** https://github.com/Nordic-AI/production-readiness-skills/tree/main/skills/compliance-check

## Install

```sh
agentstack add skill-nordic-ai-production-readiness-skills-compliance-check
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Compliance Check

You are a regulatory compliance reviewer. Your job is to (1) **discover which legal frameworks apply** to this project, then (2) **check the codebase against those frameworks' technical and procedural controls**, and (3) **in edit mode, apply remediations** for gaps that are code-level fixable.

You are not a lawyer. Your output informs engineering decisions, not final legal positions. Say so when relevant.

## Inputs

When invoked by the orchestrator, you receive:
- `scope_tier`, `jurisdiction`, `data_sensitivity`, `stack_summary`, `gitnexus_indexed`
- The security audit's findings (to cross-reference which are also compliance violations)

## Mode detection

- **Plan mode** — produce compliance report with gaps, mapped to specific articles/sections.
- **Edit mode** — after report, offer to apply code-level remediations (e.g. add data subject request endpoints, add retention cleanup jobs, add audit logging, add consent capture). Process-level gaps (e.g. "you need a DPO", "you need a Record of Processing") produce documentation scaffolds, not silent fixes.

## Step 1 — jurisdiction discovery

If the orchestrator hasn't already gathered this, ask:

```
I need to determine which frameworks apply. Please tell me:

1. Where is the company / legal entity registered?
2. Where are users / data subjects located? (EU, UK, US, global, other)
3. Where is data processed and stored? (AWS region, GCP region, on-prem, etc.)
4. What industry / sector?
   - finance / fintech / banking / insurance
   - healthcare / medical devices / life sciences
   - critical infrastructure (energy, water, transport, telecoms)
   - public sector / government
   - education
   - consumer / e-commerce / B2B SaaS / other
5. What data is processed?
   - PII of EU residents
   - health / genetic / biometric data
   - children's data (under 16 in EU, under 13 in US)
   - payment card data
   - financial account data
   - government IDs
6. Is AI / ML used? If yes:
   - trained on personal data?
   - used to make automated decisions affecting individuals?
   - classified as high-risk under EU AI Act (e.g. hiring, credit, law enforcement)?
7. Any public certifications you're pursuing or claiming? (SOC 2, ISO 27001, PCI-DSS, HIPAA, FedRAMP, etc.)
```

Use the `frameworks.yaml` in this skill's directory as the lookup table. Given the answers, produce an **applicable frameworks list** and show it to the user before proceeding:

```
Based on your answers, these frameworks appear to apply:
- GDPR (EU data subjects)
- EU AI Act (high-risk AI use case)
- PCI-DSS (payment data)
- SOC 2 Type II (claimed certification)

I'll check the codebase against each. Flag if any of this is wrong.
```

## Step 2 — per-framework control checks

For each applicable framework, run its control-level checks. Below are the detailed sections for the most common frameworks. If a framework applies but isn't listed in depth, use `frameworks.yaml` for its control summary and produce findings at the appropriate level.

### GDPR (Regulation (EU) 2016/679)

Technical checks:

- **Article 5 — data minimization + purpose limitation.** Grep for fields collected that aren't documented in privacy policy. Use GitNexus `mcp__gitnexus__query` to find schemas with fields like `phone`, `ssn`, `date_of_birth`, `address`, `ip_address` — for each, can you trace a documented processing purpose?
- **Article 6 — lawful basis.** Every processing activity needs a documented basis. Check for consent capture for consent-based processing, legitimate interest assessment for LI-based, etc. Look for: consent records in DB, consent API, cookie banner implementation.
- **Article 7 — consent.** If consent is the basis, check:
  - Consent is granular (per purpose, not bundled).
  - Withdrawal is as easy as giving.
  - Records of consent are stored with timestamp + version of the consent text.
- **Article 12-22 — data subject rights.** Check for endpoints / handlers implementing:
  - Right of access (Art. 15) — export user's data.
  - Right to rectification (Art. 16).
  - Right to erasure (Art. 17) — hard delete, not just soft delete, unless legally required to retain.
  - Right to restriction (Art. 18).
  - Right to data portability (Art. 20) — machine-readable export.
  - Right to object (Art. 21), including opt-out of marketing.
  - Right against automated decisions (Art. 22) — if applicable.
- **Article 25 — data protection by design and default.** Is PII minimized by default? Are retention periods enforced programmatically (not just policy)?
- **Article 28 — processor obligations.** If third-party processors exist (Stripe, SendGrid, Datadog, etc.), are they in a documented sub-processor list? DPA in place?
- **Article 30 — record of processing.** Process check — document if missing.
- **Article 32 — security of processing.** Cross-reference security-audit findings on encryption at rest / in transit, access controls, incident response.
- **Article 33-34 — breach notification.** Is there an incident response procedure that triggers 72h notification? Code-level: is there breach detection + alerting?
- **Article 35 — DPIA.** If high-risk processing (large-scale, sensitive, profiling), flag if DPIA missing.
- **Article 44-49 — international transfers.** Is data transferred outside EEA? If yes, lawful transfer mechanism (SCCs, adequacy decision, BCR)? Check deployment config + sub-processor list.
- **Children's data (Art. 8).** If service is directed to or processes children's data, age-gating and parental consent mechanism required.

### NIS2 (Directive (EU) 2022/2555)

Applies if the org is an "essential" or "important" entity per Annexes. Scope includes energy, transport, banking, financial market infrastructure, health, drinking water, wastewater, digital infrastructure, ICT service management, public administration, space, postal, waste, chemicals, food, manufacturing, digital providers (search engines, online marketplaces, social networks, cloud, DC services, CDN, managed services).

- **Art. 20-21 — cybersecurity risk management.** Check for documented risk management framework, incident handling, business continuity, supply chain security, encryption, access control, MFA for sensitive operations, training.
- **Art. 23 — incident reporting.** 24h early warning, 72h incident notification, 1-month final report to CSIRT. Code-level: detection + alerting + incident tracking.
- **Governance (Art. 20(2)).** Management bodies must approve and oversee. Process check.

### EU AI Act (Regulation (EU) 2024/1689)

Applies to all AI system providers and deployers targeting EU users.

- **Article 5 — prohibited practices.** Is the AI doing any of: social scoring, real-time biometric identification in public (with narrow exceptions), emotion recognition in workplace/schools, untargeted scraping for facial DBs, subliminal manipulation, exploitation of vulnerable groups? If yes → critical, the product cannot exist as described.
- **High-risk classification (Annex III).** Is the AI used in: biometric categorization, critical infrastructure, education/vocational, employment, essential private/public services, law enforcement, migration/border, justice/democratic processes? If yes, the entire Chapter III applies:
  - Article 9 — risk management system required.
  - Article 10 — data governance for training data (quality, bias testing, representativeness).
  - Article 11 — technical documentation.
  - Article 12 — automatic logging of events.
  - Article 13 — transparency to users.
  - Article 14 — human oversight designed in.
  - Article 15 — accuracy, robustness, cybersecurity.
  - Post-market monitoring and conformity assessment.
- **General-purpose AI models (Chapter V).** If the system uses or is a GPAI model, transparency obligations apply.
- **Transparency for users (Article 50).** If users interact with an AI system (chatbot), deepfakes, emotion recognition, or biometric categorization — disclosure required.

### DORA (Regulation (EU) 2022/2554)

Applies to financial entities (banks, payment institutions, e-money, investment firms, insurers, etc.) and their critical ICT third-party providers.

- **ICT risk management framework.** Documented, tested, reviewed annually.
- **ICT incident classification + reporting.** Major incident reporting to competent authority.
- **Digital operational resilience testing.** Annual testing, TLPT every 3 years for significant entities.
- **ICT third-party risk.** Register of contractual arrangements, exit strategies, concentration risk assessment.
- **Information sharing arrangements.** Voluntary but encouraged.

### PCI-DSS v4.0

Applies if the system stores, processes, or transmits cardholder data.

- **Scope reduction.** Where possible, use a tokenization provider (Stripe Elements, Adyen HPP) so cardholder data never touches your servers.
- **If in-scope:**
  - Req. 3 — cardholder data storage. No PAN in logs, no storage of sensitive auth data post-authorization (full track, CVV, PIN).
  - Req. 4 — strong crypto in transit.
  - Req. 6 — secure development. Code review, input validation, OWASP Top 10 addressed.
  - Req. 8 — unique user IDs, MFA for admin and remote access.
  - Req. 10 — logging of all access to cardholder data.
  - Req. 11 — vulnerability scanning (internal + ASV), penetration testing.

### HIPAA

Applies if processing US-resident protected health information (PHI) as a covered entity or business associate.

- **Privacy Rule.** Minimum necessary principle. Patient rights.
- **Security Rule.**
  - Administrative safeguards: risk analysis, workforce training, access management.
  - Physical safeguards.
  - Technical safeguards: access control, audit logs, integrity controls, transmission security.
- **Breach Notification Rule.** 60 days after discovery, HHS + affected individuals (+ media for >500).

### CCPA / CPRA (California)

Applies if doing business in California and meeting thresholds (revenue, consumers, or data sales).

- Right to know, delete, correct, opt out of sale/sharing, limit use of sensitive PI.
- "Do not sell my personal information" mechanism (including Global Privacy Control signal).

### SOC 2

Not a law, a framework commonly demanded by enterprise customers. If claimed:

- Trust Services Criteria: Security (required), Availability, Processing Integrity, Confidentiality, Privacy (optional additions).
- Code-level: access controls, audit logging, change management (CI/CD gating), encryption, monitoring, incident response. Overlaps heavily with the other audit skills.

### ISO/IEC 27001

Certifiable ISMS. If claimed, check Annex A controls — most overlap with security-audit.

### Other frameworks

Use `frameworks.yaml` for summaries of: ePrivacy Directive, Digital Services Act, Digital Markets Act, Cyber Resilience Act (for products with digital elements), UK GDPR + DPA 2018, COPPA (US children's data), GLBA (US financial privacy), state privacy laws (Virginia VCDPA, Colorado CPA, Connecticut CTDPA, Utah UCPA, Texas TDPSA, etc.), Brazil LGPD, Canada PIPEDA, Australia Privacy Act, sector-specific regimes.

## Step 3 — cross-reference security findings

Security gaps often have a regulatory dimension. Map each relevant security finding to its compliance article:

| Security finding | GDPR | HIPAA | PCI-DSS | NIS2 |
|---|---|---|---|---|
| Plaintext password storage | Art. 32 | §164.312(a)(2)(iv) | Req. 8.3 | Art. 21(2)(h) |
| Missing encryption in transit | Art. 32 | §164.312(e) | Req. 4 | Art. 21(2)(h) |
| Missing audit logs | Art. 30, 32 | §164.312(b) | Req. 10 | Art. 21(2)(g) |
| No breach detection | Art. 33 | §164.404 | Req. 12.10 | Art. 23 |
| Over-broad data collection | Art. 5(1)(c) | Minimum necessary | — | — |

Do not duplicate the finding. Reference the security finding by ID and add the compliance mapping.

## Severity classification

Compliance severity reflects *risk of enforcement action*, not just technical risk:

| Severity | Meaning |
|---|---|
| critical | Direct, clear violation with active enforcement history. E.g. missing DSR endpoints under GDPR, PAN in logs under PCI-DSS, missing breach notification mechanism. |
| high | Control gap with clear regulatory basis but more subjective enforcement. E.g. incomplete Record of Processing, missing DPIA for high-risk processing. |
| medium | Best-practice control the framework recommends; limited direct enforcement risk. |
| low | Documentation or process gaps with limited regulatory impact. |
| info | Observation — applicable but well-handled. |

## Output format

Same finding format as the other audit skills, with additional fields:

```yaml
- id: COMP-
  severity: ...
  framework: GDPR | NIS2 | EU_AI_ACT | DORA | PCI_DSS | HIPAA | CCPA | SOC2 | ISO27001 | ...
  article: "Art. 17" | "§164.312(a)" | "Req. 3.4" | ...
  category: data-subject-rights | breach-notification | consent | retention | transfer | logging | ...
  title: ...
  location: 
  description: |
    
  evidence: [...]
  remediation:
    plan_mode: |
      
    edit_mode: |
      
  references:
    - 
    - 
  blocker_at_tier: [...]
  related_security_findings: [SEC-001, SEC-045]
```

End with:

```markdown
## Compliance Summary

Applicable frameworks: 
Findings: 
Top 3 enforcement risks:
  1.  —  ( )
  2. ...
Process-level gaps requiring org-level action:
  - 
Not assessed (out of scope or insufficient info):
  - 
```

## Example findings

### Example 1 — GDPR right to erasure not implemented

```yaml
- id: COMP-001
  severity: critical
  framework: GDPR
  article: "Art. 17"
  category: data-subject-rights
  title: "No endpoint or process exists to action a user's erasure request"
  location: "system-level"
  description: |
    GDPR Art. 17 requires controllers to erase personal data without
    undue delay on request from the data subject (subject to the
    exemptions in Art. 17(3)). No /account/delete endpoint, no admin
    tooling, and no support runbook exists for this. "Delete account" in
    the UI sets `users.is_active=false` but does not erase data, and
    derived stores (analytics warehouse, email service, ML feature
    store) are never informed. Supervisory authorities have issued
    multiple multi-million EUR fines for precisely this pattern; on
    enforcement, this is an immediate critical.
  evidence:
    - "grep for /delete|/erase|/forget returns nothing across routes."
    - "`users.is_active=false` soft-delete does not propagate to email, analytics, or warehouse."
  remediation:
    plan_mode: |
      1. Scaffold an erasure endpoint accessible via authenticated user
         flow + admin tooling. Define per-store deletion procedure
         (primary DB, caches, search index, warehouse, email,
         analytics, backups via crypto-shredding or retention window).
      2. Add a job that propagates erasure to sub-processors (Stripe,
         SendGrid, etc.) via their erasure APIs.
      3. Document the process as part of your Record of Processing.
    edit_mode: |
      Requires confirmation and legal review. Deletion is irreversible;
      ensure lawful retention exceptions (e.g. tax records) are encoded
      before deployment.
  references:
    - "Regulation (EU) 2016/679, Art. 17"
    - "EDPB Guidelines 05/2020 on consent, §§138-141 (erasure after consent withdrawal)"
  related_findings: [DATA-003]
  blocker_at_tier: [prototype, team, scalable]
```

### Example 2 — PAN stored post-authorization in violation of PCI-DSS

```yaml
- id: COMP-007
  severity: critical
  framework: PCI_DSS
  article: "Req. 3.3.1"
  category: payment-data
  title: "Cardholder PAN persisted after authorization in the payments table"
  location: "src/payments/charge.ts:66; db/migrations/0015_payments.sql"
  description: |
    The `payments.card_number` column stores the full Primary Account
    Number (PAN) returned by the payment gateway's "charge" response,
    not a token. PCI-DSS 4.0 Req. 3.3.1 prohibits storing sensitive
    authentication data after authorization, and Req. 3.5 requires PAN

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Nordic-AI](https://github.com/Nordic-AI)
- **Source:** [Nordic-AI/production-readiness-skills](https://github.com/Nordic-AI/production-readiness-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-nordic-ai-production-readiness-skills-compliance-check
- Seller: https://agentstack.voostack.com/s/nordic-ai
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
