If you lead engineering at a Medical Device (SaMD) or regulated HealthTech company, you have probably already moved past naive "prompt-to-code" AI workflows. Like most mature engineering organizations, you are likely adopting a structured, AI-native SDLC: specialized agents moving methodically from Plan to Design, Build, and Test, governed by markdown specifications, architectural contracts, and human-in-the-loop checkpoints.
On paper, such spec-driven development solves the chaos of autonomous coding agents. In practice, inside a regulated medical device environment, it hits a wall.
Large Language Models are probabilistic engines trained to be helpful, coherent, and accommodating. When a Product Manager writes an ambiguous requirement, a good planning agent naturally smooths over the friction to produce a clean specification. In consumer SaaS, that adaptability is a superpower. Under IEC 62304, ISO 14971, GDPR, and HIPAA, smoothing over ambiguity is how an agent quietly designs an illegal data pipeline or violates software safety class segregation and then writes a convincing, plausible-sounding rationale explaining why its design is just fine.
I call this the Compliance Illusion. When your agents generate fluent architectural specs that subtly violate regulatory boundaries, your senior engineers and QA/RA leads are reduced to manual safety-checkers reading every generated design doc and pull request to catch hidden compliance traps. Your AI accelerates drafting, while human review becomes an immovable bottleneck.
To get real velocity without accumulating existential regulatory debt, we should stop asking our agents to remember the rules. Instead, we build a neuro-symbolic verification harness that mathematically enforces them between the Design and Build phases.
The "What": A Neuro-Symbolic Gate in the SDLC
The core idea behind neuro-symbolic engineering is simple: let neural networks (LLMs) do what they are great at, interpreting messy human intent, exploring architectural options, and writing code, while delegating compliance verification to a symbolic, deterministic solver that cannot hallucinate.
In the resulting SDLC harness, no Build or Test agent is permitted to execute until the Design phase passes formal verification against three declarative Domain-Specific Languages (DSLs): the environment baseline, the regulatory invariants, and the architectural design proposed by the development agent.

The Design Agent is given deterministic feedback by the Verification Gate until the architectural plan meets all the regulatory needs (or fails trying).
The Environment Baseline
The Environment Baseline describes an immutable model of your production platform: endpoints, cloud regions (EU, US), encryption-at-rest states, authorized system roles, IEC 62304 safety classes (Class_A, Class_B, Class_C), and clinical data entities anchored to standard schemas like FHIR R4 and HL7 v2.

In practice, it is a version-controlled text file that follows for syntax and semantics of a domain-specific language developed for this purpose (see below). The exact form of the Environment Baseline DSL may differ based on the platform and purpose, but typically it will contain for example roles, endpoints or subsystems, data entities, and AI models that are used.

The Regulatory Invariants
The Regulatory Invariants describe executable compliance policies translated from IEC 62304 architectural segregation rules, ISO 14971 hazard mitigations, GDPR cross-border restrictions, and HIPAA ePHI controls. Crucially, this layer separates spatial and state invariants (which a solver can prove) from QMS and administrative obligations (such as QA sign-offs or physical consent forms, which must be flagged for human governance).

As the Environment Baseline, also the regulatory invariants are maintained as version-controlled text files. The authors are typically your QA and RA specialists. The Regulatory Invariants DSL is customized for specific purposes and intents, but in essence they encode scoped rules with descriptions and a high-level rule language that is understandable by your QARA people.

The AI-Generated Architecture
The Design Agent proposes an architecture based on the intent extracted on the planning phase. It is a formal specification following strict syntax and semantics of a DSL representing a proposal drafted by the agent for a given feature. Typically, it is expressed strictly e.g. as typed data movements, in-place AI executions, and explicit compliance mutations (such as anonymization, diagnostic validation, or explicit consent gathering).

Under the hood, the deterministic verification engine merges the declarations into a formal specification, operating on a strict "deny everything unless said otherwise" posture. Every rule is evaluated independently. If the development agent proposes a data flow or an AI-model execution that is not explicitly permitted, or that triggers a safety veto, verification fails, blocking the pipeline and forcing the agent to self-correct.

Inside a Real Session: Anatomy of a "Trojan Horse" Request
To see how this changes day-to-day engineering, let's look at what happens when we feed our agentic workflow running over OpenCode a realistic, seemingly straightforward feature request from a Product Manager:
"Route tissue slide scans from the local inference cache to the global training lake for next-gen model training. Also, run our current Class B pathology classifier on these slides and send the inference results directly to the clinical diagnostic UI so the doctors can view them."
To a standard planning agent, this is a routine two-part feature: an analytics export pipeline and an inference delivery workflow. Against our regulatory invariants, this single paragraph contains three severe compliance landmines:
-
Cross-border & unencrypted PHI egress: In our environment baseline,
Tissue_Slide_Scanis raw clinical PHI residing inLocal_Inference_Cache(EU,encrypted: true), whileGlobal_Training_Lakesits in theUS(Class_A,encrypted: false). -
In-place model execution boundaries: The
Clinical_Diagnostic_UIis a high-riskClass_Cendpoint. Executing aClass_Bdiagnostic model inside aClass_Cclinical boundary violates architectural segregation. -
Unvalidated Class B --> Class C delivery: Sending inference results "directly" from a
Class_Bcache to aClass_Cdiagnostic UI crosses a critical IEC 62304 safety boundary without a risk-control gate.
Here is how our multi-agent harness processed that prompt step by step.
1. Plan Phase: Flagging Tensions Instead of Smoothing Them Over
When the request arrived, the SDLC Coordinator checked the workspace state, saw no artifacts/intent.md, and immediately spotted the two regulatory red lines before delegating to the Plan Agent.
Rather than silently inventing a non-compliant spec or refusing to work, the Plan Agent captured a structured intent.md that explicitly isolated the ambiguities and documented eight Request-vs-Invariant Tensions (R1–R8). Most importantly, it refused to take the word "directly" in the prompt at face value, interpreting it as "automated without a manual human queue," never as "unvalidated," because an unvalidated Class B --> Class C hand-off would be rejected downstream.

2. Design Phase: Constrained by the Neuro-Symbolic Verification Gate
Next, the Design Agent translated intent.md into architecture.dsl and invoked the deterministic verifier against our baseline environment and invariants. To achieve a passing verification, the agent had to satisfy three distinct mathematical gates:
-
Satisfying GDPR Art. 44 & HIPAA ePHI Simultaneously: Routing tissue slide scan from the EU cache to the unencrypted US training lake triggered both
GDPR_Art_44_Cross_Border_TransferandEPHI_Encryption_at_Rest_and_Transitinvariants. The verification gate refused to pass the flow unless the agent bound it to the authorizedPipeline_Serviceactor and explicitly applied bothanonymizationandexplicit_consentmutations before the data crossed the EU border. -
Enforcing Model Execution Segregation: Because our invariants explicitly forbid running
Class_AorClass_Bmodels insideClass_Cendpoints, the Design agent could not place inference inside the UI. Instead, it modeled an in-placetransformusingPathology_Classifier(Class_B) inside the encryptedLocal_Inference_Cache(Class_B), verified againstExplicit_Allow_Authorized_Transformsrule. -
Bridging the Class B --> Class C Boundary: Under IEC 62304, if a lower safety class component feeds data into a higher safety class component without a mitigating control, the lower component inherits the higher safety class burden. When routing classification result from the local inference cache (
Class_B) to clinical diagnostic UI (Class_C),IEC_62304_Segregation_Class_B_to_Crule forced the agent to attach diagnostic validation obligation to the flow.
3. Verification Output: Cryptographic Proof and Intellectual Honesty
Once all three actions passed the verification gate, the harness hashed the exact input files (architecture.dsl, environment.dsl, and invariants.dsl) using SHA-256, wrote a tamper-evident verification artifact, and generated a Compliance Bill of Materials (CBOM) in both Markdown and PDF formats.

What stood out most in the session was the epistemic boundary the Coordinator reported back to the engineer:
- It explicitly warned that the Product Manager's literal request could not be implemented as stated and explained why the safe path was enforced.
- It itemized four residual obligations that a boolean solver cannot prove on its own:
- Consent provenance: Asserting
explicit_consentin a DSL does not prove a valid per-patient consent record exists in production. - True gate independence: Modeling
diagnostic_validationas a boolean requires engineering and QA to ensure the validation mechanism is architecturally independent from both the classifier and the UI. - Anonymization adequacy: Stripping identifiers satisfies the state flag, but residual re-identification risk in high-resolution pathology slides still requires human assessment.
- Model classification discipline: Declaring
Pathology_ClassifierasClass_Bis valid today, but any future shift toward autonomous diagnosis requires reclassification and a fresh verification run.
The Implications for HealthTech Engineering Organizations
Embedding a deterministic solver inside an AI-native SDLC changes the economics and risk profile of regulated software engineering in four concrete ways:
- You eliminate the senior-engineer review bottleneck. In AI-assisted teams, code generation is practically free; verification is the scarce resource. By catching cross-border data leaks, unencrypted PHI sinks, and safety-class violations in the Design phase, before a Build agent ever touches a repository, senior engineers spend their review cycles on domain logic and clinical edge cases rather than policing basic HIPAA and IEC 62304 hygiene.
- Your Design History File (DHF) becomes continuous and tamper-evident. Traditional compliance documentation drifts out of sync with production architecture the week after an audit. When every architectural change produces a SHA-256-anchored CBOM tied directly to your environment baseline and regulatory invariants, compliance evidence becomes a deterministic build artifact. Any future edit to a
.dslfile invalidates the hash and forces re-verification. - QA/RA and Engineering share a common language. Regulatory specialists shouldn't have to read TypeScript or Python pull requests to verify risk controls, and software engineers shouldn't have to interpret regulatory prose on the fly. Declarative invariants turn ISO 14971 risk mitigations and IEC 62304 boundaries into version-controlled, testable policy code, while cleanly isolating administrative QMS duties for human sign-off.
- Bounded autonomy replaces brittle prompt engineering. Instead of writing massive, fragile system prompts begging an LLM to "be careful with patient data" you can give your agents high autonomy to explore architectural solutions. Because the harness defaults to "deny", agents can iterate rapidly and fail fast against a mathematical wall until they converge on a provably compliant design.
AI agents are already capable of designing complex systems and writing production code. But in MedTech, speed without formal verification is just an efficient way to automate regulatory liability. The teams that win with AI in healthcare won't be the ones with the cleverest prompts, they will be the ones that anchor probabilistic agents to deterministic truth.