Auditing Part11 Trails logo

Auditing Part11 Trails

CommunityPopular
maziyarpanahi
auditing-part11-trails

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-evident, contemporaneous. Pairs adjacent to OpenMed: maps directly onto OpenMed deidentify(audit=True) -> signed AuditReport with .sign(key)/.verify(key), whose repro_hash + HMAC give the tamper-evidence and attribution Part 11 expects. This is a compliance-enablement aid, not a validation certification.

Overview

Publishermaziyarpanahi
Repositoryopenmed
Skill nameauditing-part11-trails
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 Auditing Part11 Trails 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/auditing-part11-trails .claude/skills/auditing-part11-trails
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Auditing Part11 Trails 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 Auditing Part11 Trails 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 Auditing Part11 Trails 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.

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 AuditReport with 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 expectation21 CFR citeOpenMed mechanism
Tamper-evident, accurate copies11.10(b),(c)AuditReport.to_json() + repro_hash over the canonical payload
Audit trail: what changed, when11.10(e)AuditReport.spans (action per identifier), input_hash/deidentified_text_hash, openmed_version, manifest_hash
Operational/authority checks; attribution11.10(d),(g)AuditSignature.key_id (signer/key identity) + your envelope's user id
Signature manifestation (name, date, meaning)11.50Your envelope fields signer, signed_at, meaning
Signature/record linking, non-repudiation11.70, 11.200HMAC-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

python
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

  1. Authenticate the actor in your own IdP/access system (Part 11 needs unique IDs and operational checks — outside the library). Capture the user id.
  2. Run the processing step with audit=True to get the deterministic record.
  3. Sign with a controlled release key from a vault/HSM; record key_id. Never embed the key in source or the trail.
  4. Build the Part 11 envelope — who, when (UTC, contemporaneous), what, and the signature manifestation (printed name, meaning, timestamp) per 11.50.
  5. Append, never overwrite. Store trails write-once (WORM / append-only store). The audit trail itself must be protected and retained.
  6. Verify on retrieval with .verify(key, original_text=..., deidentified_text=...) to confirm neither the record nor the bound texts changed.
  7. Retain per the study/retention schedule; keep keys and any reversible mapping in a separate, access-controlled store.

Hand-off to / from OpenMed

  • Produce the record: auditing-deidentification-runs (deidentify(audit=True)AuditReport) is the source of the signed, PHI-free trail this skill envelopes.
  • Coverage evidence: auditing-safe-harbor-checklist documents that the 18 identifier categories were handled — useful as a CSV artifact.
  • No-PHI logging: enforcing-nophi-logging ensures the surrounding application logs don't leak identifiers into the trail.
  • HIPAA overlap: checking-hipaa-compliance — Part 11 audit controls and the HIPAA Security Rule audit-controls standard (164.312(b)) reinforce each other.
  • OpenMed runs on-device, so the record-generating step stays inside your validated boundary.

Edge cases & gotchas

  • Part 11 ≠ one library. The signed AuditReport gives tamper-evidence and attribution, but Part 11 also requires validated systems (CSV), SOPs, training, and access controls you implement around it. Don't claim "Part 11 compliant" from the audit object alone.
  • Unsigned = not tamper-evident. .sign() is a deliberate step; signature is None until called. Empty/None keys are rejected.
  • Key management is the crux. The HMAC is only as trustworthy as the key. Use a vault/HSM, rotate via key_id, and never store the key with the trail.
  • Contemporaneous timestamps. Use a synchronized, trusted clock (UTC) at the moment of the action — back-dating breaks ALCOA "Contemporaneous".
  • Append-only retention. A trail you can silently overwrite isn't an audit trail. Use WORM/append-only storage and protect it from the operators it audits.
  • No PHI in the envelope. The AuditReport is hash-and-offset only; don't reintroduce identifiers in the what/who free-text fields.
  • HMAC is symmetric. It proves integrity to holders of the key, not public non-repudiation. If you need third-party non-repudiation, layer an asymmetric signature over report.to_json().

Standards & references

Frequently asked questions

What does the Auditing Part11 Trails AI skill do?

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...

Why use Auditing Part11 Trails on TypingMind?

Because you install it once and use it with any model. Auditing Part11 Trails 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 Auditing Part11 Trails in TypingMind?

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

Which AI models can use Auditing Part11 Trails?

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 Auditing Part11 Trails?

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

Is the Auditing Part11 Trails 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 👇