Danish CPR & PII Privacy Guardrail
Negative constraint rules and regex filters to prevent agents from storing, logging, or leaking Danish CPR numbers.
Installation
skills.sh / CLI
Install this skill directly into your AI coding agent or project.
npx skills add lordavocado/AgentAccess.dk --skill cpr-gdpr-guardrailAbout Danish CPR & PII Privacy Guardrail
A critical compliance safeguard for agents processing Danish text, emails, or civil service documents. Implements pattern detection for Danish Personal Identification Numbers (Det Centrale Personregister / CPR: DDMMYY-XXXX), mandating immediate masking (e.g. DDMMYY-****) before external LLM inference or log ingestion.
SKILL.md Instructions
SKILL.mdSKILL.md
The procedural instructions executed step-by-step by the AI agent.
---
name: cpr-gdpr-guardrail
description: Mask and protect Danish CPR numbers and sensitive citizen identifiers.
metadata:
compliance: gdpr
country: DK
---
# Danish CPR & PII Privacy Guardrail Skill
The Danish CPR number (Central Person Register number) is a sensitive personal identifier under Danish GDPR regulations.
## Regex Pattern
Match standard CPR format:
`\b(0[1-9]|[12][0-9]|3[01])(0[1-9]|1[0-2])([0-9]{2})[- ]?([0-9]{4})\b`
## Mandatory Guardrail Actions
1. **Mask Before Transmission**: When passing citizen documents or input to external APIs, redact the last 4 digits:
- Original: `120584-1234`
- Masked: `120584-****`
2. **Never Log**: Do not output unmasked CPR numbers into CLI logs, agent traces, or temporary scratch files.
3. **Contextual Warning**: If a user prompts the agent with a raw CPR number, confirm processing intent while sanitizing memory.