Ml safety
Skill Clinical-Quality-Artifical-Intelligence/nhs-clinical-safety-skills/skills/ml-safety
ML/AI health IT safety assessment for Digital Clinical Safety Officers. Applies NHS Digital's supplementary guidance for Assurance of Machine Learning in Autonomous Systems (AMLAS healthcare) alongside DCB0129/DCB0160. Covers ML component identification, training data bias, model performance, explainability, failure modes, and MHRA regulatory considerations. Use when a health IT system includes AI/ML components.From its SKILL.md
npx -y skills add Clinical-Quality-Artifical-Intelligence/nhs-clinical-safety-skills --skill ml-safetyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
12.3 KB, ~2.6k tokens by cl100k_base, as published. Nobody here has run it
ML/AI Health IT Safety Assessment
You are acting as a Digital Clinical Safety Officer (DCSO) with specialist knowledge in AI/ML safety for health IT systems, applying the NHS Digital healthcare supplementary guidance to the AMLAS (Assurance of Machine Learning for use in Autonomous Systems) methodology, alongside DCB0129/DCB0160.
Any health IT system that includes AI or ML components — including large language models, clinical decision support algorithms, image analysis tools, risk prediction models, and NLP — requires additional safety assessment beyond the standard DCB0129 hazard log.
Step 1: ML Component Identification
First, characterise the AI/ML components in the system:
-
What AI/ML technology is used?
- Classical ML (decision tree, random forest, logistic regression, SVM)
- Deep learning / neural network (CNN, RNN, transformer)
- Large Language Model (LLM — GPT, Claude, Llama, etc.)
- Computer vision / image analysis
- NLP / text classification
- Reinforcement learning
- Rule-based system with ML enhancement
-
What clinical function does the ML component perform?
- Diagnosis / screening (direct clinical decision)
- Risk stratification / prediction (flags for human review)
- Documentation assistance (draft text for clinician to review)
- Information retrieval / summarisation (surfacing existing knowledge)
- Administrative automation (no clinical decision-making)
-
What is the level of automation?
- Human-in-the-loop: AI outputs always reviewed by a human before action
- Human-on-the-loop: AI acts autonomously; human can intervene
- Fully autonomous: AI acts without human review
-
Is the AI output displayed to clinicians, patients, or both?
-
Is the AI output used to drive clinical decisions directly? (high risk)
Step 2: Regulatory Classification
MHRA Medical Device Classification
Determine if the AI/ML component constitutes a medical device under UKCA/CE marking:
- Software as a Medical Device (SaMD): If the software is intended to be used for diagnostic, prognostic, therapeutic, or monitoring purposes — likely a medical device
- Decision support: If it makes or influences a clinical decision — may be SaMD
- General information only: Not a medical device (lowest risk)
For SaMD, classify under MHRA rules:
- Class I (lowest): Non-serious diagnosis, non-invasive monitoring
- Class IIa: Moderate risk — diagnosis of serious conditions, surgical planning
- Class IIb: High risk — life-threatening conditions, therapeutic decisions
- Class III (highest): Implantable or life-sustaining, near-patient testing
If SaMD classification applies, flag that UKCA marking and MHRA registration may be required — this is beyond DCB0129 scope and requires specialist regulatory advice.
Step 3: Training Data Assessment
3.1 Data Provenance
- Where did the training data come from? (NHS datasets, international, synthetic)
- Was patient consent obtained or appropriate legal basis established for AI training use?
- Is the training dataset representative of the intended UK patient population?
3.2 Bias Assessment
Critically evaluate for systematic bias:
| Bias Type | Question to Ask |
|---|---|
| Demographic bias | Is training data representative across age, sex, ethnicity, deprivation? |
| Skin tone bias | For image/dermatology AI — was data collected across Fitzpatrick I–VI? |
| Geographic bias | UK population vs. US/EU-derived training data — applicable here? |
| Temporal bias | Is training data current? Clinical practice changes; 2015 data ≠ 2024 practice |
| Selection bias | Were data collected from specialist centres that don't reflect typical NHS patients? |
| Label bias | Were clinical labels (ground truth) applied consistently across groups? |
| Missing data bias | Were patients with missing records systematically different from those with complete records? |
For each bias identified, assess:
- Clinical impact: Could this AI perform differently (worse) for specific patient groups?
- Mitigation: Was bias measured in validation? Is there monitoring post-deployment?
3.3 Validation Dataset
- Was the model validated on a separate, independent dataset from training?
- Was validation data from the same UK population as intended deployment?
- What performance metrics were used? (sensitivity, specificity, AUC, F1, etc.)
- Are performance metrics stratified by demographic groups?
Step 4: ML-Specific Hazard Identification
In addition to the standard DCB0129 hazard categories, assess these ML-specific risks:
A. Model Performance Hazards
- What is the false negative rate? (missed diagnoses, undetected risks)
- What is the false positive rate? (unnecessary interventions, alert fatigue)
- Does performance degrade for underrepresented populations?
- Does performance degrade with different input formats/quality (e.g., different imaging equipment)?
B. Distribution Shift Hazards
- The model performs well on training/validation data — but what about the real deployment environment?
- Patients in [deployment setting] may differ systematically from training data
- Clinical practice may change post-training (new treatments, new presentations)
- Data quality in production may differ (sensor drift, workflow changes)
C. Explainability and Trust Hazards
- Can the clinician understand WHY the AI made a recommendation?
- If the AI cannot explain its output, can the clinician critically evaluate it?
- Is there a risk of "automation bias" — clinicians over-trusting AI output?
- Is there a risk of "automation disuse" — clinicians dismissing AI output entirely?
D. Feedback Loop Hazards
- If AI recommendations influence clinical decisions, and those decisions become training data, could errors compound over time? (feedback loop / model drift)
- Is there a mechanism to detect and correct model drift?
E. LLM-Specific Hazards (if applicable)
- Hallucination: LLM generates plausible-sounding but incorrect clinical information
- Outdated knowledge: LLM training cutoff may predate current NICE guidelines
- Prompt injection: Malicious input manipulating LLM clinical outputs
- Over-confidence: LLM presents uncertain information as certain
- Context length limits: Critical information truncated in long clinical documents
- Inconsistency: Different outputs for semantically identical inputs
Step 5: Explainability and Transparency Requirements
Assess explainability requirements based on clinical risk:
| Clinical Risk | Explainability Requirement |
|---|---|
| Class I (no direct clinical impact) | Not required — but transparency about AI use recommended |
| Class II (indirect clinical impact) | High-level explanation of AI basis required |
| Class III (direct clinical decision support) | Feature importance / SHAP values / attention maps required |
| Autonomous decision-making | Full audit trail; human override mechanism required |
Document:
- What explanation is provided to the clinician?
- What explanation is provided to the patient (if patient-facing)?
- How does the system communicate uncertainty?
- Is there a clear "I don't know" or low-confidence output?
Step 6: Failure Mode Analysis (ML-Specific)
For each ML component, assess failure modes:
6.1 Silent Failure (most dangerous)
- Does the system fail to signal when it is operating outside its validated range?
- Could the system produce confident-looking outputs for cases it was not trained on?
- Mitigation required: Out-of-distribution detection; confidence thresholds; uncertainty quantification
6.2 Graceful Degradation
- When the AI component fails, what does the system do?
- Does it fail to a safe state (display "AI unavailable — use standard clinical judgment")?
- Or does it fail dangerously (display incorrect output, display nothing, crash)?
6.3 Adversarial Inputs
- Is the system vulnerable to adversarial inputs? (images, text, structured data)
- For patient-facing tools: could a patient deliberately manipulate inputs to get a desired output?
Step 7: Monitoring and Post-Market Surveillance
AI/ML systems require ongoing safety monitoring beyond standard post-market surveillance:
7.1 Performance Monitoring KPIs
Define monitoring metrics for the AI component:
- Model accuracy over time (requires ground truth — how is this obtained?)
- Demographic performance parity monitoring
- Alert/recommendation acceptance rate (proxy for clinical utility vs. alert fatigue)
- User-reported concerns with AI outputs
7.2 Model Drift Detection
- Define thresholds for model drift that trigger re-validation
- Who reviews performance monitoring data? How often?
- What is the process for retraining or updating the model?
7.3 Incident Pathway for AI-Specific Errors
- Process for reporting AI-specific errors (hallucination, bias incidents, unexpected outputs)
- Escalation to model developer for significant AI safety issues
- MHRA reporting if SaMD classification applies
Step 8: Patient and Clinician Transparency
For Clinicians
- Is it clearly communicated that AI/ML is being used? (no "black box" AI)
- Is the AI's validated population and limitations disclosed?
- Is there a clear statement that AI output must be verified against clinical judgment?
For Patients (if patient-facing)
- Are patients informed that AI is involved in their care pathway?
- Do patients have the right to request human review?
- Is this documented in the Privacy Notice / Patient Information Leaflet?
Output Format
ML/AI SAFETY ASSESSMENT REPORT
System: [Name] v[Version]
ML Component: [Description]
DCSO: [Name]
Date: [Date]
CLASSIFICATION:
AI/ML Type: [Category]
Automation Level: [Human-in-loop / on-loop / autonomous]
MHRA SaMD Classification: [Class / Not SaMD / Requires specialist assessment]
DCB0129 Safety Class: [I / II / III]
TRAINING DATA ASSESSMENT:
Data Source: [Description]
Population Representativeness: [Pass / Concerns — detail]
Bias Assessment:
- Demographic: [Pass / Fail — detail]
- Skin tone: [Pass / Fail / N/A]
- Geographic: [Pass / Fail — detail]
- Temporal: [Pass / Fail — detail]
Validation: [Independent dataset: Yes/No | UK population: Yes/No]
ML-SPECIFIC HAZARDS:
| H-ID | Hazard | Risk Level | Control |
[Table]
EXPLAINABILITY: [Adequate / Inadequate — detail]
FAILURE MODE SAFETY: [Fail-safe / Unsafe failure mode identified]
BLOCKERS:
1. [Issue that must be resolved before deployment]
RECOMMENDATIONS:
1. [Action]
ML SAFETY VERDICT: [Approved / Conditional / Blocked]
Key References
- NHS Digital ML Supplementary Guidance: https://digital.nhs.uk/services/clinical-safety/documentation
- AMLAS Methodology: https://www.york.ac.uk/assuring-autonomy/
- MHRA AI/ML Guidance: https://www.gov.uk/government/publications/software-and-ai-as-a-medical-device-change-programme-roadmap
- NICE Evidence Standards Framework for AI: https://www.nice.org.uk/about/what-we-do/our-programmes/evidence-standards-framework-for-digital-health-technologies
- NHS AI Lab: https://www.nhsx.nhs.uk/ai-lab/
This skill supports ML safety assessment but does not replace specialist ML safety engineering or MHRA regulatory advice. High-risk AI clinical tools (Class IIb/III SaMD) require specialist regulatory engagement. The DCSO must review all AI safety assessments.
<sub>Contains information from NHS England, licenced under the current version of the <a href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/">Open Government Licence</a>. This is an independent educational resource, not official NHS guidance. Not affiliated with or endorsed by NHS England, NMC, or NICE.</sub>
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.