The scenario
Example Surgical (fictional) is a hospital network exploring a future operating room in which microscale surgical assistants, nanobots, help a surgeon trace and remove a melanoma with precise margins, working beside a conventional surgical robot. Melanoma excision depends on clear margins: removing too little risks leaving cancer and a second operation, and removing too much costs healthy tissue. Nothing like this is approved today. The scenario exists to show how such a system could be architected so that AI helps without ever taking control.
The platform plans the excision, keeps every nanobot and arm inside limits the surgeon approved, advises on margins with stated uncertainty, accounts for every nanobot and documents the procedure. Safety-critical control is deterministic and independent of AI. The surgeon decides and confirms every tissue-contacting step. One design rule runs through every page: the surgeon is always in command, and if anything is uncertain the system holds and returns to a safe state.
This is a speculative architecture exercise. Nanobot-assisted surgery is not an approved clinical method, and nothing here is medical advice or describes a real device. The hospital, patients, thresholds, targets and figures are invented. Vendor product names are real; code and configuration are sketches that show the shape of an integration. Check endpoints, parameter names and feature availability against each vendor's current documentation before you build.
Architecture
The real-time path from console to devices is deterministic code on certified equipment, with its own stop. AI sits beside it, advising on margins and drafting documents. If every AI component were switched off, the surgeon could still operate with the safety controller enforcing the limits, or convert to conventional surgery.
One procedure, with what happens behind it
A melanoma excision from plan to record. The right-hand column is what the platform does.
| Step | What happens | Behind the scenes |
|---|---|---|
| Plan | A surgeon plans the excision of a melanoma on a patient's back. Imaging is reviewed and the margin advisor proposes an outline with uncertainty bands. The surgeon edits it and approves. | The advisor is a validated model running on the hospital's own equipment. Its output is a suggestion with an uncertainty, never an instruction. |
| Prepare | The nurse loads a sealed batch of 200 nanobots. Their device identifiers are recorded and the safety controller runs its self-test. | The count in is recorded against the batch. The stop control and the geofence are tested before the case can proceed. |
| Map | The surgeon starts mapping. The nanobots work only inside the approved geofence, marking the tumour boundary while localisation shows where each one is. | The safety controller checks every command against the geofence and limits in real time, independently of any AI. |
| Advise | Live imaging disagrees with the plan in one region. The advisor highlights it with its uncertainty and does not act. | Advice appears on the surgeon's display. It cannot move a nanobot or an arm. |
| Decide | The surgeon extends the margin there and confirms the excision. Each tissue-contacting step needs the surgeon's confirmation. | Confirmation is a signed, logged act at the console. No AI component can supply it. |
| Retrieve | After excision the nanobots are retrieved. The count out is checked by imaging and must equal the count in before the closure checklist unlocks. | A mismatch is a hard stop. Closure does not proceed until every unit is accounted for. |
| Record | The copilot drafts the operative note. The surgeon corrects and signs it. The specimen goes to pathology with its orientation, and the margin result is later compared with the plan. | Language-model assistance is limited to documentation. The pathologist's result is the truth the models are measured against. |
The parts, and where each is covered
Planning and margins
An advisory model proposes a margin outline with uncertainty. The surgeon edits, approves and signs the plan and its geofence.
Safety control
A deterministic controller enforces limits, the geofence and an independent stop between every command and the devices.
Nanobot accountability
Every unit is recorded in and must be reconciled out, by imaging, before the case can close.
Documentation and follow-up
A copilot drafts the operative note and checklists, and the pathology link compares margin results with the plan.
Platform
The AI gateway for language-model assistance, a clinical systems gateway, the lakehouse for de-identified data, security scanning and telemetry.
Assurance
Threat model, evaluation plan, governance and runbooks that make it safe to run in a clinical setting.
Design and delivery documents
The documents a clinical safety review, a regulatory review, a security review and a hospital operations team would ask for, each written for this platform.
- Business user stories: Personas, epics, acceptance criteria and a release plan.
- Architecture decisions: The eleven decisions behind the shape of the platform.
- Sequence diagrams: Planning, a margin step, a safety event, nanobot reconciliation, pathology and the operative note.
- Diagram gallery: The pertinent diagrams in one place.
- Data model and classification: Entities, classification and retention, with patient data and device records.
- Tool and API (Application Programming Interface) contracts: The tool catalogue, OpenAPI and MCP (Model Context Protocol) definitions, and what AI may never call.
- Integration map: Record, imaging, pathology, theatre, the robot control system and the nanobot unit.
- Non-functional requirements: Control timing, availability, capacity and a degradation ladder where safety never degrades.
- Threat model: Control-link tampering, spoofed telemetry, supply chain, bias and data exposure.
- Evaluation plan: Datasets across skin tones, fault injection, metrics and release thresholds.
- Responsible AI and governance: Device regulation, risk management, clinical evaluation and oversight.
- Cost and FinOps model: Cost per procedure for the software, and the value of fewer repeat operations.
- Rollout and operating model: From simulation to a limited release, with gates and responsibilities.
- Agile delivery plan: Two-week sprints for the software workstream, roadmap and capacity.
- Runbooks and incident playbooks: Safety holds, unaccounted nanobots, link loss and data exposure.
- References and further reading: Standards, regulators, clinical background and papers.
Requirements and targets
These are the requirements the design was built against. The targets are planning figures for this demo, not measured results and not clinical claims.
| Area | Requirement | Illustrative target |
|---|---|---|
| Surgeon in command | Every tissue-contacting action needs the surgeon's signed confirmation | 100% of such actions carry a confirmation; none is supplied by AI |
| Safe state | Any fault, loss of telemetry or geofence breach holds the devices | Hold within 50 ms; safe retraction started immediately |
| Accountability | Every nanobot is recorded in and reconciled out before closure | 100% of units reconciled; a mismatch is a hard stop |
| Independence | A failure of any AI component cannot affect a safety function | Verified by fault injection in every release |
| Margin quality | Advisory margins measured against pathology | Positive-margin rate reduced in studies; uncertainty calibrated |
| Fairness | Performance holds across skin tones, ages and sexes | No unexplained gap beyond the agreed tolerance |
| Documentation | Operative notes drafted, reviewed and signed by the surgeon | Drafting time cut by half; 100% signed by the surgeon |
| Security | Control link, telemetry and data protected against tampering | Authenticated, signed commands; no unscanned model traffic |
| Privacy | Patient data minimised, masked and de-identified for development | No identifiable data in analytics or telemetry tables |
| Audit | Every plan, command, advice and decision traceable | Complete record for 100% of procedures, kept per regulation |
Suggested reading order
Business user stories
Start with who the platform serves and what each of them needs.
ADRs (Architecture Decision Records)
Read the decisions that set the shape of the platform, starting with the safety ones.
Sequence diagrams
Follow the key flows step by step across the components.
Diagram gallery
See the most pertinent diagrams from every page in one place.
Design documents
Data model, tool contracts, integration map and non-functional requirements.
AI gateway
See how developers reach language models, for documentation only, through one governed front door.
Databricks
See where de-identified data, models, serving and evaluation live.
Prisma AIRS
See how documents, dictation and tool calls are scanned.
Foundry
See the documentation assistant on Microsoft's agent platform.
LangSmith
See the documentation workflow on LangGraph with tracing and evaluation.
Telemetry
See how software and device behaviour is traced and measured, without patient data.
Assurance
Threat model, evaluation plan and governance: how it is shown to be safe and fair.
Delivery
Cost model, rollout, agile plan and runbooks for building and running it.
Build this for your business
This example is speculative and not an approved device, but the same pattern, deterministic safety for every hard duty, a governed gateway, runtime security, advisory-only AI and measured quality, fits any safety-critical service. We can scope a pilot on your own systems.
Book a discovery call