Quality reviewer validating AI-assisted SaMD development with Human-in-the-Loop approval gates
RegulatorikManaged Delivery
8 min readRegulatorik · Managed Delivery

Human in the Loop: Process Design for AI-Assisted SaMD

AI coding assistants can accelerate SaMD development. Conformity depends on defined human gates, end-to-end traceability and verification capacity that grows alongside code generation.

Share:

AI coding assistants and agentic development tools have arrived in software engineering, including among manufacturers of Software as a Medical Device, or SaMD. Expectations of rapid efficiency gains now meet a differentiated evidence base. McKinsey reports that almost 30% of companies saw productivity decline after introducing agentic AI tools [1]. At the same time, a small group achieves clear quality and speed gains. Their lever is consistent process redesign [2].

For SaMD manufacturers, the message is clear: the regulatory risk does not lie in AI-generated code itself. It lies in a development process designed for human authorship that merely adds AI on top. Human in the Loop needs to be embedded as a defined decision architecture in the quality management system.

Executive Summary

Key findingImplication for manufacturers
More code does not mean more conforming software.Verification capacity becomes the bottleneck and must scale with generation capacity.
Standards do not distinguish by authorship.AI-generated code remains fully subject to IEC 62304, ISO 14971 and IEC 81001-5-1.
AI tools are computerised systems within the QMS.Risk-based validation under ISO 13485 is required.
Value comes from process design, not tool rollout.Roles, approval gates and evidence records need redesign.

1. The productivity paradox: more code, not more software

The gap between activity and outcome is now well documented. McKinsey cites a study in which AI tools increased coding activity by 180%, while shipped releases rose by only 30% [1]. Acceptance among developers also remains limited. Globally, 46% of developers distrust the accuracy of AI tools, 33% trust them and only 3% report high trust in their results [1].

That scepticism has a technical basis. A CodeRabbit analysis of 470 open-source pull requests, including 320 AI co-authored and 150 created solely by humans, reported the following findings [3]:

Defect categoryAI co-authored code compared with human codeRelevance for SaMD
Issues overallAround 1.7 times higherHigher review and verification workload
Logic and correctness75% more frequentDirect connection to patient safety
Security vulnerabilitiesUp to 2.74 times higherIEC 81001-5-1, MDR Annex I Section 17.2
Error handlingGaps almost twice as frequentResilience against misuse and exceptional conditions

The study did not directly confirm authorship. It identified AI involvement through pull request signals and assumed human authorship for the remaining pull requests [3]. The direction of the finding remains important. Missing null checks, guardrails and complete exception handling are critical in safety-relevant medical device software.

2. What does not change from a regulatory perspective

Manufacturers do not need a new legal framework. They need consistent application of the existing one. IEC 62304 defines lifecycle requirements for medical device software. The standard does not assess who wrote a line of code. It assesses whether requirements, architecture, verification and release are controlled and traceable [14]. The Johner Institute has made the same point for conventional code generators: generated code can undergo the same quality assurance measures as handwritten code [4].

There is also a tooling layer. LLM-based systems count as computerised systems. Where manufacturers use them in QMS processes, they fall under ISO 13485 requirements [5]. The object of validation is not the model as an abstract technology. It is the computerised system in its defined intended use, context and data flow. Validation effort is set on a risk basis.

Using a coding assistant does not automatically make a SaMD an AI system under Regulation (EU) 2024/1689. The decisive question is whether the product itself contains AI functionality. For AI-based medical devices, the MDR or IVDR and AI Act apply in a complementary way. The joint AIB and MDCG guidance recommends integrating necessary testing, reporting and documentation processes into existing MDR or IVDR procedures wherever appropriate [13].

Standardisation will not provide near-term relief. According to the Johner Institute, the next milestone for IEC 62304 is expected to be a second Committee Draft, rather than the second edition. An FDIS is expected only in 2028 and publication no earlier than 2029 [6]. The draft contains an informative annex on AI-enabled health software [7]. Manufacturers should therefore establish their answers in the QMS now.

3. Human in the Loop in practice: where people decide

Human in the Loop is often understood as the broad idea that a developer checks the output. The approach becomes regulatory robust only when the organisation defines which qualified person takes which decision at which lifecycle point and how that decision is documented. The European Commission explicitly identifies human oversight as a requirement for high-risk AI in healthcare [12].

Decision pointWhy it must remain humanStandard reference
Software requirementsIntended purpose, clinical context and risk controls remain the manufacturer's responsibility.IEC 62304, 5.2; ISO 14971
Architecture and segregationSafety classification and component boundaries determine the full scope of evidence.IEC 62304, 5.3
SOUP selectionAI tools suggest libraries. Their risk and maintenance status require assessment.IEC 62304, 5.3.3 and 5.3.4; IEC 81001-5-1
Risk analysis of new code pathsAI can create plausible yet unspecified behaviours.ISO 14971; IEC 62304, Section 7
Code review and acceptance criteriaSoftware units are verified against defined criteria.IEC 62304, 5.5
ReleaseAccountability for conformity cannot be delegated.IEC 62304, 5.8; MDR Art. 10

This view aligns with McKinsey's observation that roles are changing. Developers need judgement, code-review and supervision skills to steer agents. The emphasis moves towards architectural coherence, domain modelling and AI supervision [8].

4. Process design: five building blocks

The companies that genuinely benefit differ less in their choice of tools than in their operating model. The top quintile achieves 16% to 30% improvements in productivity, time to market and customer experience, together with 31% to 45% quality gains. Simply providing AI tools changes little [2]. Leading organisations build verification, control and measurement systems that keep pace with faster ways of working [9]. For SaMD, this translates into five building blocks:

Building blockContentQMS evidence
1. Risk-based tool validationAssess the computerised system, including model, context, integration and data flow, against intended use.Validation plan and report under ISO 13485, 4.1.6; ISO/TR 80002-2
2. Specification before generationNo code without an approved requirement and architecture input. Prompts and context reference requirement IDs.Traceability matrix
3. Provenance and configuration managementMark AI-generated changes. Manage tool and model versions as configuration items.IEC 62304, Section 8
4. Strengthened verificationStatic analysis, coverage targets, negative testing and security scans are mandatory quality gates.IEC 62304, 5.5 to 5.7; IEC 81001-5-1
5. Competence and rolesDefine authority for review and release. Record training evidence for AI use.ISO 13485, 6.2

The fifth building block is frequently underestimated. The AI guideline developed by the Johner Institute together with TÜV SÜD asks manufacturers to identify and document competency requirements for each role within the QMS scope that is directly or indirectly connected with AI [10].

5. Deployment matrix by safety class

Not every software component requires the same degree of restraint. The following matrix provides orientation for an internal procedure. In view of the forthcoming edition of IEC 62304, the draft is expected to replace classes A, B and C with Levels I and II [11].

Use caseClass AClass BClass C
Test code, test data, mocksBroadly usableBroadly usableUsable with review
Boilerplate, UI without safety relevanceBroadly usableUsable with reviewUsable with review
Business logic with risk relevanceUsable with reviewTightly governed, four-eyes reviewOnly with documented rationale and extended verification
Software risk-control measuresTightly governedTightly governed, four-eyes reviewNot recommended without independent verification
Architecture decisionsAI as a sparring partner, decision remains humanAs Class AAs Class A

Conclusion

AI-generated code is neither taboo nor a shortcut for SaMD manufacturers. The standards are technology-neutral enough to accommodate it. They require specified intent, traceable decisions and robust verification. McKinsey warns that agentic software development without a systematic approach can lead to unintended results [1]. In a regulated setting, that creates audit findings, rework in technical documentation and avoidable risks for patients.

Manufacturers should prioritise three actions:

PriorityAction
1Inventory AI tools already in use, including shadow IT, and classify them as computerised systems.
2Embed Human Gates and the deployment matrix in the software development plan and procedures.
3Scale verification capacity before increasing generation capacity.

Organisations that establish these foundations use AI through their quality management system. That is where the competitive advantage lies.

PS

Dr. Patrik Scholler

Consultant for Digital Health, Life Sciences and Managed Delivery

More about me
Share:

Do you have a concrete project?

Talk to us about your project, no obligation, at eye level.

Schedule a conversation

More Insights