Scroll AI Now

Agent skill

Lgpd anonymization

Apply anonymization (Art. 5, XI) and pseudonymization (Art. 13, §4) techniques to take data out of LGPD scope or reduce risk in analytics pipelines. Use...

By goul4rt · goul4rt/lgpd‑skills · MIT License · ★ 306 · 67 lines

New to this? An agent skill is a file of instructions your AI assistant follows for one job. The text above is written for the assistant. How to use a skill

What it does

Lgpd anonymization is a data skill from goul4rt/lgpd‑skills, a GitHub repo with 306 stars.
In short, it shows your assistant how to work with data step by step.
The file is 67 lines long and is set out in parts such as “Diferença crítica”, “Técnicas”, “Pseudonimização” and “Anonimização”.
It has 2 code examples your assistant can follow.

When to use it

Reach for it when you have numbers or tables to clean, query or explain.
Everything it needs is in this one file.
It does not ask for special tools.

Safety check

Our checker read all 67 lines before we listed it.
It found no attack techniques, no hidden text and no steps that switch off your assistant's safety or send your data away.
It flagged nothing else to watch for.
The text links to no outside sites.
It is shared under the MIT license.
Still read it before you use it, like any instructions you give your AI.

Open in the appOriginal on GitHub

What is inside

How to use it

Read the full guide to using an agent skill

Want your own? How to write an agent skill that works

The full skill

---
name: lgpd-anonymization
description: Apply anonymization (Art. 5, XI) and pseudonymization (Art. 13, §4) techniques to take data out of LGPD scope or reduce risk in analytics pipelines. Use when user asks 'anonimizar', 'pseudonimizar', 'k-anonymity', 'differential privacy', 'tokenização', 'analytics LGPD', or designing analytics/ML pipelines.
---

# Anonimização e Pseudonimização

## Diferença crítica

| | Anonimização (Art. 5º, XI) | Pseudonimização (Art. 13, § 4º) |
|---|---|---|
| Reversível? | Não, considerando meios técnicos razoáveis | Sim, com info adicional segregada |
| Status LGPD | Fora do escopo (Art. 12) | Continua sendo dado pessoal |
| Uso típico | Estatísticas públicas, datasets de pesquisa | Analytics interna, logs, redução de exposição |
| Risco residual | Baixíssimo (re-identificação) | Médio (depende da segurança da chave) |

## Técnicas

### Pseudonimização
- **Tokenização determinística**: substitui PII por token; mapping mantido em vault separado
- **Hashing com salt** (cuidado — sem salt aleatório, é reversível por força bruta para campos de baixa entropia como CPF)
- **Format-preserving encryption** quando o formato precisa ser mantido

### Anonimização
- **Generalização**: idade exata → faixa (25-34); CEP → cidade
- **Supressão**: remoção de campos identificadores
- **Perturbação**: adicionar ruído aleatório
- **k-anonymity (k ≥ 5)**: cada combinação de quasi-identificadores aparece em ≥ k registros
- **l-diversity, t-closeness**: refinamentos para resistir a ataques de inferência
- **Differential privacy (ε pequeno)**: garantia matemática contra re-identificação

## Pipeline típico de analytics

```
[Postgres prod] → ETL com pseudonimização (token PII) → [Analytics DW] → Generalização + k-anonymity → [Dashboards públicos]
```

## Anti-padrões

- ❌ "Removemos o nome" e mantemos CPF, e-mail, endereço — **não é anonimização**
- ❌ Hash de CPF sem salt único — facilmente reversível (~210 milhões de combinações)
- ❌ ID interno como "pseudônimo" se está exposto em URLs e logs — não é pseudonimização
- ❌ Agregação só por região quando dataset tem campos suficientes para inferência cruzada

## Implementação

Ver `assets/anonymization-recipes.md` para receitas concretas em SQL e Python.

## Re-identificação — teste obrigatório

Antes de declarar um dataset "anonimizado":
1. **Linkage attack**: tente combinar com dataset público
2. **Inference attack**: estime atributo sensível a partir dos outros
3. **Singling out**: existe registro único na base?

Se algum passa → dataset ainda é dado pessoal.

## Status update

```markdown
## F (legacy L6) — Anonimização ✓
- Pipelines de analytics revisados
- {N} datasets passados por pseudonimização
- {M} datasets passados por anonimização (k=5+)
- Vault de tokens isolado
- Próximo: lgpd-dsar (legacy) ou conforme pipeline
```

Copyright (c) goul4rt and contributors.
Published under the MIT License, which you can read in full there.
Shown as published on GitHub, with credit and a link to the original.
Read it before you use it.

Are you the author?

This skill passed our automated safety check.
Show it in your README with the badge below.
It links readers back to this page. How the badge works

Featured on Scroll AI Now, passed its automated safety check

Markdown
[![Featured on Scroll AI Now, passed its automated safety check](https://scrollainow.com/badge/safety-checked.svg)](https://scrollainow.com/skills/lgpd-anonymization/)
HTML
<a href="https://scrollainow.com/skills/lgpd-anonymization/"><img src="https://scrollainow.com/badge/safety-checked.svg" alt="Featured on Scroll AI Now, passed its automated safety check" height="28"></a>

More skills

All agent skills

Try it in your browser

Today's AI news, one card per swipe.
Free to start.

Open the web app