Skip to main content Switch to mobile version medharness 0.95.1 Change-control gate for AI-written medical-device software (IEC 62304)
pip install medharness==0.95.1 Copy PIP instructions
A change-control gate for medical-device software written with AI coding agents. Your agent writes the code and the design record that IEC 62304 asks for; ordinary code — never a model — checks that the two agree before a change can merge.
IEC 62304 asks that every change to medical-device software leave design-control evidence: the requirements, risks, design and tests it touched, each traced to the next, in a Design History File (DHF). With an AI agent writing the code, that evidence has two usual sources, and neither holds up:
Written by people after the fact. Slow and expensive, and it drifts from the code.
Generated by the agent along the way. Cheap, but nobody can be sure it is complete or true.
MedHarness keeps the DHF in your git repository, one YAML file per item, and checks it the way a build is checked: by code, on the branch, before the merge.
A change request (CR) declares what it changes. The check compares that with what the branch did. Here the branch edited a requirement the CR did not list, and a design that depends on it was neither updated nor reviewed:
$ medharness verify impact --cr CR-004 FAIL [impact] CR-004: the branch changes SRS-001 since main, which it does not list in affected_items. Fix: Add them: medharness item update CR-004 --data '{"affected_items": [...]}' — or revert the changes this CR should not make. FAIL [impact] SWDD-001: depends on SRS-001, which this branch changes, but is neither changed nor listed in CR-004's reviewed_items. Fix: Update SWDD-001 to follow the change, or if it needs none run `medharness item update CR-004 --data '{"reviewed_items": [..., "SWDD-001"]}'`. The same family of checks stops a requirement with no passing test, a link to an item that does not exist, and a SOUP component the register does not list. Every failure names the item and the field to fix.
The AI's analysis is not trusted: it is checked by code, which gives the same result for the same input.
The seeded-omission set stops 12 of 15 ways of leaving something out of a change.
The three it misses: test points left unchanged (a warning only), a new hazard linked to nothing, and a verifying test weakened. What each check compares, and what the reviewer reads in every change request, is in trust.md; to run the set on your machine, see validating your installation.
A DHF that agrees with the code, because the check runs on the branch, in the review that merges it.
Release evidence generated, not assembled: the specifications, a traceability report for each matrix, the test evidence, a software BOM and a CycloneDX SBOM, a manifest hashing every file, and, when you sign, an approval sheet of who approved which documents.
An AI agent whose change can be challenged: whether a CR's declared impact is complete is checked by code, and the agent's design is reviewed by you before any code is written.
Small teams (one to ten people) building medical software with AI coding agents, with little quality or regulatory capacity of their own, and the auditors who read what they produce. It covers IEC 62304 and the part of ISO 14971 that a change touches.
It is not a quality management system (no CAPA, training, suppliers or complaints), it does not judge whether a clinical or risk conclusion is right (it makes the conclusion visible and open to challenge), and it has no editing UI. charter.md has the promises and the non-goals.
flowchart LR A["1 · Design
AI drafts the design"] -->|"you review"| B["2 · Code
AI codes and tests"] B -->|"you review"| C(["Merge"]) For each change request, the agent designs first — it assesses the change's risk, then writes the requirements, design and test points it needs as items in the DHF, each traced to the next — and codes second, tagging each test with the requirement it verifies. You review the design, then the code. Between them, the checks confirm that the design traces, every requirement is verified, and the branch changed what the request said.
init writes an AGENTS.md (and a CLAUDE.md that imports it) telling your agent when to open a change request and which commands to run; it reads and writes the DHF through medharness item, which refuses a bad edit. What to call when is in Working with your coding agent.
At your desk, with the agent you already use: it works in your tree and you commit.
Unattended, from an issue: CI opens the change request and a pull request with the design, revises on review, then does the code the same way (recipe). This runs an agent with a shell: use an ephemeral runner and read ai-security.md first.
Python 3.11 or newer.
pip install medharness # or `pipx install medharness`, to keep it out of the project's environment mkdir my-device && cd my-device medharness init # writes DHF/ with sample items, and AGENTS.md for your agent To run it without installing: uvx medharness init, then uvx medharness verify dhf.
Then ask your coding agent: "open a CR for PDF export and implement it". Or use the checks alone, with no AI: medharness verify dhf checks that the design holds together.
New here? The ten-minute tutorial walks one change through the gate.
What a project looks like
my-device/ ├── DHF/ │ ├── config/global.yaml # the project name — and only what you change │ └── items/ # one YAML file per item, one directory per type │ ├── 01_crs/CRS-001.yaml │ ├── 03_srs/SRS-001.yaml │ └── … ├── AGENTS.md # product context and DHF steps, for any coding agent └── CLAUDE.md # @AGENTS.md, so Claude Code reads it too The item types, their lifecycles and the specification templates ship in the package; a project overrides only what it changes (configuration.md). An item is a small YAML file, with links written on the child and pointing up:
id: SRS-012 title: Password must be at least 12 characters derives_from: [SYS-004] verification_method: [Test] testing: | T1: an 11-character password is rejected One CLI, medharness, in four groups: item reads and changes items, verify checks and writes nothing, build produces items, code and release artifacts, init scaffolds. What each command does, prints and exits with is in interface.md; --help lists its options.
ContourLab is a browser-based contouring workspace for radiation oncology on which MedHarness is exercised end to end; its DHF and CI are a worked example.
Released: Nov 30, 2026
Author: MedHarness Contributors
Both files in this release have provenance metadata.
View provenance details
medical-device iec-62304 iso-14971 iec-82304-1 dhf design-history-file traceability compliance samd
Development Status 4 - Beta
Intended Audience Developers
License OSI Approved :: MIT License
Operating System OS Independent
Programming Language Python :: 3 :: Only
Topic Software Development :: Quality Assurance
Release files for medharness 0.95.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 496.2 kB
Release files / medharness-0.95.1.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Release files / medharness-0.95.1-py3-none-any.whl
Security for medharness 0.95.1
Both files in this release have been uploaded with provenance metadata.
With provenance medharness-0.95.1.tar.gz Nov 30, 2026
With provenance medharness-0.95.1-py3-none-any.whl Nov 30, 2026
Attestation for medharness-0.95.1.tar.gz
Attestation for medharness-0.95.1-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 1, 2026 2 release files Full provenance
Nov 30, 2026 2 release files Full provenance
Nov 29, 2026 2 release files Full provenance
Nov 19, 2026 2 release files Full provenance
Nov 13, 2026 2 release files Full provenance
Nov 12, 2026 2 release files Full provenance
Nov 11, 2026 2 release files Full provenance
Nov 9, 2026 2 release files Full provenance
Nov 8, 2026 2 release files Full provenance
Nov 7, 2026 2 release files Full provenance
Nov 5, 2026 2 release files Full provenance
Oct 28, 2026 2 release files Full provenance
Oct 24, 2026 2 release files Full provenance
Oct 20, 2026 2 release files Full provenance
Oct 19, 2026 2 release files Full provenance
Oct 18, 2026 2 release files Full provenance
Oct 17, 2026 2 release files Full provenance
Oct 16, 2026 2 release files Full provenance
Oct 15, 2026 2 release files Full provenance
Oct 13, 2026 2 release files Full provenance
Oct 10, 2026 2 release files Full provenance
Oct 9, 2026 2 release files Full provenance
Oct 8, 2026 2 release files Full provenance
Oct 6, 2026 2 release files Full provenance
Oct 4, 2026 2 release files Full provenance
Oct 3, 2026 2 release files Full provenance
Oct 2, 2026 2 release files Full provenance
Sep 30, 2026 2 release files Full provenance
Sep 28, 2026 2 release files Full provenance
Sep 27, 2026 2 release files Full provenance
Sep 26, 2026 2 release files Full provenance
Sep 18, 2026 2 release files Full provenance
Sep 17, 2026 2 release files Full provenance
Sep 16, 2026 2 release files Full provenance
Sep 15, 2026 2 release files Full provenance
Sep 14, 2026 2 release files Full provenance
Sep 13, 2026 2 release files Full provenance
Sep 12, 2026 2 release files Full provenance
Sep 11, 2026 2 release files Full provenance
Sep 9, 2026 2 release files Full provenance
Sep 8, 2026 2 release files Full provenance
Sep 7, 2026 2 release files Full provenance
Sep 6, 2026 2 release files Full provenance
Sep 3, 2026 2 release files Full provenance
Sep 2, 2026 2 release files Full provenance
Aug 23, 2026 2 release files Full provenance
Aug 19, 2026 2 release files Full provenance
Aug 18, 2026 2 release files Full provenance
May 30, 2026 2 release files Full provenance
May 21, 2026 2 release files Full provenance
May 19, 2026 2 release files Full provenance
May 17, 2026 2 release files Full provenance
May 16, 2026 2 release files Full provenance
May 15, 2026 2 release files Full provenance
May 14, 2026 2 release files Full provenance
May 13, 2026 2 release files Full provenance
May 12, 2026 2 release files Full provenance
May 10, 2026 2 release files Full provenance
May 9, 2026 2 release files Full provenance
May 8, 2026 2 release files Full provenance
May 6, 2026 2 release files Full provenance
May 5, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from a8e35ed











