Compliance Copilot

Give your AI coding assistant a compliance officer.

A complete, open-source skill pack for AI coding CLIs that adds built-in regulatory compliance capabilities — covering GDPR (EU), HIPAA (US healthcare), DPDP (India), CCPA/CPRA (California), and PCI-DSS (payments).

License: MIT Agent Skills Frameworks MCP Server npm

⚠️ Legal disclaimer: This is a developer productivity tool. It flags code patterns for human review. It does not certify compliance, does not constitute legal advice, and does not replace a qualified Data Protection Officer, privacy attorney, HIPAA compliance officer, or QSA. Always engage qualified professionals before making compliance decisions.


What it does

Two capabilities, not one:

Explain — Ask plain-language questions. Get answers with specific law citations:

"Do I need consent for analytics under DPDP?"
"What's the penalty for storing CVV under PCI DSS?"
"Draft me a GDPR Data Processing Agreement"

Scan — Point it at your codebase. Get findings with file:line specificity:

🔴 [PCIDSS-002] src/routes/payments.ts:17 — PCI DSS v4.0.1 Req 3.2.1
   CVV/CVC storage found — ABSOLUTELY PROHIBITED post-authorization.
   Remediation: Delete this field. No exceptions. Not even encrypted storage.

🔴 [HIPAA-001] src/models/user.ts:22 — 45 CFR § 164.312(a)(2)(iv)
   PHI field (diagnosis) stored without encryption.
   Remediation: Encrypt with AES-256. Use column-level encryption or KMS.

🟠 [GDPR-002] src/routes/users.ts:22 — GDPR Art. 32(1)(b), Art. 5(1)(f)
   Email address logged to console in production code.
   Remediation: Remove email from log. Use: console.log('User action', { userId })

The scanner actually runs against your source files — not a generic checklist.


Frameworks Covered

Framework Scope Version
GDPR EU/EEA personal data Regulation (EU) 2016/679
HIPAA US healthcare (PHI/ePHI) 45 CFR Parts 160, 164
DPDP India digital personal data DPDP Act 2023 + Rules 2025 (full enforcement: May 2027)
CCPA/CPRA California consumers Cal. Civ. Code § 1798.100 et seq., CPRA (2023)
PCI-DSS Payment card data PCI DSS v4.0.1 (June 2024)

Quick Start — 30 seconds

Claude Code (and all Agent Skills-compatible tools)

# Install a specific framework skill
cp -r skills/gdpr ~/.claude/skills/gdpr-compliance-copilot
cp -r skills/hipaa ~/.claude/skills/hipaa-compliance-copilot
cp -r skills/dpdp ~/.claude/skills/dpdp-compliance-copilot
cp -r skills/ccpa ~/.claude/skills/ccpa-compliance-copilot
cp -r skills/pci-dss ~/.claude/skills/pci-dss-compliance-copilot

# Install all frameworks at once
for skill in gdpr hipaa dpdp ccpa pci-dss; do
  cp -r skills/$skill ~/.claude/skills/${skill}-compliance-copilot
done

Skills activate automatically when relevant. No slash command needed.

Cursor, Windsurf, Gemini CLI, GitHub Copilot

These tools support the same Agent Skills open standard:

# Cursor
cp -r skills/gdpr ~/.cursor/skills/gdpr-compliance-copilot

# GitHub Copilot
cp -r skills/gdpr ~/.config/github-copilot/skills/gdpr-compliance-copilot

# Windsurf
cp -r skills/gdpr ~/.windsurf/skills/gdpr-compliance-copilot

MCP Server (Work in Progress) {#mcp-server-work-in-progress}

🚧 The MCP server and npm package are not yet published. The code lives in mcp-server/ and is ready for local use, but compliance-copilot-mcp is not on npm yet. Instructions below are what the install experience will look like once it is published. Track progress in #mcp-publish or watch this repo for the release.

Future install (once published to npm):

# Will work once published — not yet available
npx compliance-copilot-mcp

Use locally right now (clone the repo and run from source):

git clone https://github.com/YOUR_ORG/compliance-copilot
cd compliance-copilot/mcp-server
npm install
npm run build

# Then point your MCP config at the local build:
{
  "mcpServers": {
    "compliance-copilot": {
      "command": "node",
      "args": ["/path/to/compliance-copilot/mcp-server/dist/index.js"],
      "disabled": false
    }
  }
}

OpenCode

🚧 OpenCode MCP integration also depends on the npm package being published. Use the local build path above in the meantime.

{
  "mcp": {
    "compliance-copilot": {
      "type": "local",
      "command": ["node", "/path/to/compliance-copilot/mcp-server/dist/index.js"]
    }
  }
}

MCP Server (any MCP-compatible client)

The MCP server enables the code scanning tools in any MCP-compatible AI client:

# Run directly (no install needed)
npx compliance-copilot-mcp

# Or install globally
npm install -g compliance-copilot-mcp

Add to your .mcp.json / claude_desktop_config.json:

{
  "mcpServers": {
    "compliance-copilot": {
      "command": "npx",
      "args": ["compliance-copilot-mcp"],
      "disabled": false
    }
  }
}

OpenCode

Add to your opencode.json:

{
  "mcp": {
    "compliance-copilot": {
      "type": "local",
      "command": ["npx", "compliance-copilot-mcp"]
    }
  }
}

Scan Example — Before and After

Running a scan

🚧 The MCP server is not yet published to npm — see MCP Server (Work in Progress) for local setup. Once configured, ask your AI agent:

"Scan my src/ directory for GDPR and HIPAA compliance issues"

Or call the MCP tool directly:

scan_path({ path: "./src", frameworks: ["gdpr", "hipaa"] })

Real scan output (from our sample app)

This output was generated by running the scanner against examples/sample-vulnerable-app/ — a small intentionally-vulnerable Express app with planted compliance gaps:

🔴 CRITICAL [PCIDSS-001] src/routes/payments.ts:16 — PCI DSS v4.0.1 Req 3.4.1
   Field storing full PAN (card_number) without tokenization/encryption.
   Remediation: Never store full PANs. Use tokenization service.

🔴 CRITICAL [PCIDSS-002] src/routes/payments.ts:17 — PCI DSS v4.0.1 Req 3.2.1  
   CVV/CVC storage — ABSOLUTELY PROHIBITED post-authorization. No exceptions.
   Remediation: DELETE this field. Even encrypted CVV storage violates PCI DSS.

🔴 CRITICAL [HIPAA-001] src/models/user.ts:22 — 45 CFR § 164.312(a)(2)(iv)
   PHI field 'diagnosis' stored without encryption indicator.
   Remediation: Encrypt PHI with AES-256. Use column-level encryption or KMS.

🔴 CRITICAL [HIPAA-002] src/routes/users.ts:22 — 45 CFR § 164.312(b)
   PHI (diagnosis) logged to console.log — impermissible disclosure.
   Remediation: Remove PHI from logs. Log only patient_id.

🟠 HIGH [HIPAA-003] src/middleware/auth.ts:8 — 45 CFR § 164.312(a)(2)(i)
   Shared credential 'admin' — violates unique user identification requirement.
   Remediation: Eliminate shared accounts. Every user needs a unique identifier.

🟠 HIGH [GDPR-001] src/models/user.ts:13 — GDPR Art. 32(1)(a)
   Personal data field 'email' stored without encryption indicator.
   Remediation: Encrypt personal data fields at rest using AES-256.

Full report: examples/sample-scan-output.md


What Each Framework Skill Does

GDPR

  • Answers questions about lawful basis, consent, data subject rights (Arts. 15–22), breach notification (72-hour rule, Art. 33), DPIAs (Art. 35), and cross-border transfers
  • Scans for: unencrypted PII fields, PII in logs, missing DELETE endpoints, missing data export, analytics without consent, HTTP transmission, missing retention policy
  • Generates: DPAs (Art. 28), privacy notice clauses (Art. 13/14), breach notifications (Art. 33), RoPAs (Art. 30), DPIAs (Art. 35)

HIPAA

  • Answers questions about covered entity vs. business associate determination, PHI identifiers, Security Rule safeguards (Required vs. Addressable), breach notification (60-day rule), BAA requirements
  • Scans for: PHI fields unencrypted, PHI in logs, shared accounts (unique user ID violation), missing session timeout, ePHI over HTTP, missing audit logging
  • Generates: BAA templates (45 CFR § 164.504(e)), NPPs, Risk Analysis templates (§ 164.308(a)(1))

DPDP (India)

  • Answers questions about India's 2-lawful-basis model (no legitimate interests!), Section 9 children's data (age threshold: 18), breach notification to DPBI (72 hours for ALL breaches), cross-border transfers (blacklist approach), SDF obligations
  • Scans for: missing standalone consent notice, no age/minor check, behavioral tracking without age gate, no consent withdrawal, no breach notification workflow, Indian-specific PII unencrypted (Aadhaar, PAN card, voter ID)
  • Compliance deadline: May 13, 2027

CCPA/CPRA

  • Answers questions about business thresholds, consumer rights (access, delete, correct, opt-out, limit SPI), GPC signal requirements, sale vs. sharing distinction (ad networks = sharing), Sensitive Personal Information (SPI) rights
  • Scans for: no GPC signal handling, no "Do Not Sell or Share" link, behavioral ads without opt-out, missing deletion propagation, SPI without access controls, no at-collection notice
  • Key CPRA changes (Jan 2023): GPC signals mandatory, right to correct, right to limit SPI, CPPA enforcement

PCI-DSS

  • Answers questions about CDE scoping, SAQ type selection, tokenization vs. encryption, v4.0 new requirements (MFA for ALL CDE access, payment page script integrity), SAQ types
  • Scans for: PAN stored unencrypted, CVV storage (always critical), PAN in logs, unmasked PAN in UI, HTTP for payment endpoints, deprecated TLS (1.0/1.1), missing MFA for CDE, missing SRI on payment page scripts
  • Current version: PCI DSS v4.0.1 — all new requirements mandatory since March 31, 2025

MCP Tools Reference

🚧 Not yet published to npm. The MCP server code is complete in mcp-server/ and can be run locally. These are the tools it exposes — available now via local build, and via npx once published.

When the MCP server is running, these tools are available to your AI agent:

Tool What it does
scan_path Scan a file or directory — returns file:line findings
explain_obligation Look up a specific rule ID or compliance topic
list_frameworks See all available rules across frameworks
generate_artifact Generate a compliance document template
# Generate a GDPR Data Processing Agreement
generate_artifact({ artifact: "dpa_template", context: "SaaS analytics platform processing EU user data" })

# Generate a HIPAA Business Associate Agreement  
generate_artifact({ artifact: "baa_template" })

# Generate a breach notification
generate_artifact({ artifact: "breach_notification" })

Repository Structure

compliance-copilot/
├── README.md
├── LICENSE                     MIT license
├── PROGRESS.md                 Build log
├── docs/
│   ├── architecture-decision.md  Why SKILL.md + MCP server
│   └── capability-model.md       Scanner interface spec
├── research/
│   ├── gdpr.md                 Legal research with citations (1,400+ words)
│   ├── dpdp.md                 DPDP Act 2023 + Rules 2025
│   ├── ccpa.md                 CCPA + CPRA (Jan 2023)
│   ├── hipaa.md                45 CFR Parts 160, 164
│   └── pci-dss.md              PCI DSS v4.0.1
├── skills/
│   ├── gdpr/
│   │   ├── SKILL.md            Agent Skills skill file
│   │   ├── checklist.md        Compliance checklist
│   │   ├── scan-rules.json     8 GDPR scan rules
│   │   └── templates/          DPA, breach notification, RoPA
│   ├── hipaa/   (same structure)
│   ├── dpdp/    (same structure)
│   ├── ccpa/    (same structure)
│   └── pci-dss/ (same structure)
├── core/
│   └── scanner/                Shared scanning engine (TypeScript)
│       ├── index.ts            Public API: scan() → ScanReport
│       ├── file-walker.ts      Async directory traversal
│       ├── rule-loader.ts      Loads scan-rules.json files
│       ├── pattern-matcher.ts  Applies rules to files
│       ├── report-formatter.ts Builds Markdown/JSON output
│       └── types.ts            Shared TypeScript interfaces
├── mcp-server/
│   └── index.ts                MCP server — code complete, npm publish pending 🚧
└── examples/
    ├── sample-vulnerable-app/  Intentionally-vulnerable Express app for testing
    └── sample-scan-output.md   Real scanner output against the sample app

Adding a New Framework (Contribution Guide)

This repo is designed to be community-extensible. To add a new compliance framework (SOC 2, ISO 27001, LGPD, etc.):

  1. Research the framework — Read primary sources. Cite act sections, not blog posts.

  2. Create the skill directory:

mkdir skills/my-framework
  1. Create skills/my-framework/SKILL.md following the Agent Skills spec:
---
name: my-framework-compliance-copilot
description: [What the skill does and when to activate — this is the trigger text]
license: MIT
metadata:
  version: "1.0.0"
  last_verified: "YYYY-MM-DD"
  law_version: "[Official law name and version]"
---
  1. Create skills/my-framework/scan-rules.json with at least 3 rules:
{
  "framework": "my-framework",
  "version": "1.0.0",
  "rules": [
    {
      "id": "MF-001",
      "name": "rule-name",
      "severity": "high",
      "type": "line_match",
      "obligation": "Framework Section X — Obligation Name",
      "citation": "Framework § X.Y",
      "description": "What the violation is and why it matters",
      "remediation": "How to fix it — with code example",
      "patterns": ["regex_pattern_to_match"],
      "negative_patterns": ["patterns_that_suppress_false_positives"]
    }
  ]
}
  1. Create skills/my-framework/checklist.md — compliance checklist

  2. Update research/<framework>.md — legal research with citations

  3. Open a PR — include: framework name, official source URLs, enforcement date, and at least 1 test finding against the sample app or a new sample file

Quality bar for PRs:

  • Every legal claim must cite a specific law section or official regulator guidance URL
  • No "TODO" or placeholder content
  • Each rule must have at least one negative_pattern to prevent obvious false positives
  • scan-rules.json must produce ≥3 findings when run against the sample-vulnerable-app

Security and Privacy of the Scanner Itself

  • The scanner reads files locally — no data is sent to any external service
  • Rule evaluation is purely local regex/pattern matching
  • When using the MCP server with an AI agent: the AI model sees file snippets (the snippet field in findings) to provide remediation guidance — these snippets may contain code. Do not run the scanner against repositories containing real credentials, keys, or production secrets
  • The MCP server does not persist any data between calls

Legal Research Freshness

Laws change. Each research file in /research/ includes a "Last verified" date. Before relying on any obligation for a real compliance decision:

  1. Check the date in the research file
  2. Verify against the current official text (links are in each research file)
  3. Consult qualified legal counsel
Framework Last Verified Key Caveat
GDPR June 21, 2026 EU-US Data Privacy Framework validity — verify current status
HIPAA June 21, 2026 HHS tracking pixel enforcement guidance evolving
DPDP June 21, 2026 No SDFs designated yet; no restricted transfer countries yet — check meity.gov.in
CCPA/CPRA June 21, 2026 CPPA rulemaking ongoing — automated decision-making regulations pending
PCI-DSS June 21, 2026 PCI DSS v4.0.1 current; v4.1 may be in development — check pcisecuritystandards.org

Related Projects

Compliance Copilot's unique value vs. existing repos: We add a working code scanner that produces file:line specific findings with legal citations — what no existing compliance skill repo currently does.


Contributing

Issues and PRs welcome. Please see the contribution guide above for adding new frameworks.

For bug reports on existing rules (wrong citation, false positive, wrong severity): open an issue with the rule ID, the code that triggered it, and the correct behavior.

We especially welcome:

  • New framework additions (SOC 2, ISO 27001, LGPD, PDPA Singapore, Australia Privacy Act)
  • Improvements to false-positive reduction in existing rules
  • Test cases for the sample-vulnerable-app
  • Translation of research docs

MIT License — See LICENSE