mukul975/privacy-data-protection-skills

building-purpose-limitation-enforcement

- Technical enforcement of GDPR Article 5(1)(b) purpose limitation principle.

Ver código-fonte

Como usar

  1. Copie o comando e verifique o pacote antes de instalar no seu ambiente de agente.
  2. Consulte no original as ferramentas, credenciais e ambientes necessários.
  3. Descreva os dados de entrada e a entrega esperada; confira a saída com as fontes.
npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill building-purpose-limitation-enforcement

Antes de começar

  • A instalação não inclui assinatura de modelo, franquia API ou acesso aos seus arquivos.
  • Estrelas e instalações indicam atividade, não um teste independente de qualidade ou segurança.
Documento original do Skill

Renderizado do repositório de origem, preservando títulos, exemplos, código, tabelas, links e imagens.

Building Purpose Limitation Enforcement

Overview

Article 5(1)(b) of the GDPR requires that personal data be "collected for specified, explicit and legitimate purposes and not further processed in a manner that is incompatible with those purposes." This is the purpose limitation principle, one of the foundational data protection principles.

The controller must specify the purpose at or before the time of collection (Article 13(1)(c) for direct collection, Article 14(1)(c) for indirect collection). Any subsequent processing for a different purpose requires either a new lawful basis or must pass the compatibility assessment under Article 6(4).

The Article 29 Working Party Opinion 03/2013 on purpose limitation (WP203) provides detailed guidance on assessing compatibility, identifying five key factors codified in Article 6(4).

Article 6(4) Compatibility Assessment Factors

When a controller wishes to process personal data for a purpose other than that for which it was collected, Article 6(4) requires an assessment of compatibility considering:

FactorArticle 6(4) ReferenceAssessment Question
Link between purposesArticle 6(4)(a)Is there a connection between the original and new purpose?
Context of collectionArticle 6(4)(b)What is the relationship between controller and data subject? What are the reasonable expectations?
Nature of dataArticle 6(4)(c)Does the data include special categories (Article 9) or criminal convictions (Article 10)?
ConsequencesArticle 6(4)(d)What are the possible consequences of the further processing for data subjects?
SafeguardsArticle 6(4)(e)Are appropriate safeguards in place, including encryption or pseudonymisation?

Compatibility is not required when:

  • Processing is based on consent (Article 6(1)(a)) — new consent can be obtained for the new purpose
  • Processing is based on Union or Member State law that constitutes a necessary and proportionate measure (Article 6(4) final paragraph)
  • Processing is for archiving in the public interest, scientific/historical research, or statistics per Article 89(1)

Purpose-Tagged Data Architecture

Design Principles

  1. Purpose binding at ingestion — Every data record is tagged with its collection purpose at the point of entry into the system
  2. Purpose-based access control — Access policies are defined per purpose, not per data field alone
  3. Purpose audit trail — Every access is logged with the purpose under which it was authorized
  4. Purpose expiry — When a purpose is fulfilled, the associated data enters a retention countdown

Architecture Diagram

┌────────────────────────────────────────────────────────────┐
│                   Data Collection Points                    │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐  │
│  │ Web Form │  │ API Call │  │ IoT Feed │  │ Partner  │  │
│  │ P:ONBRD  │  │ P:ANALYT │  │ P:MAINT  │  │ P:MARKET │  │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘  │
│       └──────────────┼──────────────┼──────────────┘       │
└──────────────────────┼──────────────┼──────────────────────┘
                       │              │
┌──────────────────────▼──────────────▼──────────────────────┐
│              Purpose Tagging Gateway                        │
│  ┌─────────────────┐  ┌─────────────────────────────────┐  │
│  │ Purpose Registry │  │ Tag Injection Middleware        │  │
│  │ (canonical IDs)  │  │ (attaches purpose + timestamp)  │  │
│  └─────────────────┘  └─────────────────────────────────┘  │
└──────────────────────────────┬─────────────────────────────┘
                               │
┌──────────────────────────────▼─────────────────────────────┐
│              Purpose-Partitioned Data Store                  │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐  │
│  │ ONBRD    │  │ ANALYT   │  │ MAINT    │  │ MARKET   │  │
│  │ Partition│  │ Partition│  │ Partition│  │ Partition│  │
│  └──────────┘  └──────────┘  └──────────┘  └──────────┘  │
└──────────────────────────────┬─────────────────────────────┘
                               │
┌──────────────────────────────▼─────────────────────────────┐
│              Purpose Enforcement Layer                       │
│  ┌─────────────────┐  ┌────────────────┐  ┌────────────┐  │
│  │ Policy Engine   │  │ Compatibility  │  │ Audit      │  │
│  │ (OPA / Cedar)   │  │ Assessor       │  │ Logger     │  │
│  └─────────────────┘  └────────────────┘  └────────────┘  │
└────────────────────────────────────────────────────────────┘

Purpose Registry Schema

Each processing purpose is registered with canonical metadata:

json
{
  "purpose_id": "PRP-ONBRD-001",
  "purpose_name": "Customer Account Onboarding",
  "description": "Collection and processing of personal data necessary to create and activate a customer account, verify identity, and establish the contractual relationship.",
  "lawful_basis": "Article 6(1)(b)",
  "data_categories": ["email", "display_name", "country_code", "identity_verification_result"],
  "controller": "Prism Data Systems AG",
  "retention_period_days": 2555,
  "retention_trigger": "account_closure",
  "compatible_purposes": ["PRP-SUPRT-001", "PRP-SECUR-001"],
  "incompatible_purposes": ["PRP-MARKET-001", "PRP-RESRCH-001"],
  "special_categories": false,
  "created_date": "2025-06-01",
  "last_reviewed": "2026-01-15",
  "review_cadence_days": 180,
  "owner": "product_team",
  "dpo_approved": true
}

Access Control Per Purpose

Policy-as-Code with Open Policy Agent (OPA)

Purpose-based access control is implemented using OPA policies that evaluate access requests against the purpose registry:

# Prism Data Systems AG — Purpose-Based Access Policy

# Rule: Access is granted only if the requesting service's declared purpose
# matches a purpose tag on the requested data record.

allow {
    input.action == "read"
    input.resource.purpose_tags[_] == input.requester.declared_purpose
    purpose_is_active(input.requester.declared_purpose)
    role_authorized_for_purpose(input.requester.role, input.requester.declared_purpose)
}

# Rule: Cross-purpose access requires a completed compatibility assessment
allow {
    input.action == "read"
    not input.resource.purpose_tags[_] == input.requester.declared_purpose
    compatibility_assessment_approved(input.resource.purpose_tags, input.requester.declared_purpose)
    purpose_is_active(input.requester.declared_purpose)
}

# Rule: Write operations must include a valid purpose tag
allow {
    input.action == "write"
    valid_purpose(input.resource.purpose_tag)
    input.requester.declared_purpose == input.resource.purpose_tag
}

Role-Purpose Authorization Matrix

RoleONBRDANALYTSUPRTMARKETSECURBILLING
Onboarding ServiceRead/Write—————
Analytics Pipeline—Read————
Support AgentRead—Read/Write——Read
Marketing Automation———Read——
Security OperationsReadReadReadReadRead/WriteRead
Billing ServiceRead————Read/Write

Purpose Compatibility Assessment Workflow

  1. Request submission — Service owner submits a request to process data collected under purpose A for new purpose B, documenting the business justification.
  1. Factor analysis — The Data Protection Office evaluates the five Article 6(4) factors:
  • Link between purposes (scored 1-5: 1 = no link, 5 = closely linked)
  • Context and expectations (scored 1-5: 1 = unexpected, 5 = fully expected)
  • Nature of data (scored 1-5: 1 = special category, 5 = non-sensitive)
  • Consequences (scored 1-5: 1 = severe, 5 = minimal impact)
  • Safeguards (scored 1-5: 1 = no safeguards, 5 = comprehensive safeguards)
  1. Scoring — Total score calculated (range 5-25):
  • 20-25: Compatible. Approve with standard documentation.
  • 15-19: Potentially compatible. Approve with additional safeguards (pseudonymization, access restriction).
  • 10-14: Likely incompatible. Requires DPO escalation and DPIA consideration.
  • 5-9: Incompatible. Denied. New lawful basis or separate consent required.
  1. Decision recording — Assessment result recorded in the purpose registry with the assessor identity, date, score breakdown, conditions, and review date.
  1. Policy update — If approved, OPA policies are updated to allow cross-purpose access under documented conditions.

Prism Data Systems AG Implementation

Purpose Registry

Prism Data Systems AG maintains 14 registered purposes in their purpose registry:

Purpose IDNameLawful BasisData Categories
PRP-ONBRD-001Customer onboardingArt. 6(1)(b)email, displayname, countrycode
PRP-AUTH-001AuthenticationArt. 6(1)(b)email, passwordhash, mfatoken
PRP-BILLING-001Billing and invoicingArt. 6(1)(b)billingaddress, paymentmethod, vat_id
PRP-SUPRT-001Customer supportArt. 6(1)(b)email, displayname, supportticket_history
PRP-ANALYT-001Product analyticsArt. 6(1)(f)pseudonymizeduserid, featureevents, sessionduration
PRP-MARKET-001Direct marketingArt. 6(1)(a)email, displayname, marketingpreferences
PRP-SECUR-001Security monitoringArt. 6(1)(f)ipaddress, useragent, login_events
PRP-LEGAL-001Legal complianceArt. 6(1)(c)transactionrecords, consentrecords

Enforcement Metrics

Prism Data Systems AG tracks the following purpose limitation enforcement metrics:

MetricTargetMeasurement
Purpose tag coverage100% of recordsPercentage of data records with valid purpose tags
Cross-purpose access attempts blocked> 95% without assessmentPolicy engine denial count vs. total cross-purpose requests
Compatibility assessments completed100% within 5 business daysTime from request to DPO decision
Purpose registry review currency100% reviewed within cadencePercentage of purposes reviewed within their review cadence

Key Regulatory References

  • GDPR Article 5(1)(b) — Purpose limitation principle
  • GDPR Article 6(4) — Compatibility assessment factors
  • GDPR Article 13(1)(c) — Information about purpose at collection
  • GDPR Article 14(1)(c) — Information about purpose for indirect collection
  • GDPR Article 89(1) — Exception for archiving, research, statistics
  • GDPR Recital 50 — Further processing compatibility
  • Article 29 Working Party Opinion 03/2013 on purpose limitation (WP203)
  • EDPB Guidelines 4/2019 on Article 25 Data Protection by Design and by Default

Relacionados por tarefa

do mesmo repositório

Mais Skills

Todos os Skills
mukul975
Comunidade

applying-privacy-design-patterns

- Systematic application of the eight privacy design patterns per Hoepman: minimize, hide, separate, abstract, inform, control, enforce, and demonstrate. Covers pattern selection methodology per processing activity, mapping to GDPR principles, and practical implementation guidance for privacy-by-design system architecture.

instalações
1
GitHub Stars
315
Atualizado
16 de mar.
mukul975
Comunidade

brazil-lgpd

- Guides compliance with Brazil's Lei Geral de Proteção de Dados (LGPD, Lei 13.709/2018). Covers the 10 lawful bases under Art. 7, DPO appointment, ANPD enforcement, data subject rights under Arts. 17-22, and international transfer mechanisms. Keywords: LGPD, Brazil data protection, ANPD, lawful bases, data subject rights, international transfers.

instalações
1
GitHub Stars
315
Atualizado
16 de mar.
mukul975
Comunidade

adequacy-assessment

- Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

instalações
1
GitHub Stars
295
Atualizado
16 de mar.
mukul975
Comunidade

age-gating-services

- Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

instalações
1
GitHub Stars
295
Atualizado
16 de mar.