Pular para o conteúdo
Skillpedia
Segurança5,8 mil · #14669

auditing-deidentification-runs

O que ela faz

Esta skill produz um registro de conformidade de cada execução de desidentificação, listando o que foi redigido e o motivo, sem guardar os próprios dados do paciente. É para equipes que precisam de evidências de auditoria para reguladores ou revisão interna.

Quando usar

  • ✓Quando você precisa de evidências de conformidade que mostrem o que uma execução de desidentificação mudou.
  • ✓Quando precisa manter um registro à prova de adulteração para auditorias de HIPAA ou GDPR.
  • ✓Quando revisores precisam conferir decisões de desidentificação sem ver os dados pessoais originais.

Link da skill

https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-deidentification-runs/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-deidentification-runs/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Rode a desidentificação nestas notas com um registro de auditoria que eu possa guardar para a nossa revisão de HIPAA, e assine-o para que alterações sejam detectáveis.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente roda a desidentificação no modo de auditoria, assina o relatório resultante com uma chave que você controla e o salva para que sua integridade possa ser verificada depois.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Auditing de-identification runs

deidentify(..., audit=True) returns an AuditReport instead of the rewritten text: a deterministic, PHI-free record of every redaction decision — offsets, label, detector confidence and threshold, the action taken, content hashes, model provenance, and projected residual risk. Sign it to make it tamper-evident, retain it as compliance evidence, and verify it later without ever touching the original text. Runs on-device.

When to use this skill

Use it whenever a de-identification needs to be defensible: regulatory retention, internal review, reproducibility checks, or proving to an auditor that identifiers were detected and handled — all without storing or exposing the PHI itself.

Quick start

import openmed

note = "Patient John Doe (MRN 1234567) seen 2024-03-02. SSN 123-45-6789."

# Returns an AuditReport, NOT a DeidentificationResult, when audit=True.
report = openmed.deidentify(note, policy="hipaa_safe_harbor", audit=True)

# Make it tamper-evident with a release HMAC key (keep the key in a vault).
report.sign(b"my-release-hmac-key", key_id="release-2026")

# Persist the no-PHI report (no plaintext identifiers inside).
import json
with open("deid_audit.json", "w") as fh:
    json.dump(report.to_dict(), fh, indent=2)

# Later: verify integrity. Optionally bind to the exact texts via their hashes.
ok = report.verify(b"my-release-hmac-key", original_text=note)
assert ok

What an AuditReport contains

AuditReport (from openmed.core.audit) carries no plaintext PHI. Key fields:

Field Meaning
policy policy profile name in effect
resolved_profile the concrete settings applied (method, model, thresholds, language, sweep flags)
detectors list[DetectorInfo] — provenance of each detector
safety_sweep structured-ID sweep metadata (patterns version, source)
spans list[AuditSpan] — one entry per detected identifier
thresholds per-label confidence thresholds used
residual_risk projected leakage / re-identification risk summary
openmed_version library version that produced the report
manifest_hash hash of the model manifest used
document_length character length of the input
input_hash sha256: hash of the original text
deidentified_text_hash sha256: hash of the de-identified output
repro_hash deterministic hash over the canonical payload
signature AuditSignature once .sign() is called (else None)

AuditSpan (per identifier, no plaintext): start, end, label, canonical_label, sources, confidence, threshold, action, surrogate, text_hash (hash of the span text), plus evidence and a redacted context.

DetectorInfo: source, model_id, model_format, commit, metadata.

AuditSignature: key_id, algorithm (HMAC-SHA256), value (hex digest).

Why audits store offsets + hashes + provenance, never plaintext

The whole point of de-identification is to not retain identifiers. An audit log full of raw names and MRNs would itself be a PHI breach. So OpenMed records:

  • offsets (start/end) — where an identifier was, not what it was;
  • hashes (input_hash, deidentified_text_hash, per-span text_hash) — prove what was processed without revealing it;
  • provenance (detectors, manifest_hash, openmed_version) — which model/version made each call, for reproducibility;
  • residual risk (residual_risk) — projected leakage so a reviewer can judge whether the output is safe to release.

This lets an auditor confirm coverage and integrity while the report stays shareable.

Workflow

  1. Run with audit=True and a policy= to get an AuditReport.
  2. Inspect residual_risk before releasing the output — non-zero projected leakage means review (cross-check with auditing-safe-harbor-checklist).
  3. Sign with report.sign(key, key_id=...) using a secret release HMAC key stored in a vault (never in the repo).
  4. Persist report.to_dict() (JSON). For a reviewer view without full context, use report.export_review_bundle().
  5. Verify on retrieval with report.verify(key). Pass original_text= / deidentified_text= to also confirm the texts match the recorded hashes.
  6. Retain per your retention schedule alongside the de-identified output (but keep any reversible mapping separate and encrypted).

Hand-off to /

Perguntas frequentes

O registro inclui nomes de pacientes?

Não. O relatório é feito para não conter identificadores em texto puro, para que possa ser guardado com segurança.

Como verifico o registro depois?

O relatório assinado pode ser verificado quanto à integridade depois, com um link opcional para os textos exatos.

Onde ela roda?

A skill roda no dispositivo onde é usada, então a auditoria não depende de um serviço na nuvem.

Detalhes

Descrição original do autor

Produce a signed, reproducible, no-PHI audit trail for an OpenMed de-identification run via deidentify(audit=True). Use when the user needs compliance evidence, a tamper-evident record of what was redacted and why, to verify nothing was changed, to retain proof for HIPAA/GDPR audits, or to review de-id decisions without exposing plaintext PHI. Covers the AuditReport / AuditSignature / AuditSpan / DetectorInfo fields, why audits store offsets+hashes+provenance+residual-risk and never plaintext, signing with .sign(key), and verifying with .verify(key). Pairs with OpenMed deidentifying-clinical-t

repo: maziyarpanahi/openmed

Popularidade

Estrelas no GitHub
5,8 mil
Posição no ranking
#14669
Licença
Apache-2.0
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas