auditing-deidentification-runs
Skill này làm gì
Skill này tạo bản ghi tuân thủ cho mỗi lần khử nhận dạng, liệt kê những gì đã bị che và lý do, mà không lưu chính dữ liệu bệnh nhân. Dành cho các nhóm cần bằng chứng kiểm toán cho cơ quan quản lý hoặc rà soát nội bộ.
Khi nào nên dùng
- ✓Khi bạn cần bằng chứng tuân thủ cho thấy một lần khử nhận dạng đã thay đổi những gì.
- ✓Khi bạn phải giữ một bản ghi chống giả mạo cho kiểm toán HIPAA hoặc GDPR.
- ✓Khi người rà soát cần kiểm tra các quyết định khử nhận dạng mà không cần thấy dữ liệu cá nhân gốc.
Liên kết skill
https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-deidentification-runs/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy khử nhận dạng các ghi chú này kèm bản ghi kiểm toán để tôi lưu cho đợt rà soát HIPAA, và ký nó để mọi thay đổi có thể phát hiện được.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chạy khử nhận dạng ở chế độ kiểm toán, ký báo cáo kết quả bằng khóa do bạn kiểm soát, rồi lưu để sau này có thể kiểm tra tính toàn vẹn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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-spantext_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
- Run with
audit=Trueand apolicy=to get anAuditReport. - Inspect
residual_riskbefore releasing the output — non-zero projected leakage means review (cross-check withauditing-safe-harbor-checklist). - Sign with
report.sign(key, key_id=...)using a secret release HMAC key stored in a vault (never in the repo). - Persist
report.to_dict()(JSON). For a reviewer view without full context, usereport.export_review_bundle(). - Verify on retrieval with
report.verify(key). Passoriginal_text=/deidentified_text=to also confirm the texts match the recorded hashes. - Retain per your retention schedule alongside the de-identified output (but keep any reversible mapping separate and encrypted).
Hand-off to /
Câu hỏi thường gặp
Bản ghi có bao gồm tên bệnh nhân không?
Không. Báo cáo được thiết kế không chứa định danh dạng văn bản thuần, nên có thể lưu an toàn.
Sau này tôi kiểm tra bản ghi bằng cách nào?
Báo cáo đã ký có thể được xác minh tính toàn vẹn về sau, với tùy chọn liên kết tới đúng các văn bản gốc.
Nó chạy ở đâu?
Skill chạy trên thiết bị đang sử dụng, nên việc kiểm toán không phụ thuộc vào dịch vụ đám mây.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 5.8k
- Vị trí xếp hạng
- #14669
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
annotating-variants
5.8kGiúp agent dự đoán tác động của biến thể di truyền, đổi tên HGVS sang vị trí bộ gen và gắn tần suất quần thể bằng công cụ chú giải miễn phí.
ask-openmed
5.8kGiúp agent chọn đúng quy trình OpenMed cho yêu cầu về văn bản lâm sàng, luôn kiểm tra quyền riêng tư trước khi có thể có dữ liệu bệnh nhân.
assembling-fhir-bundles
5.8kGói nhiều bản ghi y tế FHIR thành một Bundle giao dịch để gửi tới EHR, với các tham chiếu nội bộ được liên kết đúng.
auditing-deid-leakage
5.8kQuét văn bản lâm sàng đã khử nhận dạng để tìm định danh còn sót như SSN, số thẻ, email và ngày tháng, và chặn phát hành nếu còn sót.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.