lgpd-compliance
Skill4 starsChanged 4 months agoMITView on GitHub
Brazilian LGPD (Lei Geral de Proteção de Dados) compliance for web applications. Use when handling personal data, implementing consent, data retention, anonymization, or reviewing privacy practices — trigger for any Brazil privacy question even if LGPD is not named. For generating documents (privacy policy, ROPA) use lgpd-document-generator; for minors' data use digital-eca-compliance; for fine/enforcement risk use lgpd-sanctions.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- cookieMonsterDev/agents-skillstheir own version, first seen Nov 1, 2026
- Falkzera/falcao-skills-opentheir own version, first seen Aug 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- cookieMonsterDev/agents-skills★ 7same name
- Falkzera/falcao-skills-open★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- digital-eca-complianceSkill
- lgpd-document-generatorSkill
- lgpd-sanctionsSkill
- marco-civil-complianceSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
All data processing must observe good faith and these principles:
- Distinctive: line 83
Must be written or demonstrable by other means
- Distinctive: line 84
Must be for specific purposes (blanket consent is void)
- Distinctive: line 85
Must be separate from other contractual clauses
- Distinctive: line 87
If consent changes scope, user must be notified and can revoke
- Distinctive: line 92
When using legitimate interest as legal base:
- Distinctive: line 94
Only use strictly necessary data
- Distinctive: line 130
Must be in the child's best interest
- Distinctive: line 244
After processing ends, data must be deleted, except for:
- Distinctive: line 307
When reviewing code that handles personal data:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LGPD Compliance (Lei 13.709/2018)
Last verified against official sources: 2026-07-10
When to Use
- Handling personal data (CPF, email, address, phone, IP)
- Processing sensitive data (health, biometrics, race/ethnicity, religion, political opinion)
- Processing children's or adolescents' data
- Implementing consent management
- Designing data retention and deletion policies
- Building user data export or portability features
- Reviewing code for privacy compliance
- Responding to data subject rights requests
- Handling data breach incidents
How to Respond
| Task | Respond with |
| Code/feature review | Checklist-style findings, each with the LGPD article reference and a concrete fix |
| "Which legal base applies?" | Recommended base + justification, and why the alternatives were discarded |
| Implementation request (consent, deletion, export, retention) | Pattern/pseudocode + the legal rules it must satisfy |
| Retention question | Retention table per data type with legal basis and post-expiry action |
| Incident question | Notifiability test + deadlines; use lgpd-document-generator for the notification documents |
| Anonymization question | Anonymization vs. pseudonymization verdict + technique recommendation + re-identification tests |
Key Definitions (Art. 5)
| Term | Definition |
| Dado pessoal | Any information related to an identified or identifiable natural person |
| Dado pessoal sensível | Data on race/ethnicity, religion, political opinion, union membership, health, sex life, genetics, biometrics |
| Dado anonimizado | Data that cannot be associated with an individual using reasonable technical means |
| Titular | Natural person to whom the personal data refers |
| Controlador | Person/entity that makes decisions about personal data processing |
| Operador | Person/entity that processes data on behalf of the controller |
| Encarregado (DPO) | Person appointed by controller/operator as communication channel with data subjects and ANPD |
| Tratamento | Any operation with personal data: collection, storage, use, access, sharing, deletion, etc. |
| Consentimento | Free, informed, unambiguous expression of will by which the data subject agrees to processing |
Principles (Art. 6)
All data processing must observe good faith and these principles:
| Principle | What it means | What to implement |
| Finalidade | Specific, legitimate, explicit purposes | Document purpose for each data field collected |
| Adequação | Processing compatible with stated purposes | Don't reuse data beyond original purpose |
| Necessidade | Collect only what's strictly needed | Minimize fields; avoid "nice to have" data |
| Livre acesso | Users can query their data freely and for free | Provide data access/export endpoint |
| Qualidade | Keep data accurate and up-to-date | Allow profile editing, validate input |
| Transparência | Clear information about processing | Privacy policy, consent banners |
| Segurança | Protect from unauthorized access | Encryption, access control, audit logs |
| Prevenção | Prevent damage from processing | Impact assessments, security by design |
| Não discriminação | No discriminatory processing | Audit algorithms for bias |
| Responsabilização | Demonstrate compliance | Logs, policies, DPO appointment |
Legal Bases for Processing (Art. 7)
Personal data may ONLY be processed under one of these 10 legal bases:
| # | Legal Base | Typical Use |
| I | Consent | Marketing, analytics, optional features |
| II | Legal/regulatory obligation | Tax records, labor law, financial regulations |
| III | Public administration | Public policy execution |
| IV | Research | Studies by research organizations (anonymize when possible) |
| V | Contract execution | Providing the contracted service |
| VI | Exercise of rights | Legal proceedings, arbitration |
| VII | Life/safety protection | Emergency situations |
| VIII | Health protection | Medical procedures by health professionals |
| IX | Legitimate interest | Security, fraud prevention, analytics (requires balancing test) |
| X | Credit protection | Credit scoring, financial analysis |
Consent Requirements (Art. 8)
- Must be written or demonstrable by other means
- Must be for specific purposes (blanket consent is void)
- Must be separate from other contractual clauses
- Can be revoked at any time via simple, free procedure
- If consent changes scope, user must be notified and can revoke
- Burden of proof is on the controller
Legitimate Interest (Art. 10)
When using legitimate interest as legal base:
- Processing only for legitimate purposes based on concrete situations
- Only use strictly necessary data
- Controller must adopt transparency safeguards (data subject rights remain)
- ANPD may request a Data Protection Impact Assessment (DPIA)
Sensitive Data (Art. 11)
Sensitive data requires stricter legal basis:
- Explicit consent from the data subject, for specific purposes; OR
- Without consent only when indispensable for:
- Legal/regulatory obligation
- Public administration policies
- Research (anonymize when possible)
- Life/safety protection
- Health protection
- Fraud prevention
Implementation Rules for Sensitive Data
DO:
- Encrypt sensitive columns at rest (health, biometrics, race/ethnicity)
- Use field-level encryption, not just disk encryption
- Restrict access with RBAC — principle of least privilege
- Log all access to sensitive data for audit
- Get explicit, specific consent before processing
DON'T:
- Store sensitive data in logs, error messages, or URLs
- Use sensitive data for automated decisions without human review
- Share sensitive data with third parties without specific consent
- Store sensitive data longer than necessaryChildren's Data (Art. 14)
Processing children's data requires:
- Must be in the child's best interest
- Requires specific, prominent consent from at least one parent/guardian
- Controller must publish information about: types of data collected, how they're used, and how to exercise rights
- Cannot condition participation in games/apps on providing data beyond what's strictly necessary
- Collection without parental consent only to contact parents (single use, no storage) or for child protection
Note: For comprehensive children's data protection, also apply the ECA Digital (Lei 15.211/2025) skill which has additional requirements.
Data Subject Rights (Art. 18)
Data subjects have the right to obtain from the controller, at any time:
| Right | Description | Implementation |
| Confirmation | Whether their data is being processed | GET /api/privacy/status |
| Access | View all their personal data | GET /api/privacy/data-export |
| Correction | Fix incomplete, inaccurate, or outdated data | PATCH /api/profile |
| Anonymization/Blocking/Deletion | Of unnecessary, excessive, or non-compliant data | DELETE /api/privacy/data |
| Portability | Transfer data to another provider | Export in machine-readable format (JSON/CSV) |
| Deletion | Of data processed with consent | Account deletion flow |
| Information | Know which entities received their data | Disclose in privacy policy |
| Consent info | Know consequences of denying consent | Clear opt-in/opt-out explanation |
| Revocation | Withdraw consent at any time | Simple, free procedure |
Response Deadlines (Art. 19)
| Request | Deadline | Source |
| Confirmation of processing / access — simplified format | Immediately | Art. 19, I |
| Confirmation of processing / access — complete declaration | 15 days from the request | Art. 19, II |
| All deadlines for small-porte agents (startups, micro/small companies) | Doubled (e.g., 30 days for complete declaration) | Res. CD/ANPD nº 2/2022 |
| Other rights (correction, deletion, portability, revocation) | No statutory deadline — respond without undue delay; adopt an internal SLA (15 days is the market reference) and document it | Art. 18, §5 |
Implementation: track every request with received-at timestamp, deadline, and resolution; alert before the deadline expires. Denials must be justified in writing with the legal basis (Art. 18, §4).
Implementation Pattern
# Pseudocode — Data Subject Rights Controller
# Right of Access (Art. 18, II)
def export_user_data(user_id):
"""Return ALL personal data for this user in structured format."""
return {
"profile": get_profile(user_id),
"activity": get_activity_log(user_id),
"consents": get_consent_records(user_id),
"third_party_sharing": get_sharing_log(user_id),
"exported_at": now(),
}
# Right of Deletion (Art. 18, IV and VI)
def delete_user_data(user_id):
"""
Soft-delete immediately, hard-delete/anonymize after retention period.
Keep only what's required by legal obligation (Art. 16, I).
"""
soft_delete_account(user_id)
schedule_anonymization(user_id, days=RETENTION_DAYS)
revoke_all_consents(user_id)
notify_third_parties_of_deletion(user_id)Security Requirements (Arts. 46-49)
Technical and Administrative Measures (Art. 46)
Controllers and operators must adopt security measures to protect data from:
- Unauthorized access
- Accidental or unlawful destruction, loss, alteration
- Unauthorized communication or dissemination
These measures apply from the design phase through execution (privacy by design — Art. 46, §2).
Incident Response (Art. 48)
The controller must notify ANPD and affected data subjects when a security incident may cause relevant risk or damage.
Notification must include:
- Description of the nature of affected personal data
- Information about affected data subjects
- Technical and security measures used
- Risks related to the incident
- Reasons for any delay (if not immediate)
- Measures adopted to reverse or mitigate the effects
Deadline: Resolução CD/ANPD nº 15/2024 requires notification within 3 business days of becoming aware of the incident.
Sanctions (Art. 52)
| Sanction | Detail |
| Warning | With deadline for corrective measures |
| Simple fine | Up to 2% of revenue in Brazil, capped at R$ 50 million per infraction |
| Daily fine | Same cap as simple fine |
| Publicization | Public disclosure of the infraction |
| Blocking | Suspension of processing of related data |
| Deletion | Mandatory deletion of related data |
| Partial suspension | Of database operations, up to 6 months (renewable) |
| Total suspension | Of processing activity, up to 6 months (renewable) |
| Prohibition | Of processing activities, partial or total |
Criteria for Sanctions (Art. 52, §1)
ANPD considers: severity, good faith, advantage obtained, economic condition, recidivism, damage, cooperation, adoption of good practices, adoption of governance policies, prompt adoption of corrective measures, proportionality.
Data Retention (Art. 15-16)
Processing ends when:
- Purpose achieved or data no longer necessary
- End of processing period
- Data subject request (including consent revocation)
- ANPD order
After processing ends, data must be deleted, except for:
- Legal/regulatory obligation to retain
- Research (anonymized)
- Transfer to third party (respecting legal requirements)
- Exclusive use by the controller (anonymized, no third-party access)
Recommended Retention Policy
| Data Type | Retention | After Expiry |
| Account data | While active + 6 months | Anonymize |
| Transaction records | 5 years (tax/commercial law) | Delete |
| Health data | While active | Delete on account deletion |
| Consent records | Duration of consent + 5 years | Archive for proof |
| Audit/access logs | 2 years | Delete |
| Backups | 30-90 days rolling | Automatic expiry |
Anonymization vs. Pseudonymization (Arts. 5, 12, 13)
| Anonymization | Pseudonymization | |
| Definition | Data can no longer be associated with an individual using reasonable technical means (Art. 5, XI) | Association with an individual is only possible via additional information kept separately (Art. 13, §4) |
| LGPD status | Outside LGPD scope (Art. 12, caput) — no legal base needed | Still personal data — all LGPD obligations apply |
| Reversibility | Irreversible by reasonable means | Reversible with the key/mapping table |
"Reasonable means" test (Art. 12, §1): consider cost, time, and available technology required for re-identification. If re-identification is cheap and fast, the data is NOT anonymized. Data used for behavioral profiling of an identifiable person is personal data regardless (Art. 12, §2).
Techniques
| Technique | What it does | Watch out |
| Suppression | Remove identifier columns entirely | Quasi-identifiers (ZIP + birth date + gender) can still single out individuals |
| Generalization | Reduce precision (birth date → age range, address → city) | Verify group sizes after generalizing |
| k-anonymity | Every quasi-identifier combination matches at least k records (use k ≥ 5) | Vulnerable to homogeneity attacks — combine with l-diversity for sensitive attributes |
| Noise / differential privacy | Add statistical noise to aggregates | Only for analytics outputs, not record-level release |
| Consistent date-shifting | Shift all dates per subject by a fixed random offset | Preserves intervals; keep the offset secret and discard it |
Anti-Patterns
DON'T:
- Hash CPF (or any low-entropy identifier) without salt/secret — the full CPF
space can be brute-forced in minutes; the "anonymized" column is reversible
- Call pseudonymized data "anonymous" in the privacy policy — it is still
personal data under the LGPD
- Store the pseudonymization key/mapping alongside the pseudonymized data
- Release record-level datasets with unique quasi-identifier combinations
DO:
- Use HMAC with a secret key (kept in a separate vault) when you need
consistent pseudonyms
- Run re-identification tests BEFORE calling any dataset anonymized:
singling out (can one record be isolated?), linkability (can records be
linked to another dataset?), inference (can an attribute be deduced?)
- Re-assess anonymization when new external datasets or techniques emergeCrypto-Shredding Pattern
To fulfill deletion requests (Art. 18) when data lives in immutable stores or backups: encrypt each data subject's data with a per-subject key; deletion = destroying the key. The remaining ciphertext becomes unrecoverable — effectively anonymized without rewriting backups. Document this approach in the retention policy.
Code Review Checklist
When reviewing code that handles personal data:
- No PII in logs — mask CPF, email, names in log messages
- No PII in error responses — generic messages to users, details server-side only
- No PII in URLs — use POST body, not query params for sensitive data
- Legal base documented — each data collection point has a documented legal base
- Consent recorded — timestamp, scope, and method of consent stored
- Consent revocable — simple mechanism to withdraw consent
- Data minimization — only collecting what's needed for the stated purpose
- Access control — users see only their own data; admins have audit trails
- Encryption at rest — sensitive columns encrypted (not just disk-level)
- Encryption in transit — TLS 1.2+ for all connections
- Retention enforced — automated deletion/anonymization when retention expires
- Deletion cascade — account deletion removes data from all systems including backups
- Third-party disclosure — data sharing with third parties documented and consented
- International transfers — cross-border data transfers comply with Art. 33-36
International Data Transfer (Art. 33)
Transfer to other countries or international organizations is only allowed when:
- Country/organization provides adequate protection (recognized by ANPD)
- Controller provides safeguards (standard contractual clauses, binding corporate rules, certifications)
- Specific consent from data subject
- Required for international legal cooperation
- Required to protect life/safety
- Authorized by ANPD
- Required by treaty/convention
- Required for contract execution (at data subject's request)
EU adequacy: Resolução CD/ANPD nº 32/2026 recognizes the EU as providing adequate data protection for international transfers.
References
- Lei 13.709/2018 (LGPD)
- ANPD — Perguntas Frequentes
- Resolução CD/ANPD nº 15/2024 — Comunicação de Incidentes
- Resolução CD/ANPD nº 4/2023 — Dosimetria de Sanções
- Resolução CD/ANPD nº 2/2022 — Agentes de Pequeno Porte
- Resolução CD/ANPD nº 19/2024 — Transferência Internacional
- Resolução CD/ANPD nº 18/2024 — Atuação do Encarregado
See Also
digital-eca-compliance— Use when processing children's or adolescents' data. ECA Digital (Lei 15.211/2025) adds requirements beyond LGPD Art. 14: age verification, anti-compulsive design, content moderation, penalties up to 10% of revenue.lgpd-document-generator— Use when you need to generate compliance documents: privacy policies, terms of use, consent forms, ROPA, cookie policies.lgpd-sanctions— Use for risk assessment and understanding ANPD enforcement: dosimetry criteria, fine calculation, real precedent cases, aggravating/mitigating factors.marco-civil-compliance— Use when building internet platforms. Marco Civil complements LGPD with data retention obligations (1 year connection logs, 6 months application logs), net neutrality, and provider liability rules.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

