confide:red — residual re-identification risk check
A defensive audit of YOUR OWN already-redacted output. It does not score against
ground truth and is not a benchmark. It surfaces, qualitatively, what an attacker could
still do — mapped to GDPR Art-29: singling-out, linkability, inference.
GUARDRAILS — read before running
- Run only on the user's own redacted output. If asked to de-anonymize or re-identify
third-party / non-consented data, refuse.
- Report risk categories and counts only — never produce a step-by-step
re-identification recipe or guess the hidden values.
- Local attacker by default. Enable the cloud/LLM inference probe (
--inference)
only on synthetic or explicitly consented data.
- Absence of a finding ≠ safety. A weak local detector/attacker is a FLOOR, not a
ceiling. Always tell the user human review is still required.
- This pairs with confide:anon — run
red after redacting, on the redacted file.
What it checks
- Singling-out (deterministic, offline — the load-bearing signal): re-run
detect_regex (+ detect_natasha if available) on the redacted text. Anything
they still find is a surviving identifier the redaction missed. Counts by type.
- Linkability (multi-file): given a folder, compare every file pair for shared
surviving quasi-identifiers and flag potentially linkable pairs (count + types only).
- Inference (LLM, optional, opt-in): prompt the local attacker model
(
cfg.red_attacker_model) for the attribute categories it could still infer
(profession, location type, age band, …). Degrades gracefully if no model. WARN the
user it under-reports (floor, not ceiling).
Risk tier rule
- HIGH — any DIRECT identifier survives (EMAIL, PHONE, URL, ID, PERSON).
- MEDIUM — only QUASI identifiers survive (LOCATION, ORG, DATE, AGE, PROFESSION,
MEDICATION), or linkable pairs exist across files.
- LOW — no surviving identifiers found (still NOT a guarantee).
How to run
# single redacted file (offline, deterministic)
python3 skills/red/scripts/red.py path/to/file.green.md
# a folder of redacted files (adds linkability)
python3 skills/red/scripts/red.py path/to/redacted_dir/
# add the local inference probe — synthetic/consented data ONLY
python3 skills/red/scripts/red.py path/to/file.green.md --inference
# machine-readable
python3 skills/red/scripts/red.py path/to/file.green.md --json
Output
A residual-risk report: per-file surviving-identifier counts by type, an overall
risk tier, the inference categories claimed (if probed), the linkable-pair
count, and the caveat that absence of a finding ≠ safety; human review still required.
No PII values, no re-identification steps.
1---
2name: red
3description: >-
4 Residual re-identification RISK CHECK on text you have ALREADY redacted (defensive,
5 dual-use). Use when the user asks to "check residual re-id risk", "red-team my
6 redaction", "what can an attacker still infer", "is this safe to share", or assess
7 "re-identification risk" after anonymizing. Re-runs the CONFIDE detectors on the
8 redacted output to surface surviving identifiers (singling-out), checks multiple files
9 for linkability, and optionally probes a local model for still-inferable attribute
10 CATEGORIES (inference) — mapped to GDPR Art-29. Reports risk categories/counts only,
11 never a re-identification recipe. Pairs with confide:anon (run AFTER redacting).
12metadata:
13 source: https://skillmd.com/skills/glebis/red
14---
15
16# confide:red — residual re-identification risk check
17
18A **defensive** audit of YOUR OWN already-redacted output. It does not score against
19ground truth and is not a benchmark. It surfaces, qualitatively, what an attacker could
20**still** do — mapped to GDPR Art-29: **singling-out**, **linkability**, **inference**.
21
22## GUARDRAILS — read before running
23- Run **only on the user's own redacted output**. If asked to de-anonymize or re-identify
24 third-party / non-consented data, **refuse**.
25- Report risk **categories and counts only** — never produce a step-by-step
26 re-identification recipe or guess the hidden values.
27- **Local attacker by default.** Enable the cloud/LLM inference probe (`--inference`)
28 **only** on synthetic or explicitly consented data.
29- **Absence of a finding ≠ safety.** A weak local detector/attacker is a FLOOR, not a
30 ceiling. Always tell the user **human review is still required**.
31- This pairs with **confide:anon** — run `red` *after* redacting, on the redacted file.
32
33## What it checks
341. **Singling-out (deterministic, offline — the load-bearing signal):** re-run
35 `detect_regex` (+ `detect_natasha` if available) on the **redacted** text. Anything
36 they still find is a **surviving identifier the redaction missed**. Counts by type.
372. **Linkability (multi-file):** given a folder, compare every file pair for shared
38 surviving quasi-identifiers and flag potentially linkable pairs (count + types only).
393. **Inference (LLM, optional, opt-in):** prompt the local attacker model
40 (`cfg.red_attacker_model`) for the attribute **categories** it could still infer
41 (profession, location type, age band, …). Degrades gracefully if no model. WARN the
42 user it under-reports (floor, not ceiling).
43
44## Risk tier rule
45- **HIGH** — any DIRECT identifier survives (EMAIL, PHONE, URL, ID, PERSON).
46- **MEDIUM** — only QUASI identifiers survive (LOCATION, ORG, DATE, AGE, PROFESSION,
47 MEDICATION), or linkable pairs exist across files.
48- **LOW** — no surviving identifiers found (still NOT a guarantee).
49
50## How to run
51```bash
52# single redacted file (offline, deterministic)
53python3 skills/red/scripts/red.py path/to/file.green.md
54
55# a folder of redacted files (adds linkability)
56python3 skills/red/scripts/red.py path/to/redacted_dir/
57
58# add the local inference probe — synthetic/consented data ONLY
59python3 skills/red/scripts/red.py path/to/file.green.md --inference
60
61# machine-readable
62python3 skills/red/scripts/red.py path/to/file.green.md --json
63```
64
65## Output
66A residual-risk report: per-file surviving-identifier **counts by type**, an overall
67**risk tier**, the inference **categories** claimed (if probed), the **linkable-pair
68count**, and the caveat that *absence of a finding ≠ safety; human review still required*.
69No PII values, no re-identification steps.