auditing-part11-trails
它能做什么
这项技能构建并核查临床和试验流程所需的审计追踪,显示谁做了什么、何时做的,以及记录是否被修改。适合在临床试验等 FDA 监管环境中运行处理流程的团队。
适用场景
- ✓当 OpenMed 流程在受监管或经过验证的环境中运行,且每项操作都需要记录的时候。
- ✓当某个处理步骤需要包含其含义、签署人和时间戳的电子签名的时候。
- ✓当你必须核实已保存的审计追踪未被更改的时候。
技能链接
https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-part11-trails/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们的试验流程必须保留符合 21 CFR Part 11 要求的审计追踪。请进行设置,使每次运行都记录执行人和时间,并附上防篡改签名。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会为去标识化审计报告加上归属信息、时间戳和签名详情,并提供之后验证已保存追踪的方法。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Auditing 21 CFR Part 11 trails for OpenMed pipelines
In FDA-regulated GxP work (GCP clinical trials, GLP, GMP) any electronic record used to support a regulatory decision must meet 21 CFR Part 11: it has to be attributable (who), contemporaneous and time-stamped (when), describe what changed, be tamper-evident, and — where a signing event occurs — carry a controlled electronic signature. These map onto the ALCOA+ data-integrity expectations (Attributable, Legible, Contemporaneous, Original, Accurate, +Complete/Consistent/Enduring/Available).
OpenMed's deidentify(..., audit=True) already emits a deterministic,
PHI-free AuditReport that you can .sign() (HMAC-SHA256) and later
.verify(). That gives you the tamper-evidence and attribution primitives;
this skill wraps them in the who/when/what/e-signature envelope Part 11 wants.
This is a compliance-enablement aid. Part 11 compliance also requires validated systems (CSV), SOPs, and access controls that live outside any single library — a QA/validation lead signs off.
When to use
- OpenMed runs inside a validated/GxP environment and each run must leave an attributable, tamper-evident record.
- You need to wrap an OpenMed
AuditReportwith who/when/what + an e-signature manifestation (meaning, signer, timestamp). - You must verify a stored trail hasn't been altered, or produce CSV evidence for an inspection.
How OpenMed's AuditReport maps to Part 11
| Part 11 expectation | 21 CFR cite | OpenMed mechanism |
|---|---|---|
| Tamper-evident, accurate copies | 11.10(b),(c) | AuditReport.to_json() + repro_hash over the canonical payload |
| Audit trail: what changed, when | 11.10(e) | AuditReport.spans (action per identifier), input_hash/deidentified_text_hash, openmed_version, manifest_hash |
| Operational/authority checks; attribution | 11.10(d),(g) | AuditSignature.key_id (signer/key identity) + your envelope's user id |
| Signature manifestation (name, date, meaning) | 11.50 | Your envelope fields signer, signed_at, meaning |
| Signature/record linking, non-repudiation | 11.70, 11.200 | HMAC-SHA256 over the canonical payload via .sign() / .verify() |
The HMAC binds the signature to that exact report content: any later edit to a
span, hash, or field changes repro_hash, so .verify() fails — that is the
tamper-evidence.
Quick start
import openmed, json, datetime as dt
note = "Subject S-014 (DOB 1962-08-09) reported headache on 2024-05-01."
# 1) Produce the deterministic, PHI-free audit record for this processing step.
report = openmed.deidentify(note, policy="hipaa_safe_harbor", audit=True)
# 2) Sign it with a controlled release key (stored in a vault / HSM, never in code).
report.sign(b"<release-hmac-key>", key_id="omv-signer-2026")
# 3) Wrap in a Part 11 envelope: who / when / what / signature meaning.
trail = {
"record": report.to_dict(), # tamper-evident, no PHI
"who": "j.smith@sponsor.example", # authenticated user (your IdP)
"when": dt.datetime.now(dt.timezone.utc).isoformat(),
"what": "PHI de-identification of source narrative (study X, subject S-014)",
"signature_manifestation": { # 21 CFR 11.50
"signer_printed_name": "Jane Smith",
"meaning": "reviewed and approved",
"signed_at": dt.datetime.now(dt.timezone.utc).isoformat(),
},
"system": {"openmed_version": report.openmed_version,
"manifest_hash": report.manifest_hash},
}
with open("part11_trail.json", "w") as fh:
json.dump(trail, fh, indent=2, sort_keys=True)
# 4) Later — verify integrity (optionally bind to the exact source/output text).
ok = report.verify(b"<release-hmac-key>", original_text=note)
assert ok, "AUDIT TRAIL TAMPERED OR KEY MISMATCH"
Workflow
- Authenticate the actor in your own IdP/access system (Part 11 needs unique IDs and operational checks — outside the library). Capture the user id.
- Run the processing step with
audit=Trueto get the deterministic record. - Sign with a controlled release key from a vault/HSM; record
key_id. Never embed the key in source or the trail. - Build the Part 11 envelope — who, when (UTC, contemporaneous), what, and the signature manifestation (printed name, meaning, timestamp) per 11.50.
- Append, never overwrite. Store trails write-once (WORM / append-only store). The audit t
常见问题
这项技能本身能让我的系统合规吗?
不能。Part 11 合规还需要经过验证的系统、程序和访问控制,并需要质量负责人签字确认。
这些记录遵循什么标准?
记录围绕 ALCOA+ 数据完整性原则设计,例如可归属、同步记录。
它需要电子签名吗?
只有在发生签署事件的地方才需要。出现这类情况时,这项技能会涵盖相应的签名详情。
详情
作者的原始描述
Generates and verifies 21 CFR Part 11-style audit trails — who/what/when, electronic signatures, and tamper-evidence — for OpenMed pipelines in GxP and clinical-trial (GCP) settings. Use when the user runs OpenMed in a regulated/validated environment and needs an attributable, time-stamped, tamper-evident record of each processing action, electronic-signature manifestations, or computer-system-validation (CSV) evidence. Trigger keywords: 21 CFR Part 11, Part 11, audit trail, electronic signature, e-signature, GxP, GCP, GLP, GMP, CSV, computer system validation, data integrity, ALCOA, tamper-ev
repo: maziyarpanahi/openmed
热度
- GitHub 星标
- 5.8k
- 排名
- #14670
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
annotating-variants
5.8k帮你的智能体预测基因变异的作用,把 HGVS 名称转换为基因组位置,并使用免费的公共注释工具添加人群频率。
ask-openmed
5.8k帮你的智能体为临床文本请求选择合适的 OpenMed 工作流程,并在可能涉及患者数据时,先进行隐私检查。
assembling-fhir-bundles
5.8k把多份 FHIR 健康记录打包成一个事务 Bundle,可直接发送给 EHR 系统,并正确链接其中的内部引用。
auditing-deid-leakage
5.8k扫描已去标识化的临床文本,查找残留的标识符,例如社会安全号、银行卡号、电子邮件地址和日期,若仍有残留则阻止发布。