Generated banner for Gdpr Compliant
Generated logo for Gdpr Compliant

Gdpr Compliant

GitHubOfficialFirst committed by mikaelkriefDistributed by GitHub

  • Skill
  • Guidelines
  • Security
  • MIT
  • No issues found

From the author

Apply GDPR-compliant engineering practices across your codebase. Use this skill whenever you are designing APIs, writing data models, building authentication flows, implementing logging, handling user data, writing retention/deletion jobs, designing cloud infrastructure, or reviewing pull requests for privacy compliance. Trigger this skill for any task involving personal data, user accounts, cookies, analytics, emails, audit logs, encryption, pseudonymization, anonymization, data exports, breach response, CI/CD pipelines that process real data, or any question framed as "is this GDPR-compliant?". Inspired by CNIL developer guidance and GDPR Articles 5, 25, 32, 33, 35.
— the description by mikaelkrief

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured framework for engineers and architects to integrate GDPR compliance into the software development lifecycle. It covers core principles like data minimization, purpose limitation, and storage limitation, while offering actionable rules for API design, logging, encryption, and password management. It includes checklists for PR reviews and guidance on maintaining a Record of Processing Activities (RoPA) and handling Data Subject Requests (DSRs).

What it does

  • Provides engineering standards for data minimization and purpose limitation.
  • Defines technical requirements for encryption, password hashing, and secrets management.
  • Offers a PR review checklist for privacy compliance in data models and infrastructure.
  • Outlines implementation patterns for user rights like access, rectification, and erasure.
  • Guides the maintenance of a Record of Processing Activities (RoPA).
  • Sets rules for secure logging, error handling, and testing with synthetic data.

When to use it

  • When designing new APIs, data models, or cloud infrastructure.
  • During pull request reviews to ensure privacy compliance.
  • When implementing features that handle personal data, user accounts, or analytics.
  • When setting up retention policies or automated data deletion jobs.
  • When preparing for or responding to Data Subject Requests (DSRs).
  • When evaluating the security of authentication flows and logging practices.

Advantages

  • Reduces legal and compliance risk by embedding privacy-by-design into code.
  • Provides clear, actionable technical rules rather than abstract legal advice.
  • Standardizes security practices across different teams and services.
  • Simplifies the process of maintaining compliance documentation like the RoPA.
  • Promotes data hygiene by enforcing strict retention and minimization.

Usage examples

“Is this API design GDPR-compliant?”
The agent will evaluate the API against rules regarding PII in URLs, authentication requirements, and data minimization, providing specific feedback on identified risks.
“How should I handle user data retention for our new logging service?”
The agent will suggest appropriate retention periods based on the provided guidelines and recommend implementing automated TTL-based deletion.
“Review this PR for GDPR compliance.”
The agent will check the changes against the PR review checklist, flagging issues like hardcoded secrets, missing retention logic, or improper logging of PII.
“What are the requirements for encrypting sensitive user data?”
The agent will detail the required encryption standards, including the use of column-level encryption and KMS-backed key management.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/github/gdpr-compliant/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip gdpr-compliant.zip -d .agents/skills

Documentation by mikaelkrief

GDPR Engineering Skill

Actionable GDPR reference for engineers, architects, DevOps, and tech leads. Inspired by CNIL developer guidance and GDPR Articles 5, 25, 32, 33, 35.

Golden Rule: Collect less. Store less. Expose less. Retain less.

For deep dives, read the reference files in references/:

  • references/data-rights.md — user rights endpoints, DSR workflow, RoPA

  • references/security.md — encryption, hashing, secrets, anonymization

  • references/operations.md — cloud, CI/CD, incident response, architecture patterns


1. Core GDPR Principles (Article 5)

PrincipleEngineering obligation
Lawfulness, fairness, transparencyDocument legal basis for every processing activity in the RoPA
Purpose limitationData collected for purpose A MUST NOT be reused for purpose B without a new legal basis
Data minimizationCollect only fields with a documented business need today
AccuracyProvide update endpoints; propagate corrections to downstream stores
Storage limitationDefine TTL at schema design time — never after
Integrity & confidentialityEncrypt at rest and in transit; restrict and audit access
AccountabilityMaintain evidence of compliance; RoPA ready for DPA inspection at any time

2. Privacy by Design & by Default

MUST

  • Add CreatedAt, RetentionExpiresAt to every table holding personal data at creation time.

  • Default all optional data collection to off. Users opt in; they never opt out of a default-on setting.

  • Conduct a DPIA before building high-risk processing (biometrics, health data, large-scale profiling, systematic monitoring).

  • Update the RoPA with every new feature that introduces a processing activity.

  • Sign a DPA with every sub-processor before data flows to them.

MUST NOT

  • Ship a new data collection feature without a documented legal basis.

  • Enable analytics, tracking, or telemetry by default without explicit consent.

  • Store personal data in a system not listed in the RoPA.


3. Data Minimization

MUST

  • Map every DTO/model field to a concrete business need. Remove undocumented fields.

  • Use separate DTOs for create, read, and update — never reuse the same object.

  • Return only what the caller is authorized to see — use response projections.

  • Mask sensitive values at the edge: return ****1234 for card numbers, never the full value.

  • Exclude sensitive fields (DOB, national ID, health) from default list/search projections.

MUST NOT

  • Log full request/response bodies if they may contain personal data.

  • Include personal data in URL path segments or query parameters (CDN logs, browser history).

  • Collect dateOfBirth, national ID, or health data without an explicit legal basis.


4. Purpose Limitation

MUST

  • Document the purpose of every processing activity in code comments and in the RoPA.

  • Obtain a new legal basis or perform a compatibility analysis before reusing data for a secondary purpose.

MUST NOT

  • Share personal data collected for service delivery with advertising networks without explicit consent.

  • Use support ticket content to train ML models without a separate legal basis and user notice.


5. Storage Limitation & Retention

MUST

  • Every table holding personal data MUST have a defined retention period.

  • Enforce retention automatically via a scheduled job (Hangfire, cron) — never a manual process.

  • Anonymize or delete data when retention expires — never leave expired data silently in production.

Recommended defaults

Data typeMax retention
Auth / audit logs12–24 months
Session / refresh tokens30–90 days
Email / notification logs6 months
Inactive user accounts12 months after last login → notify → delete
Payment recordsAs required by tax law (7–10 years), minimized
Analytics events13 months

SHOULD

  • Add RetentionExpiresAt column — compute at insert time.

  • Use soft-delete (DeletedAt) with a scheduled hard-delete after the erasure request window (30 days).

MUST NOT

  • Retain personal data indefinitely "in case it becomes useful later."


6. API Design Rules

MUST

  • MUST NOT include personal data in URL paths or query parameters.

    • GET /users/{userId}

  • Authenticate all endpoints that return or accept personal data.

  • Extract the acting user's identity from the JWT — never from the request body.

  • Validate ownership on every resource: if (resource.OwnerId != currentUserId) return 403.

  • Use UUIDs or opaque identifiers — never sequential integers as public resource IDs.

SHOULD

  • Rate-limit sensitive endpoints (login, data export, password reset).

  • Set Referrer-Policy: no-referrer and an explicit CORS allowlist.

MUST NOT

  • Return stack traces, internal paths, or database errors in API responses.

  • Use Access-Control-Allow-Origin: * on authenticated APIs.


7. Logging Rules

MUST

  • Anonymize IPs in application logs — mask last octet (IPv4) or last 80 bits (IPv6).

    • 192.168.1.xxx

  • MUST NOT log: passwords, tokens, session IDs, credentials, card numbers, national IDs, health data.

  • MUST NOT log full request/response bodies where PII may be present.

  • Enforce log retention — purge automatically after the defined period.

SHOULD

  • Log events not data: "User {UserId} updated email" not "Email changed from [email protected] to [email protected]".

  • Use structured logging (JSON) with userId as an internal identifier, not the email address.

  • Separate audit logs (sensitive access, admin actions) from application logs — different retention and ACLs.


8. Error Handling

MUST

  • Return generic error messages — never expose stack traces, internal paths, or DB errors.

    • "Column 'email' violates unique constraint on table 'users'"

    • "A user with this email address already exists."

  • Use Problem Details (RFC 7807) for all error responses.

  • Log the full error server-side with a correlation ID; return only the correlation ID to the client.

MUST NOT

  • Include file paths, class names, or line numbers in error responses.

  • Include personal data in error messages (e.g., "User [email protected] not found").


9. Encryption (summary — see references/security.md for full detail)

ScopeMinimum standard
Standard personal dataAES-256 disk/volume encryption
Sensitive data (health, financial, biometric)AES-256 column-level + envelope encryption via KMS
In transitTLS 1.2+ (prefer 1.3); HSTS enforced
KeysHSM-backed KMS; rotate DEKs annually

MUST NOT allow TLS 1.0/1.1, null cipher suites, or hardcoded encryption keys.


10. Password Hashing

MUST

  • Use Argon2id (recommended) or bcrypt (cost ≥ 12). Never MD5, SHA-1, or SHA-256.

  • Use a unique salt per password. Store only the hash.

MUST NOT

  • Log passwords in any form. Transmit passwords in URLs. Store reset tokens in plaintext.


11. Secrets Management

MUST

  • Store all secrets in a KMS: Azure Key Vault, AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault.

  • Use pre-commit hooks (gitleaks, detect-secrets) to prevent secret commits.

  • Rotate secrets on developer offboarding, annual schedule, or suspected compromise.

.gitignore MUST include: .env, .env.*, *.pem, *.key, *.pfx, *.p12, secrets/

MUST NOT

  • Commit secrets to source code. Store secrets as plain-text environment variable defaults.


12. Anonymization & Pseudonymization (summary — see references/security.md)

  • Anonymization = irreversible → falls outside GDPR scope. Use for retained records after erasure.

  • Pseudonymization = reversible with a key → still personal data, reduced risk.

  • When erasing a user, anonymize records that must be retained (financial, audit) rather than deleting them.

  • Store the pseudonymization key in the KMS — never in the same database as the pseudonymized data.

MUST NOT call data "anonymized" if re-identification is possible through linkage attacks.


13. Testing with Fake Data

MUST

  • MUST NOT use production personal data in dev, staging, or CI environments.

  • MUST NOT restore production DB backups to non-production without scrubbing PII first.

  • Use synthetic data generators: Bogus (.NET), Faker (JS/Python/Ruby).

  • Use @example.com for all test email addresses.


14. Anti-Patterns

Anti-patternCorrect approach
PII in URLsOpaque UUIDs as public identifiers
Logging full request bodiesLog structured event metadata only
"Keep forever" schemaTTL defined at design time
Production data in dev/testSynthetic data + scrubbing pipeline
Shared credentials across teamsIndividual accounts + RBAC
Hardcoded secretsKMS + secret manager
Access-Control-Allow-Origin: * on auth APIsExplicit CORS allowlist
Storing consent with profile dataDedicated consent store
PII in GET query paramsPOST body or authenticated session
Sequential integer IDs in public URLsUUIDs
"Anonymized" data with quasi-identifiersApply k-anonymity, test linkage resistance
Mixing backup regions outside EEAExplicit region lockdown on backup jobs

15. PR Review Checklist

Data model
  • Every new PII column has a documented purpose and retention period.

  • Sensitive fields (health, financial, national ID) use column-level encryption.

  • No sequential integer PKs as public-facing identifiers.

API
  • No PII in URL paths or query parameters.

  • All endpoints returning personal data are authenticated.

  • Ownership checks present — user cannot access another user's resource.

  • Rate limiting applied to sensitive endpoints.

Logging
  • No passwords, tokens, or credentials logged.

  • IPs anonymized (last octet masked).

  • No full request/response bodies logged where PII may be present.

Infrastructure
  • No public storage buckets or public-IP databases.

  • New cloud resources tagged with DataClassification.

  • Encryption at rest enabled for new storage resources.

  • New geographic regions for data storage are EEA-compliant or covered by SCCs.

Secrets & CI/CD
  • No secrets in source code or committed config files.

  • New secrets added to KMS and secrets inventory document.

  • CI/CD secrets masked in pipeline logs.

Retention & erasure
  • Retention enforcement job or policy covers new data store or field.

  • Erasure pipeline updated to cover new data store.

User rights & governance
  • Data export endpoint includes any new personal data field.

  • RoPA updated if a new processing activity is introduced.

  • New sub-processors have a signed DPA and a RoPA entry.

  • DPIA triggered if the change involves high-risk processing.


Golden Rule: Collect less. Store less. Expose less. Retain less.

Every byte of personal data you do not collect is a byte you cannot lose, cannot breach, and cannot be held liable for.


Inspired by CNIL developer GDPR guidance, GDPR Articles 5, 25, 32, 33, 35, ENISA, OWASP, and NIST engineering best practices.

Files

references/Security.md

GDPR Reference — Security, Operations & Architecture

Load this file when you need implementation detail on: encryption, password hashing, secrets management, anonymization/pseudonymization, cloud/DevOps practices, CI/CD controls, incident response, architecture patterns.


Encryption

At-Rest Encryption
Data sensitivityMinimum standard
Standard personal data (name, address, email)AES-256 disk/volume encryption (cloud provider default)
Sensitive personal data (health, biometric, financial, national ID)AES-256 column-level encryption + envelope encryption via KMS
Encryption keysHSM-backed KMS (Azure Key Vault Premium / AWS KMS CMK / GCP Cloud KMS)

Envelope encryption pattern:

  1. Encrypt data with a Data Encryption Key (DEK) (AES-256, generated per record or per table).

  2. Encrypt the DEK with a Key Encryption Key (KEK) stored in the KMS.

  3. Store the encrypted DEK alongside the encrypted data.

  4. Deleting the KEK = effective crypto-shredding of all data encrypted with it.

In-Transit Encryption
  • MUST enforce TLS 1.2 minimum; prefer TLS 1.3.

  • MUST set Strict-Transport-Security: max-age=31536000; includeSubDomains; preload.

  • MUST NOT allow TLS 1.0, TLS 1.1, null cipher suites, or export-grade ciphers.

  • MUST NOT use self-signed certificates in production.

Key Management
  • Rotate DEKs annually minimum; rotate immediately upon suspected compromise.

  • Use separate key namespaces per environment (dev / staging / prod).

  • Log all KMS key access events — alert on anomalous access patterns.

  • MUST NOT hardcode encryption keys in source code or configuration files.


Password Hashing

AlgorithmParametersNotes
Argon2id recommendedmemory ≥ 64 MB, iterations ≥ 3, parallelism ≥ 4OWASP and NIST recommended
bcrypt acceptablecost factor ≥ 12Widely supported; use if Argon2id unavailable
scrypt acceptableN=32768, r=8, p=1Good alternative
MD5—Never — trivially broken
SHA-1 / SHA-256—Never for passwords — not designed for this purpose

MUST

  • Use a unique salt per password (built into all three algorithms above).

  • Store only the hash — never the plaintext, never a reversible encoding.

  • Re-hash on login if the stored hash uses an outdated algorithm — upgrade transparently.

SHOULD

  • Add a pepper (server-side secret added before hashing) stored in the KMS, not in the DB.

  • Check passwords against known breach lists at registration (haveibeenpwned API, k-anonymity mode).

  • Enforce minimum password length of 12 characters.

MUST NOT

  • Log passwords in any form — not during registration, not during failed login.

  • Transmit passwords in URLs or query strings.

  • Store password reset tokens in plaintext — hash them before storage.


Secrets Management

MUST

  • Store all secrets in a dedicated secret manager: Azure Key Vault, AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault.

  • Use pre-commit hooks to prevent secret commits: gitleaks, detect-secrets, GitHub native secret scanning.

  • Rotate secrets immediately upon: developer offboarding, suspected compromise, annual schedule.

  • Maintain a secrets inventory document — every secret listed with its purpose and rotation date.

SHOULD

  • Use short-lived credentials via OIDC federation (GitHub Actions → Azure/AWS/GCP) instead of long-lived API keys.

  • Audit all KMS secret access — alert on access outside business hours or from unexpected sources.

  • Use separate secret namespaces per environment.

.gitignore MUST include:

.env
.env.*
*.pem
*.key
*.pfx
*.p12
secrets/
appsettings.*.json   # if it may contain connection strings

MUST NOT

  • Commit secrets to source code repositories.

  • Pass secrets as plain-text CLI arguments (they appear in process lists and shell history).

  • Store secrets as unencrypted environment variable defaults in code.


Anonymization & Pseudonymization

Definitions
TermReversible?GDPR scope?Use case
AnonymizationNoOutside GDPR scopeRetained records after erasure, analytics datasets
PseudonymizationYes (with key)Still personal dataAnalytics pipelines, audit logs, reduced-risk processing
Anonymization Techniques
TechniqueHowWhen
SuppressionRemove the field entirelyFields with no analytical value
MaskingReplace with fixed placeholder ("ANONYMIZED_USER")Audit log identifiers after erasure
GeneralizationReplace exact value with a range (age 34 → "30–40")Analytics
Noise additionAdd statistical noise to numerical valuesAggregate analytics
AggregationReport group statistics, never individual valuesReporting
K-anonymityEnsure each record is indistinguishable from k-1 othersAnalytics datasets
Pseudonymization Techniques
TechniqueHow
HMAC-SHA256 with secret keyConsistent, one-way, keyed. Use for user IDs in analytics. Key in KMS.
TokenizationReplace value with opaque token; mapping in separate secure vault.
Encryption with separate keyDecrypt only with explicit KMS authorization.

MUST

  • When erasing a user, anonymize records that must be retained (financial, audit logs) — replace identifying fields with "ANONYMIZED" or a hashed placeholder.

  • Store the pseudonymization key in the KMS — never in the same database as the pseudonymized data.

  • Test anonymization routines with assertions: the original value MUST NOT be recoverable from the output.

Crypto-shredding pattern (event sourcing): Encrypt personal data in events with a per-user DEK. Store the DEK in the KMS. On erasure: delete the DEK from the KMS → all events for that user are effectively anonymized.

MUST NOT

  • Call data "anonymized" if re-identification is possible through linkage with other datasets.

  • Apply pseudonymization and store the mapping key in the same table as the pseudonymized data.


Cloud & DevOps Practices

MUST

  • Enable encryption at rest for all cloud storage: blobs, managed databases, queues, caches.

  • Use private endpoints — databases MUST NOT be publicly accessible.

  • Apply network security groups / firewall rules: restrict DB access to application layers only.

  • Enable cloud-native audit logging: Azure Monitor / AWS CloudTrail / GCP Cloud Audit Logs.

  • Store personal data only in approved geographic regions (EEA, or adequacy decision / SCCs).

  • Tag all cloud resources processing personal data with a DataClassification tag.

SHOULD

  • Enable Microsoft Defender for Cloud / AWS Security Hub / GCP SCC — review recommendations weekly.

  • Use managed identities (Azure) or IAM roles (AWS/GCP) instead of long-lived access keys.

  • Enable soft delete and versioning on object storage.

  • Apply DLP policies on cloud storage to detect PII written to unprotected buckets.

  • Enable database-level audit logging for SELECT on sensitive tables.

MUST NOT

  • Store personal data in public storage buckets without access controls.

  • Deploy databases with public IPs in production.

  • Use the same cloud account/subscription for production and non-production if data could bleed across.


CI/CD Controls

MUST

  • Run secret scanning on every commit: gitleaks, detect-secrets, GitHub secret scanning.

  • Run dependency vulnerability scanning on every build: npm audit, dotnet list package --vulnerable, trivy, snyk.

  • MUST NOT use real personal data in CI test jobs.

  • MUST NOT log environment variables in CI pipelines — mask all secrets.

SHOULD

  • Run SAST: SonarQube, Semgrep, or CodeQL on every PR.

  • Run container image scanning: trivy, Snyk Container, or AWS ECR scanning.

  • Add a GDPR compliance gate to the pipeline:

    • New migrations without a documented retention period → fail.

    • Log statements containing known PII field names → warn.

Pipeline secret rules:

# MUST: mask secrets before use
- name: Mask secret
  run: echo "::add-mask::${{ secrets.MY_SECRET }}"

# MUST NOT: echo secrets to console
- run: echo "Key=$API_KEY"   # Never

# SHOULD: use OIDC federation (no long-lived keys)
- uses: azure/login@v1
  with:
    client-id: ${{ vars.AZURE_CLIENT_ID }}
    tenant-id: ${{ vars.AZURE_TENANT_ID }}
    subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}

Incident & Breach Handling

Regulatory Timeline
WindowObligation
72 hours from awarenessNotify the supervisory authority (CNIL, APD, ICO…) — unless breach is unlikely to risk individuals
Without undue delayNotify affected data subjects if breach is likely to result in high risk to their rights

Log all personal data breaches internally — even those that do not require DPA notification.

Breach Response Runbook (template)
  1. Detection — Define criteria: what triggers an incident (credential leak, DB dump exposed, ransomware, accidental public bucket).

  2. Severity classification — Low / Medium / High / Critical based on data sensitivity and volume.

  3. Containment — Revoke compromised credentials; isolate affected systems; preserve evidence (do NOT delete logs).

  4. Assessment — What data was exposed? How many subjects? What is the risk level?

  5. DPA notification — Use the supervisory authority's online portal; include: nature of breach, categories and approximate number of data subjects, categories and approximate number of records, contact point, likely consequences, measures taken.

  6. Data subject notification — If high risk: clear language, nature of breach, likely consequences, measures taken, DPO contact.

  7. Post-incident review — Root cause analysis; corrective measures; update runbook.

Automated Breach Detection Alerts

Configure alerts for:

  • Unusual volume of data exports (threshold per hour)

  • Access to sensitive tables outside business hours

  • Bulk deletion events

  • Failed authentication spikes

  • New credentials appearing in public breach databases (HaveIBeenPwned monitoring)

Store breach records internally for at least 5 years.


Architecture Patterns

Data Store Separation

Separate operational data (transactional DB) from analytical data (data warehouse). Apply different retention periods and access controls to each. The analytics store MUST NOT read directly from production operational tables.

Track consent as an immutable event log in a separate store, not a boolean column on the user table. This enables: auditable consent history, version tracking, easy withdrawal without data loss.

Audit Log Segregation

Store audit logs in a separate, append-only store. The application service account MUST NOT be able to delete audit log entries. Use a separate DB user with INSERT-only rights on the audit table.

DSR Queue Pattern

Implement Data Subject Requests as an asynchronous workflow: POST /api/v1/me/erasure-request → enqueue a job → worker scrubs all stores → notify user on completion. This handles the complexity of multi-store scrubbing reliably and provides a retry mechanism.

Pseudonymization Gateway

For analytics pipelines, implement a pseudonymization service at the boundary between operational and analytical systems. The mapping key (HMAC secret or tokenization vault) never leaves the operational zone. The analytics zone receives only pseudonymized identifiers.

Crypto-Shredding (Event Sourcing)

Encrypt personal data in events with a per-user DEK stored in the KMS. On user erasure: delete the DEK → all historical events for that user are effectively anonymized without modifying the event log.

Requirements and compatibility

Written for: GitHub Copilot

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

First committed by
GitHub avatar of mikaelkriefmikaelkrief
Publisher
GitHub (Official)
Distributed by
GitHub
Source
github/awesome-copilot · skills/gdpr-compliant · commit 797337f
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
mikaelkrief

AutoGineer is not affiliated with or endorsed by mikaelkrief or GitHub.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download gdpr-compliant.zip