Pseudonymizing For Gdpr logo

Pseudonymizing For Gdpr

CommunityPopular
maziyarpanahi
pseudonymizing-for-gdpr

Apply GDPR-grade pseudonymization to clinical or personal text with OpenMed, keeping a separately-held re-linkage key so the data can be controlled-re-linked later. Use when the user must process EU personal/health data under GDPR, asks for pseudonymization vs anonymization, needs Art. 4(5) / Art. 9 / Recital 26 alignment, wants a reversible mapping/key vault held apart from the data, or needs controlled re-linkage. Covers openmed.deidentify(policy="gdpr_pseudonymization", keep_mapping=True), storing the mapping in a separate key vault, reidentify() for authorized re-linkage, and retention. Pairs after extracting-pii-entities and configuring-privacy-policies.

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill namepseudonymizing-for-gdpr
Stars
5.3K
Forks
677
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by maziyarpanahi on GitHub. Read the source before you install it.

Installation

Install the Pseudonymizing For Gdpr AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maziyarpanahi/openmed.git /tmp/openmed
mkdir -p .claude/skills
cp -r /tmp/openmed/skills/pseudonymizing-for-gdpr .claude/skills/pseudonymizing-for-gdpr
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pseudonymizing For Gdpr in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pseudonymizing For Gdpr on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pseudonymizing For Gdpr is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Pseudonymizing for GDPR

Pseudonymization under the GDPR (Art. 4(5)) means processing personal data so it "can no longer be attributed to a specific data subject without the use of additional information" — provided that additional information (the re-linkage key) is "kept separately and is subject to technical and organisational measures." Crucially, pseudonymized data is still personal data (Recital 26): re-linkage is possible, so GDPR still applies. This is the opposite of anonymization, where re-identification is irreversibly prevented and the data falls outside the GDPR.

OpenMed implements this with a single reversible de-identification pass plus a mapping you store away from the data. This skill covers producing that mapping, vaulting the key separately, and re-linking under authorization.

When to use

  • You process EU residents' personal or special-category health data (Art. 9) and need a lawful, reversible safeguard rather than full anonymization.
  • You need to keep a record-linkage capability (e.g. to recontact a patient, reconcile longitudinal records, or honor a Subject Access Request) but must separate the linkage key from the working dataset.
  • A reviewer asks for the pseudonymization-vs-anonymization distinction in writing, or for the ENISA-style "additional information kept separately" control to be demonstrable.

Do not use this when the goal is irreversible anonymization for open release — there, drop the mapping entirely and gate residual risk with reviewing-reidentification-risk. Pseudonymization keeps a key; anonymization must not.

Quick start

python
import openmed

# Synthetic record — never run this skill's examples on real PHI.
note = "Patient Maria Schmidt (ID 4471) seen 2024-03-02; contact maria@example.de."

result = openmed.deidentify(
    note,
    method="replace",                 # realistic surrogates, not [LABEL] holes
    policy="gdpr_pseudonymization",   # bundled GDPR profile
    keep_mapping=True,                # produce the reversible re-linkage map
    consistent=True,                  # same input -> same surrogate in the doc
    seed=20240302,                    # cross-run reproducibility of surrogates
)

pseudonymized_text = result.deidentified_text   # safe to process / analyze
relink_key = result.mapping                      # surrogate -> original; SECRET

result.deidentified_text is the pseudonymized payload. result.mapping is the "additional information" GDPR Art. 4(5) requires be kept separately — it is the key that makes re-linkage possible, and therefore the most sensitive artifact in the whole flow.

Workflow

  1. Choose reversible pseudonymization, not masking. Use method="replace" with policy="gdpr_pseudonymization" and keep_mapping=True. Replacement surrogates keep the text usable for downstream NLP while remaining non-identifying. consistent=True (optionally with seed=) makes repeated mentions resolve to one stable surrogate so intra-document linkage survives.
  2. Split the data from the key immediately. The moment deidentify returns, route result.deidentified_text to your working store and result.mapping to a separate, access-controlled key vault — different system, different credentials, different backups. Never persist them in the same row, file, bucket, or log line. This separation is the technical-and-organisational measure that makes the data pseudonymized rather than just "personal data with PII in it."
  3. Process the pseudonymized text freely. Run analyze_text, analytics, model training, or transfer on deidentified_text. The key never leaves the vault during ordinary processing.
  4. Re-link only under authorization. When a lawful basis exists (e.g. an authorized SAR or recontact), fetch the mapping from the vault and call openmed.reidentify(deidentified_text, mapping). Log that a re-linkage happened (who, when, why, record id) — but never log the restored plaintext.
  5. Apply retention to the key. The mapping has its own retention clock. When the lawful basis for re-linkage ends, destroy the mapping. Once the key is irreversibly gone and no other re-identification path remains, the remaining text approaches anonymization and GDPR obligations shrink accordingly. Verify that claim with reviewing-reidentification-risk before relying on it.

Hand-off to / from OpenMed

  • From extracting-pii-entities / configuring-privacy-policies: confirm the detector recall and the active policy profile before pseudonymizing, since any identifier the detector misses leaks into deidentified_text.
  • OpenMed call: Python from openmed import deidentify, reidentify; the same capability is exposed as MCP tool openmed_deidentify and REST /deidentify. Pass policy="gdpr_pseudonymization", keep_mapping=True.
  • To auditing-deid-leakage: scan result.deidentified_text for residual identifiers before it leaves the boundary — pseudonymization is only as strong as detection.
  • To reviewing-reidentification-risk: quasi-identifier (age, ZIP, dates) re-identification still applies to pseudonymized data; score k-anonymity on the output and document residual risk.

Edge cases & gotchas

  • Pseudonymized ≠ anonymized. As long as mapping exists anywhere, the data is personal data under Recital 26. Do not market a keep_mapping=True output as "anonymous."
  • The mapping is the crown jewel. A leaked mapping re-identifies everything at once. Treat it as the highest-sensitivity secret: encrypt at rest, restrict access, audit reads.
  • Surrogates can still carry quasi-identifiers. method="replace" swaps the identifier text, but free-text age, rare diagnosis, ZIP, or admission dates remain. Pseudonymization does not address singling-out; pair with QI risk scoring.
  • Reproducibility cuts both ways. A fixed seed makes surrogates stable across runs (good for linkage) but means an attacker who learns the seed and algorithm can reproduce surrogates — keep the seed with the key, not the data.
  • Special-category data (Art. 9). Health data needs a lawful basis before processing; pseudonymization is a safeguard, not a lawful basis on its own.
  • Local-first. Run entirely on-device. Do not send EU personal data to a cloud de-identification service to satisfy GDPR — that may itself be a transfer.

Standards & references

Frequently asked questions

What does the Pseudonymizing For Gdpr AI skill do?

Apply GDPR-grade pseudonymization to clinical or personal text with OpenMed, keeping a separately-held re-linkage key so the data can be controlled-re-linked later. Use when the user must process EU personal/health data under GDPR, asks for pseudonymization vs anonymization, needs Art. 4(5) / Art. 9 / Recital 26 alignment, wants a reversible mapping/key vault held apart from the data, or needs controlled re-linkage. Covers openmed.deidentify(policy="gdpr_pseudonymization", keep_mapping=True), storing the mapping in a separate key vault, reidentify() for authorized re-linkage, and retention....

Why use Pseudonymizing For Gdpr on TypingMind?

Because you install it once and use it with any model. Pseudonymizing For Gdpr is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pseudonymizing For Gdpr in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maziyarpanahi/openmed/tree/master/skills/pseudonymizing-for-gdpr. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Pseudonymizing For Gdpr?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pseudonymizing For Gdpr?

As many as you like. As long as a model supports skills, you can use Pseudonymizing For Gdpr with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pseudonymizing For Gdpr AI skill free?

Yes. It is published on GitHub by maziyarpanahi under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇