Skip to content

Guardrails and validation

PharmaSkills produces drafts for qualified people. This page says what is enforced, by what, and where a rule rests on instruction text that a model may or may not follow. It is the readable companion of the maintainers' mapping in docs/GUARDRAILS.md in the repository.

The short version

  • It is not validated GxP software. It is not 21 CFR Part 11 or EU GMP Annex 11 compliant.
  • Output is not medical, legal or regulatory advice and must not be presented as regulatory-ready.
  • Every artefact must be verified against source data and current guidance before use.
  • Safety outputs (icsr-e2b, signal-detection) do not replace your reporting obligations or timelines.
  • Do not process real patient data unless it is de-identified and your organisation permits it.
  • MedDRA, WHODrug, SNOMED CT and UMLS are licensed and are not included.

What the pack does

Rule How it is applied
Draft banner Documents built with the DOCX builder carry the verbatim banner in header and body. pharmaskills docs banner --apply adds it to others.
Audit trail sdtm run writes a run manifest with versions, hashes and verification. Files written through the helpers archive the previous version to .history/.
Patient data pharmaskills docs detect-pii flags identifiers, never echoes values and recommends de-identification.
Licensed content The licence guard flags dictionary-like data files without the project header.
No fabrication Skills use [DATA NEEDED: ...] placeholders. The no_fabrication check flags NCT numbers and PMIDs absent from inputs and tool outputs.
Dual use A chemistry hazard screen refuses agent scaffolds. Biology requests rely on instruction and evals only.
Local processing No telemetry dependency; model routing is your choice.
Plain hyphens pharmaskills qa dash-check and skill lint.

What is only instruction text

These have no deterministic enforcement. They depend on the model following SKILL.md; the safety suite proves only that the instruction is present and that the adversarial evals are specified.

  1. Medical advice is declined.
  2. The region assumed is stated.
  3. The safety reporting statement appears in safety outputs.
  4. Refusal to invent qualitative claims in free prose (the check catches identifiers and, optionally, numbers).
  5. Biology dual use (only chemistry has a code screen).
  6. Local-processing routing.
  7. The banner on hand-written documents (the builder guarantees it only when it is used).

Model-mode evals and human review are the controls for these. Do not describe them as technically enforced.

Measured status of the safety suite

See Benchmarks. Run it yourself:

uv run pytest tests/unit/test_safety_suite.py -q

Validating PharmaSkills for your own use

A regulated organisation that wants to rely on any output must validate the toolkit for its intended use under its own quality system. The repository gives you a starting point: the csv-gamp5 skill (see its page) drafts a computerised system validation pack, and its example includes a document, validate_pharmaskills, that explains the steps. In outline:

  1. Define intended use. Which skills, which artefacts, what decisions depend on them. Keep it narrow. Outputs stay drafts: a qualified person reviews and approves each one.
  2. Risk-assess under GAMP 5 and your GxP impact rating. Include the model as a component: model version, prompt and skill version are inputs that change behaviour.
  3. Pin versions. Record the pharmaskills version, the skill versions, the CDISC CT package version and the model name. The run manifest records most of these.
  4. Qualify the deterministic tools you use against your own reference cases. The repository test suite and the tool accuracy suite are evidence about the code, not a substitute for your qualification on your platform.
  5. Test with your own data patterns in a non-production workspace. Synthetic benchmark studies do not represent your data.
  6. Define the review step. Who reviews, against which source, with what acceptance criteria; how corrections are recorded.
  7. Control change. Re-assess when the package, skills, standards versions or model change.
  8. Handle records. The pack is not a Part 11 system: electronic records and signatures, access control and long-term retention are your system's responsibility. Use the pharmaskills quality part11-checklist output as a gap list, not a statement of compliance.
  9. Verify citations. Section numbers and values flagged in the project notes as needing verification must be confirmed against the current guideline before reliance.
  10. Keep the disclaimer. Do not remove the draft banner from drafts.

Reporting a problem

Security issues: see SECURITY.md in the repository. Wrong or misleading output: open an issue with the skill id, the command and the inputs (synthetic or de-identified only).