auditing-part11-trails
What it does
This skill builds and checks the audit trails that regulated clinical and trial pipelines need, showing who did what, when, and whether the record was changed. It is for teams running processing in FDA-regulated settings such as clinical trials.
When to use it
- βWhen an OpenMed pipeline runs in a regulated or validated environment and each action must be recorded.
- βWhen a processing step needs an electronic signature with its meaning, signer and timestamp.
- βWhen you must check that a stored audit trail has not been changed.
Skill link
https://github.com/maziyarpanahi/openmed/blob/master/skills/auditing-part11-trails/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βOur trial pipeline must keep an audit trail that meets 21 CFR Part 11. Set it up so each run records who ran it and when, with tamper-evident signatures.β
5 new skills a week. 1 minute to read.
How it works
The agent wraps the de-identification audit report with attribution, timestamp and signature details, and provides a way to verify the stored trail later.
Technical content (original SKILL.md)
Original text by the author, straight from 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
FAQ
Does this make my system compliant by itself?
No. Part 11 compliance also needs validated systems, procedures and access controls, which a quality lead must sign off.
What standard do the records follow?
The records are designed around ALCOA+ data integrity principles, such as being attributable and contemporaneous.
Does it need an electronic signature?
Only where a signing event happens. The skill covers those signature details when they apply.
Details
Original description by the author
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
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14670
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
annotating-variants
5.8kHelps your agent predict what a genetic variant does, convert HGVS names to genome positions and attach population frequencies, using free public annotators.
ask-openmed
5.8kHelps your agent pick the right OpenMed workflow for a clinical text request, starting with a privacy check whenever patient data may be present.
assembling-fhir-bundles
5.8kPackages several FHIR health records into one transaction Bundle ready to send to an EHR, with the internal references linked correctly.
auditing-deid-leakage
5.8kScans de-identified clinical text for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if any remain.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.