BCI Safety and Regulation

Change one line of software in a brain implant and a chain wakes up: hazards, safeguards, tests. In our toy system a label fix reruns 1 of 13 tests. A new spike threshold reruns 8.

Learn how a brain implant’s software is made safe enough to ship, and what the two best safety records in the field, BrainGate and SWITCH, can and cannot prove.

Pick a change. Watch the light travel from the part you touched, through the hazards it can reach and the safeguards that guard them, to the tests that must run again. Then we build each link of that chain, piece by piece: the FDA class, the risk file, the software rules, the design controls, and the trial evidence.

You need no medical-device background. We define every term. A little programming helps for the code at the end.

Built from primary sources: Rubin et al., Neurology 2023 (BrainGate), Mitchell et al., JAMA Neurology 2023 (SWITCH), the FDA’s implanted BCI guidance (2021) and a public quality-engineering posting. Part of the series on Brain-Computer Interfaces, from the spike to the foundation model.

Trace a change

A toy system of 4 parts, 6 hazards, 8 safeguards and 13 tests, invented for this lesson. The idea is real: the FDA guidance says software changes must be re-verified and revalidated under design controls. The counts are illustrative.

Chapter 0

Why a Brain Implant Cannot Ship Like an App

See why a two-point gain in cursor accuracy needs a paper trail, and meet the four questions every regulator asks

It is Tuesday. A decoder engineer retrains her model on last week’s sessions. Cursor accuracy goes up by two points. In a phone app she would merge the change and ship it by lunch. If it broke, the team would roll it back by dinner.

Now the same change goes to a person with paralysis who uses a brain implant to type to her family and to steer her wheelchair. Nobody can pull the implant out as a rollback. A wrong click can send a wheelchair the wrong way. So the change must not go out on a hunch.

This lesson explains how the field handles that. It is the part of brain-computer interface (BCI) work that engineers rarely see in papers. A BCI is a system that reads signals from the nervous system and turns them into commands for a computer or a machine. The earlier lessons in this series built the signal chain. Here we ask a different question: what makes the chain safe enough to put in a person?

Where the rules show up in practice

A public Neuralink posting makes this concrete. It describes quality engineering for software design controls, with work on “Class III and other regulated software in accordance with IEC 62304, ISO 14971, ISO 13485, and related standards.” It also names the records: a Design History File, traceability matrices, change control records, and “requirement-to-test linkages.”

A second posting, on machine learning for BCI applications, lists this duty: “Define what evidence justifies shipping a model update to someone’s brain-computer interface.” Same company, two postings, one problem. The first covers the paper trail. The second covers the evidence that goes into it.

Those lines contain five names that sound like alphabet soup. By the end of this lesson each one is a plain idea you can explain.

The four questions

Strip away the standards and a regulator asks four things about a device that goes into a body.

  1. How bad can it get? This sets the class of the device, which sets how much proof is due. Chapter 1.
  2. What can go wrong, and what guards against it? This is the risk file. Chapter 2.
  3. Does the software do what we say it does? This is the software lifecycle and the design controls that tie each requirement to a test. Chapters 3 to 5.
  4. What happened when people used it? This is the clinical evidence, and the two best long records in the field are BrainGate and SWITCH. Chapters 6 to 8.

Chapter 9 then asks what happens after release, when the device is in a head and the code must change anyway.

Play with the chain first

The instrument at the top of this page is a toy of those four questions. Each change you pick starts at a part of the system. The part touches some hazards. Each hazard has safeguards. Each safeguard has tests. Pick a change again and read the sentence under the picture. The size of the lit area is the amount of work that change creates.

A label fix reaches one hazard, one safeguard and one test. A new threshold in the implant firmware reaches three hazards and five safeguards and eight tests. That gap is why a regulated team does not treat all changes alike, and why it keeps a map from each part to its tests.

What this lesson is not

This lesson explains how the rules work. It is not legal advice and it does not tell you how to pass an audit. The FDA guidance we read is a set of recommendations, not a law. The standards (IEC 62304, ISO 14971, ISO 13485) are sold by their publishers, so we describe what they do from the FDA texts and from public summaries, and we say so where it matters. Every number in the trial chapters comes from the papers themselves.

  1. Classes and pathways: how the FDA sorts devices by risk, and what an investigational exemption is.
  2. The risk file: hazards, harms, severity, probability and residual risk, the ISO 14971 way.
  3. The software lifecycle: IEC 62304 and its three safety classes.
  4. Design controls: ISO 13485, the Design History File, and the traceability matrix.
  5. Evidence for a model update: what a decoder change must show before it ships.
  6. What zero events means: safety endpoints and the limit of small trials.
  7. The BrainGate record: 14 people, 12,203 implant-days, every adverse event counted.
  8. The SWITCH record: an implant delivered through a vein.
  9. After release: change control, cybersecurity, wireless and MRI.
  10. Field Guide: the numbers, a checklist, the core code, and where to go next.
A decoder retrain lifts accuracy by two points. Why can a BCI team not just ship it the way a phone app team would?

Chapter 1

Classes and Pathways: Proof Scales With Harm

Sort four devices by how badly they can hurt someone, and see how the FDA sets the amount of proof to match

Put four things on a table: a wooden tongue depressor, a powered wheelchair, a heart pacemaker and a brain implant that moves a cursor. Which one should need the most proof before anyone sells it? Almost everyone points at the implants. The regulator does too, and for the same reason: the worse a failure can be, the more proof it asks for.

The regulator and the three classes

In the United States the regulator is the FDA, the Food and Drug Administration. Inside it, the Center for Devices and Radiological Health (CDRH) handles medical devices. A medical device is a product used to diagnose, treat or help a person, and it works by physical means rather than by chemistry like a drug. A scalp electrode cap, a wheelchair and an implant all count.

The FDA sorts devices into three classes. Its own page says classification is risk based. Class I holds the lowest risk. Class II sits in the middle. Class III holds “those with the greatest risk.” Think of three gates in a row. A higher class means more gates.

Class II devices that are not exempt usually go through a 510(k). In a 510(k) the maker shows the new device is substantially equivalent to a device already on the market. A PMA has no such shortcut. A Class III device must stand on its own evidence.

The device below lets you place four real examples on the ladder. Pick one and read which gates it must pass.

Climb the proof ladder

Each bar is one gate. A lit bar means the maker must clear it. Choose a device and see how many gates it faces.

Classes follow the FDA’s description (general controls for all, special controls for Class II, premarket approval for Class III). The tongue depressor, wheelchair and pacemaker are textbook examples of Classes I, II and III. For the implanted BCI the FDA guidance treats it as a significant risk device in studies, and the Neuralink posting names Class III software; the real class of any product comes from the FDA’s classification database.

Notice what the ladder does not say. It does not say Class III devices are bad. A pacemaker is Class III because a failure could kill, not because pacemakers fail often. The class tracks the cost of a failure.

You cannot sell it yet: the investigational exemption

A new BCI has a catch. To get approval you need clinical evidence. To get clinical evidence you must put the device in people. But you may not ship an unapproved device. The way out is the Investigational Device Exemption (IDE). It lets a sponsor (the company or university running the study) use an unapproved device in a clinical study under rules in 21 CFR Part 812. The CFR is the Code of Federal Regulations, the US book of rules; “21 CFR” is its title for food and drugs.

The FDA published a final guidance for exactly this field in May 2021: Implanted Brain-Computer Interface (BCI) Devices for Patients with Paralysis or Amputation: Non-clinical Testing and Clinical Considerations. It says implanted BCI devices are “neuroprostheses that interface with the central or peripheral nervous system to restore lost motor and/or sensory capabilities.” It covers advice for Q-Submissions (questions a maker puts to the FDA before filing) and for IDEs. Non-implanted BCIs fall outside its scope.

The guidance makes four points a software engineer should know.

  1. Most implanted BCIs are “significant risk.” The guidance says they are “generally” significant risk (SR) devices that fall under the full IDE rules. The sponsor makes the first risk call and brings it to an Institutional Review Board (IRB), an independent committee that protects the people in a study.
  2. Consent and ethics rules apply. The sponsor must also follow the IRB rules (21 CFR 56) and the informed consent rules (21 CFR 50).
  3. The first study is small on purpose. An early feasibility study collects proof of principle and first safety data in a few people. The guidance says it must be justified by a benefit-risk analysis and by adequate protection for the participants.
  4. The guidance is not a law. It is marked “Nonbinding Recommendations.” A maker can choose another route if it can justify it.

Why a software engineer cares about the class

The class sets the depth of the paper trail for your code. The same FDA guidance document now carries a notice about software. The FDA used to rate software by “level of concern” and treated implanted BCIs as a “Major” level. Under its June 2023 software guidance, implanted BCI devices “should generally address the recommendations for an Enhanced Documentation Level.” Enhanced is the deeper of the two levels. So a decoder inside a Class III implant is documented more fully than the same decoder in a gadget that only plays music.

That is why the Neuralink posting says “Class III.” The word tells the quality engineer how deep every record must go, from the first requirement to the last release note.

A new implanted BCI has no approval yet. How can its maker still test it in people?

Chapter 2

The Risk File: Hazard, Harm and What Is Left Over

Follow one wrong click from a decoder error to a possible injury, then add safeguards until the leftover risk is small enough

A woman steers her wheelchair with a BCI. The decoder reads her intent to move forward. For one frame, a burst of noise makes it read “go” instead of “stay.” The chair rolls half a metre. Usually nothing happens. Once, with the chair at the top of a ramp, something could.

That small story holds the whole idea of risk management. The standard that formalises it is ISO 14971, Application of risk management to medical devices. The FDA guidance for implanted BCIs tells makers to apply “accepted risk management principles, such as those described in” it. The standard is sold by its publisher, so we rely on the FDA text and public summaries for what follows.

Four words, in order

The standard keeps four words apart, and mixing them up is the classic mistake.

  1. Hazard: a source of potential harm. Here, a wrong “go” from the decoder.
  2. Hazardous situation: a hazard meets a person. The wrong “go” happens while the chair faces a ramp.
  3. Harm: the injury itself. A fall from the chair.
  4. Risk: how bad the harm would be, combined with how likely it is. Risk is a pair of numbers, not a feeling.

Hazard alone is not harm. A live wire in a locked box is a hazard with no hazardous situation. Many hazards never become harm, and the risk file explains why.

Size the risk: severity and probability

Severity says how bad the harm would be: from negligible, through serious, to catastrophic. Probability says how often the harm happens, from improbable to frequent. Multiply the two levels and you get a score. Plot them on a grid and you have a risk matrix: each cell is one pair. The cells fall into three zones. The low zone is acceptable. The top zone is not acceptable. The middle zone says: reduce the risk as far as you can, then weigh what is left against the benefit.

Where the zone lines sit is the maker’s own policy, set before the analysis and written in the risk file. The regulator checks that the policy is sensible and that the maker followed it.

Control the risk, strongest first

When a risk is too high, you add a risk control. Public summaries of the standard put controls in an order from strongest to weakest.

  1. Inherently safe design. Remove the hazard. A wheelchair that is limited to walking speed cannot throw its rider.
  2. Protective measures. Add a guard in the device. A confidence gate refuses to act on a low-confidence “go.” A stop button always works.
  3. Information for safety. Warn the user in labels and training. This is the weakest, because people forget and skim.

What remains after the controls is the residual risk. The maker must judge whether it is acceptable, and whether the benefit to the patient outweighs it. That judgement goes into the file.

Try it below. The starting risk is high. Switch on safeguards one at a time and watch the dot move.

Drive the risk down

Each cell is a severity and a probability. The hollow dot is the risk before controls. The filled dot is the risk now. Switch on safeguards, then press Break one safeguard.

Illustrative scale and policy. Severity and probability each run from 1 to 5. The scenario starts at severity 4, probability 4. The confidence gate and the undo step each lower probability by 1 level. The stop button lowers severity by 1. Score is severity times probability: 4 or less is acceptable, 5 to 9 is reduce as far as possible, 10 or more is not acceptable.

The starting score is 16, firmly in the red. With all three safeguards on, probability drops from 4 to 2 and severity from 4 to 3. The score is 6, in the middle zone. That is where most real devices live: not at zero, but at a stated, reasoned number.

The single-fault rule

The FDA guidance adds one demand that fits software well. It says to identify “hazards caused by single-fault conditions to ensure that the failure of any single component of the implanted BCI device does not cause an unacceptable risk during use.” A single fault is one part failing while everything else works.

Press Break one safeguard. The device removes whichever safeguard hurts most and recomputes the score. If one lost safeguard pushes the dot into the red, you have a design that depends on a single part. That is the signal to add a second, independent safeguard.

The guidance also asks for the analysis “in a tabular format,” with all causes, all mitigations, and a rationale for why the leftover levels are acceptable. It lists the kinds of risk to cover: device malfunction, adverse tissue reaction, infection, use error and extravasation (leakage of fluid out of a vessel). Software hazards sit in the same table as hardware and clinical ones.

The file never closes

The risk file is not written once. Each new hazard found in testing, each complaint from the field and each software change goes back into it. That is why the chain at the top of this page matters: a change is safe to make only if the hazards it reaches are re-checked.

A design has two safeguards against one hazard. Taken alone, losing either one leaves the risk in the red zone. What does the single-fault rule say?

Chapter 3

The Software Lifecycle: Three Safety Classes

Sort a BCI’s software items by the worst harm they can add to, and see how that sets the rigour of the work

An implant runs three kinds of code. The firmware on the chip keeps the power under a safe limit. The decoder turns neural features into a cursor move. The settings screen lets a caregiver change the font size. If all three had a bug, would you want the same amount of testing for each? Of course not. A bug in the font size is a nuisance. A bug in the power limit can heat brain tissue.

The standard that matches effort to danger for software is IEC 62304, Medical device software, software life cycle processes. Neuralink’s posting names it, and the FDA guidance treats software in implanted BCIs with its deepest documentation level. The text of IEC 62304 is sold by its publisher, so we describe it from public summaries and the FDA text. Check the standard itself before you rely on any detail.

The lifecycle, in the order the work happens

A software lifecycle is the list of activities from the first idea to the last patch. IEC 62304 names them. In plain words they are:

  1. Planning. Write down how you will build, test and release.
  2. Requirements. State what the software must do, in sentences a test can check.
  3. Architecture. Split the software into items (blocks with clear jobs) and show how they connect.
  4. Detailed design. Describe each item well enough to code it.
  5. Unit implementation and verification. Write each small piece and test it alone.
  6. Integration and integration testing. Join the pieces and test the joins.
  7. System testing. Test the whole against the requirements.
  8. Release. Check that everything is done and record exactly what shipped.

Three supporting processes run beside these from start to end: risk management (Chapter 2), configuration management (knowing exactly which version of every file went into a build), and problem resolution (logging and fixing bugs). After release, a maintenance process handles changes (Chapter 9).

Safety classes: A, B and C

Here is the key idea. Not every item needs every activity. IEC 62304 gives each software system a safety class, from A to C, based on the worst harm a failure can contribute to. Public summaries describe them this way:

The class comes from the risk analysis of Chapter 2, not from taste. A higher class means more of the lifecycle activities become required, and in more detail. A Class C item needs detailed design for each unit. A Class A item needs far less.

Two ideas let teams spend effort well. The first is segregation: if you draw a firm boundary around a low-risk item, so that its failure cannot reach the risky parts, it can carry a lower class than the whole system. The second is an independent safeguard: if a hardware limit stops the worst harm no matter what the code does, the code’s class can fall. Both moves must be justified in the risk file. You cannot lower a class by wishing.

Try it with the three items from the opening story, plus a log viewer.

Classify the software

Pick an item. The meter shows the worst harm it can add to. The bars show which activities become required. Then switch on an independent hardware safeguard and see the class step down.

Toy classification, invented for this lesson. The activity table is simplified from public summaries of IEC 62304: planning, requirements, system testing and release for all classes; architecture, unit verification and integration testing from Class B; detailed design of each unit for Class C. Check the standard for the exact table.

The firmware starts at Class C: if its limit fails, tissue could be harmed seriously. Switch on the hardware safeguard (a thermal fuse, say) and the class steps down to B, because the worst case is now smaller. Even so, the team must show in the risk file that the fuse really works. The log viewer stays at A either way. It has no path to harm.

Software you did not write

Every BCI stack uses code from outside: an operating system, a real-time kernel, a Python numerical library, a deep learning framework. IEC 62304 calls this SOUP, software of unknown provenance. You did not write it, so you cannot show its development records. The FDA guidance asks the maker to describe the languages, hardware platforms, operating system and any off-the-shelf software, and points to FDA documents on off-the-shelf software and on cybersecurity.

For an ML engineer this matters. A framework version is part of the build. If an update to the numerical library changes a rounding in a filter, the decoder’s output can change with no line of your code touched. Teams pin versions, list every SOUP item with its known faults, and rerun tests when a pinned version moves.

What the FDA adds for implanted BCIs

The guidance says that software for an implanted BCI “generally” presents the highest concern, and it recommends a full description of the software and firmware. It adds a rule that ties this chapter to the next: “Changes to software must be revalidated and reverified in accordance with Design Controls.” Design controls are the subject of Chapter 4. The guidance also asks you to count software-related hazards when the software drives assistive effectors such as wheelchairs, computers or prosthetic limbs, which is exactly the decoder case.

The decoder could, if it fails, contribute to a serious injury. A separate, independent hardware stop limits that harm. What may the team do?

Chapter 4

Design Controls: Every Promise Gets a Witness

Link each requirement to the safeguard and the test that proves it, and find the gap that an auditor would find first

An auditor sits down and says: “Your risk file says the stop button always works. Show me the test.” If you can point to a test, its version, its result and the build it ran on, the audit moves on. If you cannot, the sentence in the risk file is a promise with no witness. That one gap can stop a submission.

This chapter is about how a company arranges its records so that every promise has a witness. Three names do the work: ISO 13485, design controls and the Design History File.

ISO 13485: the company, not the product

Chapters 2 and 3 were about one device. ISO 13485 is about the company that makes it. It is the international standard for a quality management system (QMS): the written procedures, the training, the audits and the records that show a maker does what it says it does. Think of it as the company’s own safety manual.

In the United States the matching rule is 21 CFR Part 820. The FDA changed it recently. According to the FDA and to public summaries, the Quality Management System Regulation (QMSR) took effect on 2 February 2026. It amends Part 820 by incorporating ISO 13485:2016 by reference, so the international standard now sits inside the US rule, with a few FDA-specific additions. The FDA guidance we have read in this lesson still cites the older section numbers, such as 820.30 for design controls. The ideas did not change; only where they are written down did.

Design controls: a plan you can audit

Design controls are the rules for how a device is designed. The FDA guidance says to run the risk analysis “as part of your design controls required in 21 CFR 820.” Picture a ladder with two sides that mirror each other.

  1. User needs. What the person using it must be able to do. “Steer my chair without fear of a runaway.”
  2. Design inputs. The needs, rewritten as testable requirements. “A stop command must halt motion within 100 ms.” (A made-up number, for illustration.)
  3. Design outputs. What you build: code, schematics, models.
  4. Verification. Did we build it right? Check each output against its input with a test.
  5. Validation. Did we build the right thing? Check the finished device with real users in real conditions.

An analogy helps. Verification is a unit test: given this input, does the code return that output? Validation is a user trial: does the person actually reach the goal? A decoder can pass every unit test and still fail validation, because the tests missed the life the person actually lives.

Between the steps come design reviews, where people not on the team check the work. At the end comes design transfer, which hands the design to manufacturing. Any later edit is a design change and must go through the same checks, as Chapter 3 said.

The Design History File

The Design History File (DHF) is the pile of records that shows the design followed the plan. The Neuralink posting lists the work: “update risk assessments, protocols, and Design History File (DHF) content to maintain ongoing compliance.” Think of it as the git history of the whole design, with the reviews, test reports and sign-offs attached. When the FDA guidance says changes to software must be documented in the DHF, this is the file it means.

The traceability matrix

The tool that ties the DHF together is the traceability matrix: a table that links each user need to its requirements, each requirement to its risk controls, and each control to the tests that verify it. The posting names it: “traceability matrices, change control records, and requirement-to-test linkages.”

A matrix is useful because it can be checked by a program. Three gaps matter.

This is the same map that lit up at the top of the page. There it told you what to re-run. Here it tells you what is missing. Remove a test below and see which safeguard loses its witness.

Find the unwitnessed safeguard

Rows are safeguards. Columns are tests. A dot means a test verifies that safeguard. Tap a test to remove it from the suite, and tap again to restore it.

The same toy system as the instrument at the top: 8 safeguards and 13 tests, invented for this lesson. Each safeguard has 1 or 2 tests. A real matrix has hundreds of rows, but the check is the same.

Remove T13 and the stop button has no test left. Remove T1 and T2 and the confidence gate has none. Notice that removing T4 alone does not leave the power limit unverified, because T5 still covers it. One test per safeguard is a thin margin. Two give you room when a test must be retired or rewritten.

Change control

The last record in the posting is the change control record. Each change gets an entry: what changed, why, which hazards and requirements it touches, which tests were re-run, who approved it. A good record answers the question from the top of the page before anyone has to ask it.

Which gap in a traceability matrix is the most serious?

Chapter 5

Evidence for a Model Update: Not Worse, Then Better

Turn eight noisy sessions into a ship or hold decision with a paired interval and a margin you chose in advance

The retrained decoder from Chapter 0 scored two points higher. Is that real? The engineer ran it on eight recorded sessions. Some sessions went up by four points. One went down by one. The user was tired on Thursday. The average is +1.75. What does she write in the change record?

This is the question in the machine learning posting: “Define what evidence justifies shipping a model update to someone’s brain-computer interface.” A model update is a software change (Chapter 3), so it needs verification evidence (Chapter 4). But the evidence is statistical, because both the model and the person are noisy.

Two different questions

People often mix up two questions. They need different proof.

  1. Is the new model safe to put in place of the old one? This asks for non-inferiority: the new model is not worse than the old one by more than a small allowed loss, called the margin (written δ).
  2. Is the new model actually better? This asks for superiority: the gain is larger than zero.

For a safety release the first question comes first. A decoder that is probably better but might be worse by three points should not ship, even if its average is higher.

Why the margin is set before the data

The margin δ is a promise: “we will accept a loss of up to this much, and no more.” If the team picks δ after seeing the result, it can always pick one that passes. So the plan names the metric, the margin and the rule first, and the change record cites it. This is also what the FDA calls a plan: for AI-enabled device software, the agency’s December 2024 guidance on predetermined change control plans lets a maker describe planned model changes, the test protocol and the impact assessment in advance, as public legal summaries describe it. The FDA reviews the plan once, and later updates that stay inside it need no new submission.

A paired interval, step by step

Because the same sessions are scored under both models, we work with the differences. This is a paired design. Pairing removes the session-to-session swing (a hard day lowers both scores) and keeps only the change due to the model.

d̄
The mean of the per-session differences (new score minus old score).
t
A multiplier for a 95% interval. It is 2.365 when there are 8 sessions and falls toward 1.96 as sessions grow.
s
The standard deviation of the differences: how much they scatter.
√n
The square root of the number of sessions. More sessions shrink the interval, but slowly.

Work it with the eight differences: +3, +1, +4, −1, +2, +3, 0, +2.

  1. The sum is 14, so the mean is d̄ = 14 / 8 = 1.75.
  2. The deviations from the mean are 1.25, −0.75, 2.25, −2.75, 0.25, 1.25, −1.75, 0.25. Their squares add to 19.5.
  3. Divide by n − 1 = 7 to get 2.786, so s = 1.669.
  4. The standard error is s / √8 = 1.669 / 2.828 = 0.590.
  5. With t = 2.365 the half-width is 2.365 × 0.590 = 1.396. The interval is 0.35 to 3.15.

Now apply the rule. Say the margin is δ = 1 point. The lower end, 0.35, is above −1, so the update is non-inferior. It is also above 0, so the data support a real gain. Both gates pass. With a margin of 0, only the second matters.

Gate the update

The bar is the 95% interval of the gain. The red line is the margin below which we refuse to go. The teal line is zero. Drag the number of sessions and the true gain, then draw a new set of sessions.

8
+1.50

Illustrative: each session’s difference is the true gain plus noise with a standard deviation of 3 points, from a seeded random generator, so the same draw repeats on every visit. The margin is 1 point. The interval uses the t multiplier for n − 1 degrees of freedom. A real plan fixes the metric and margin first.

Set the true gain to 0 and draw many times. You will see intervals that sit entirely above zero by luck, about one draw in forty. Now set the true gain to −2. With 8 sessions the interval is wide, and it often straddles the margin. You cannot tell that the update is worse, and you cannot tell it is safe. The honest answer is to hold and collect more sessions.

What offline numbers cannot show

Eight recorded sessions replayed through two decoders measure how well each predicts what the user did. They do not measure what the user does next. In a closed loop the person sees the cursor and adjusts. A better offline decoder can feel worse online, and a slightly worse one can feel better because the user adapts to it. Earlier lessons cover that: closed-loop refit, drift and recalibration and how to measure a BCI.

So a careful plan stacks evidence. Offline replay on held-out sessions that the model never trained on comes first and screens out bad updates cheaply. A bench test against the safeguards of Chapter 2 comes next. A supervised closed-loop session with a clinician follows. A staged rollout, first to one participant, then to more, comes last, with a way back to the old model. Each layer has its own pass rule, written in advance.

A retrained decoder shows a mean gain of +1.75 points. Its 95% interval runs from −1.6 to +5.1, and the pre-set margin is 1 point. What follows?

Chapter 6

What Zero Events Means: Reading a Safety Endpoint

Learn the words of a safety result, then compute the highest risk that a small trial with no events still allows

A paper reports: “no serious device-related adverse events in four patients over twelve months.” It sounds like a clean bill of health. Is the device safe? The honest answer is: safe enough that nothing bad happened in four people for a year, which is a smaller claim than it sounds. This chapter shows how small, and how to say it in numbers.

The vocabulary of a safety result

The FDA guidance asks that the safety endpoints “include a characterization of all adverse events (AEs) for all subjects,” including events from the implant surgery, the implanted device and the assistive effector (the wheelchair or arm). It also asks for a plan for handling events and for safety criteria that would require removing the device or ending a participant’s study.

Two studies define their endpoints in different words, and that matters when you compare them. BrainGate’s primary outcome counts device-related SAEs that required explantation, caused death or caused permanently increased disability in the first year after implant. SWITCH’s primary endpoint counts device-related SAEs resulting in death or permanent increased disability, and its secondary endpoints are blood vessel occlusion and device migration. Same spirit, different lines.

No events is not no risk

Suppose a device has a true rate of one serious event per 100 person-years. A person-year is one person followed for one year. With only 4 person-years of follow-up you will likely see none. So seeing none cannot tell this device from a safer one.

How much can you rule out? Here is the derivation.

Suppose events arrive at an unknown steady rate λ per person-year. Over n person-years you expect λn events.

The chance of seeing zero is e−λn. We call a rate “ruled out” if zero events would be unlikely under it, say less than 5%. Solve e−λn = 0.05. The answer is λn = ln 20 = 2.996. Every rate above 2.996 / n is ruled out. Every rate below it still fits. Statisticians round this to the rule of three.

λ95
The highest event rate per person-year that the data still allow, at 95% confidence.
3
Really 2.996, which is ln 20. With 1, 2 or 3 events seen the number grows to 4.74, 6.30 and 7.75.
n
Total exposure in person-years: patients times years of follow-up.

Now use it. BrainGate’s paper counts 12,203 implant-days, which is 33.4 person-years. With no intracranial infection, the highest infection rate still allowed is 2.996 / 33.4 = 0.090 per person-year, about 9 per 100 person-years. SWITCH followed 4 patients for 12 months, about 4 person-years. Its highest allowed serious-event rate is 2.996 / 4 = 0.75 per person-year. These numbers are my own arithmetic from the papers’ exposure, not figures the papers print.

The BrainGate authors saw the problem. They write that the study “is underpowered to detect rare events such as intracranial infection,” and that with 33.43 person-years it “has a power of less than 1% to detect a doubling in the rate” of intracranial infection, which in the general population is 1.38 cases per 100,000 per year. To exclude a rate as low as that background, you would need about 2.996 / 0.0000138 = 217,000 person-years with no event.

How much does zero rule out

The curve is the highest event rate that the data still allow. Drag the exposure along the bottom. Add events seen to see the curve lift.

33

The limit is the exact one-sided 95% Poisson upper bound: 2.996, 4.744, 6.296 and 7.754 events divided by person-years, for 0, 1, 2 and 3 events. Markers: SWITCH about 4 person-years (4 patients, 12 months), BrainGate 33.4 person-years (12,203 implant-days). The background line is the 1.38 per 100,000 per year quoted in Rubin et al. for intracranial infection. It assumes events arrive independently at a steady rate.

Slide the exposure to the SWITCH marker and then to the BrainGate marker. A factor of eight in follow-up cuts the ceiling by a factor of eight, not to zero. The line only falls like 1 / n. Rare harms need very large exposure, which is why post-market surveillance (watching the device after approval) and registries exist.

What small trials can still tell you

None of this makes early studies worthless. They cannot bound rare events, but they do show common ones well: skin irritation, seizures after surgery, device failures. They reveal how surgery goes and what the risk controls miss. The design question is whether the study was built to see the events that matter at the size that matters. The FDA guidance points sponsors to early feasibility studies for this reason: first learn what the common problems are, with few people, then scale.

A trial follows 10 patients for 1 year each and sees no device-related serious event. By the rule of three, the true rate could still be as high as about what?

Chapter 7

The BrainGate Record: 342 Events, Counted Honestly

Open the interim safety report for the longest-running intracortical BCI trial and follow each event down to the few that matter

BrainGate is the longest-running human trial of an intracortical BCI. A Utah array, a small silicon bed of microelectrodes, goes into the motor cortex of a person with paralysis. A metal connector called a pedestal sits on the skull and pokes through the scalp. A cable plugs into it, and the signals go to a computer. The earlier lessons in this series cover what those signals look like. Here we ask how safe the arrangement has been.

In 2023 the team published an interim safety report in Neurology (Rubin and colleagues). It covers 2004 to 2021. We use its numbers throughout, and we say which of our own calculations are not in the paper.

Who and how long

Fourteen adults received devices. They had quadriparesis (weakness of all four limbs) from spinal cord injury (6), ALS (6) or brainstem stroke (2). Their median age at implant was 51, with a range of 24 to 66. Eleven were men, three were women. Each had one or two arrays in the motor cortex, and the study ran at 7 US clinical sites.

The mean time with the device in place was 872 days. The median was 774 days, with a range of 296 to 1,994. Added up, that is 12,203 implant-days, or 17,927 array-days when you count a second array. In years that is about 33.4 person-years of exposure.

Counting every event

The paper counts everything. Among the 14 participants there were 342 adverse events, a median of 21 per person, with a range from 0 to 62. Most had nothing to do with the device. Of the 342, 274 (80.1%) were unrelated to it, and the paper names common ones in people with tetraplegia: urinary tract infection, pneumonia and pressure sores. That leaves 68 device-related events, with a median of 2 per person.

Of those 68, 35 were skin problems around the incision or the pedestal: irritation, sensitivity, tightness. The paper says that in many cases they came from overly enthusiastic cleaning by a caregiver, and they resolved after the caregiver was retrained. One participant took oral antibiotics for a local skin infection. The paper calls it the only device-related infection, and the authors found none in bone or brain.

The headline numbers come next. Across more than 17,000 array-days there was no intracranial or deep tissue infection related to the device. No device-related event led to a death, to a participant leaving the study, or to removing the device. There were no unanticipated adverse device effects. The abstract also counts 6 device-related serious adverse events among the 68. None met the primary outcome, which is a device-related event requiring explantation, causing death or causing permanently increased disability within the first year after implant.

Use the device to move down through the counts, from the full list to the events that matter most.

Zoom into the 342

Each bar shows one group, split into its parts. Press a zoom level and the bar narrows to the part that matters next.

Counts are from Rubin et al., Neurology 2023: 342 adverse events, 274 unrelated, 68 device-related, 35 of the 68 skin-related, 6 device-related serious adverse events. The split of the other 33 and the detail of the 6 serious events are not shown here. Bar widths are drawn to scale within each zoom level.

The events that changed the protocol

The most useful part of the paper is where a safety event changed the rules. Two participants had a seizure four days after surgery. Both had a history of traumatic brain injury and neither had consistent seizure-prevention medicine. Preclinical data had not suggested the need. The protocol now includes one week of prophylactic antiseizure medication, as is common after brain surgery.

A third case was a serious event of unknown cause. After more than 18 months with a single array, a participant had new-onset refractory status epilepticus, a severe and hard-to-treat run of seizures. He had no seizure history. The doctors never found the cause. Imaging was normal and the seizures began in the temporal lobe, away from the array. The team chose not to remove the device, on clinical grounds, and he returned to research sessions about four months later. The paper uses this case to discuss ethics: his family said he valued taking part, so the usual premise that a trial offers a participant no personal benefit did not capture the whole picture.

One more case shows why the risk file never closes. A participant on long-term blood thinners had them paused for the surgery, and had a recurrent pulmonary embolism on day three. It was counted as study-related because the pause was for the device. The record counts what the design caused, not only what the device did.

How the authors compare

The authors set the record beside other implanted neural devices. In large deep brain stimulation (DBS) studies, infection rates were 3% to 5%, and up to half of those needed hardware removal. A meta-analysis of 1,714 DBS patients with essential tremor found 3.4% infection, 2.4% hemorrhage and 2.3% seizure. For the NeuroPace RNS (a responsive neurostimulator for epilepsy), implantation site infection occurred in 12.1% of 230 participants. They conclude BrainGate’s profile is comparable, and credit practices: a pre-surgery chlorhexidine wash for three days, strict sterile technique, and a caregiver protocol for the pedestal.

They also state the limits. There was no control arm. Participants differ from DBS patients, with more caregiver contact. And the study is underpowered for rare events, which is Chapter 6’s point. The authors rate the result Class IV evidence, the lowest of the four levels on the journal’s scale. They name the missing control arm as the most significant limit.

Why do the BrainGate authors say the study cannot settle the rate of intracranial infection?

Chapter 8

The SWITCH Record: An Implant Delivered Through a Vein

See how moving the route of entry moves the hazards, and read what four patients and twelve months can and cannot show

Imagine you need to record from the motor cortex but cannot open the skull. Is there another door? There is one: the blood vessels. The superior sagittal sinus is a large vein that runs along the top of the brain, right next to the motor cortex. A thin mesh tube of electrodes can be steered up to it from the neck, the way a surgeon places a stent in a heart artery.

That is the idea behind the Stentrode, made by Synchron. A stent is a small expandable mesh tube that props open a vessel. The Stentrode is a stent with electrodes on it. The first human safety study of it is called SWITCH, for “Stentrode With Thought-Controlled Digital Switch.” It was published in JAMA Neurology in 2023 by Mitchell and colleagues.

What the study did

Every number here comes from the paper’s abstract. SWITCH was a single-centre, prospective, first-in-human study at the Royal Melbourne Hospital in Parkville, Australia. It evaluated five patients with severe bilateral upper-limb paralysis. Four had amyotrophic lateral sclerosis (ALS) and one had primary lateral sclerosis. The study began on 27 May 2019, and the final follow-up was done on 9 January 2022. Four patients are in the analyses; the abstract does not say why the fifth is absent, so read the paper before quoting that gap.

The devices went in through a catheter and connected to subcutaneous electronic units, which sit under the skin. They talk wirelessly to an outside device that connects to a personal computer. Training sessions took place in the patients’ homes and at a university clinic. This matters for regulation: the FDA guidance asks makers to think about home use and the caregivers who help.

The three tiers of endpoints

SWITCH tells you its plan up front, in three tiers.

  1. Primary safety endpoint: device-related serious adverse events that result in death or permanent increased disability.
  2. Secondary endpoints: blood vessel occlusion (the vein getting blocked) and device migration (the stent moving).
  3. Exploratory endpoints: signal fidelity and stability over 12 months, the number of distinct commands, and use of the system to control digital devices.

The secondary endpoints show how a new route changes the risk file. A device in a vein can clot the vein or slide along it. Those hazards do not exist for a Utah array in the cortex, so they get their own endpoints.

The results

Each of the four completed 12 months of follow-up with no serious adverse events and no vessel occlusion or device migration. The signal bandwidth (the span of frequencies the recording carries) averaged 233 Hz (standard deviation 16 Hz) and stayed stable through the study in all four patients. At least five attempted movement types were decoded offline, and each patient controlled a computer with the BCI. The authors conclude that recording neural signals from a blood vessel is possible and that the favourable safety profile could speed up translation.

That 233 Hz is worth a pause. A single spike lasts about a millisecond, so catching spikes takes a bandwidth of several thousand hertz. A vein sits outside the brain tissue, so its signal blends many neurons and is not expected to show single spikes. The paper does not claim spikes. The trade-off is clear: a safer door gives a quieter view. The recording map lesson places these signals on a map of what each recording method can see.

Company and press reports say a follow-on US study, COMMAND, with six patients, met its primary safety endpoint. That is a company claim as far as this lesson goes: we have not read a peer-reviewed paper for it.

Two routes, two risk files

Compare the two studies carefully. BrainGate uses a pedestal that passes through the scalp. The skin opening is a standing door for germs, and the paper confirms the cost: 35 of the 68 device-related events were skin problems around the incision or pedestal. SWITCH places all hardware under the skin, so that door is closed. In exchange the vein adds its own hazards, which the secondary endpoints watch. The hazards moved. They did not go away.

Compare the two doors

The drawing is a side view of a head. The warm line marks where a hazard can get in. Switch between the two routes and read the results under each.

Schematic, not to scale. Results are from Rubin et al., Neurology 2023 (BrainGate: 14 people, 12,203 implant-days) and Mitchell et al., JAMA Neurology 2023 (SWITCH: 4 analysed patients, 12 months). The studies differ in population, device, signal and size, so their results are not a head-to-head comparison.

Be careful with the comparison. Four patients for a year is about 4 person-years. By Chapter 6’s rule of three, no events in 4 person-years still allows a true rate near 0.75 per person-year. The study shows that a vein route is feasible and that nothing bad happened in this group. It cannot show that the route is safer than a pedestal. That needs more people, more years and a matching design.

Why does SWITCH list vessel occlusion and device migration as secondary endpoints?

Chapter 9

After Release: Gates, Security, Radio and MRI

Send four different defects through a release pipeline and see which gate catches each, and what happens when a gate is skipped

The device is in a person. Six months later a bug is found. The fix is three lines. This is the moment when a regulated team earns its paper trail, because the fix must reach a person without adding a new hazard. A release pipeline is the line of checks between a code change and a body.

The gates, one by one

A release gate is a check that must pass before a change moves on. In a regulated team the gates look like this.

  1. Trace check. Does every requirement and every safeguard touched by the change still have a test (Chapter 4)? A program can check this.
  2. Unit tests. Do the small pieces still return the right outputs?
  3. Bench and wireless tests. Does the whole system, on a hardware-in-the-loop bench (the real device wired to a computer that simulates the body), keep its safeguards and its radio link?
  4. Security scan. Do the dependencies and the code carry known weaknesses, and are keys handled safely?
  5. Risk review. Does a person who did not write the change agree that no hazard grew (Chapter 2)?
  6. Release approval. Is every record complete, and does a named person sign it?

No single gate is perfect. Each has blind spots, so the gates overlap. A defect that slips past one is often caught by the next. Teams call this defence in depth, the same idea as stacked safeguards in the risk matrix.

Try four defects. Each has a gate that most naturally catches it and a backup. Switch off gates one at a time and see where the defect ends up.

Run a defect through the gates

Choose a defect. The dot travels along the line of gates until a gate that is on catches it. Tap a gate to switch it off.

Toy mapping, invented for this lesson: each defect can be caught by one or two gates, listed in order. The first gate that is on catches it. If none is on, the defect reaches the field, where it is found by a complaint, which is the slowest and most costly path.

Switch off the trace check, then run “Safeguard with no test.” Only the risk review can still catch it, and it relies on a reviewer noticing something that is absent. Switch off both and the defect reaches a person. Absent tests are the hardest defects to see, which is why the matrix is checked by program.

Changing a model under a plan

Chapter 5 showed the evidence for one update. A device that updates its models often needs a plan for the whole stream of updates. For AI-enabled device software, public legal summaries of the FDA’s December 2024 final guidance say a maker may describe planned changes, the test protocol and the impact assessment in a predetermined change control plan. Updates inside the plan can then ship without a new submission each time. The plan itself has to be authorised first, and a change to the plan is a new submission.

Security

A BCI is a networked medical device. The FDA guidance asks makers to give cybersecurity information and points to FDA documents on managing cybersecurity in medical devices. Neuralink’s quality posting lists the health-software security standard IEC 81001-5-1 among its preferred skills. The practical point is that a hazard analysis must include a stranger on the link, not just a random fault. In our toy system, the safeguard for that hazard is an encrypted pairing, and it has two tests.

The radio is a safety function

The guidance says: “the correct, timely, and secure transmission of medical data and information is important for the safe and effective use of medical devices.” It tells makers to assess wireless coexistence risk using AAMI TIR69, because other radios nearby can cause “signal loss or delay.” For a BCI, a dropped frame is not just a glitch. It might leave a wheelchair on its last command. So the risk file defines a fail-safe state: what the device does when the link is lost. The usual answer is to stop. A latency budget is a safety number too. A posting for BCI application engineers talks about turning a neural stream into device control “within 15ms.”

MRI and the user

Two more topics from the guidance fit in a short list. MR compatibility: a person with an implant may need an MRI scan for another reason. The guidance lists seven hazards, including heating of nearby tissue, vibration, movement and torque from the static magnet, and induced voltages in leads. Human factors: it names the end users as patients, surgeons, prosthetists and caregivers. It defines a use-related hazard as one that can exist even when the device works to specification, for example a screen the user misreads. The home matters too: the guidance says it is important to study BCI devices in realistic home environments, with caregiver training described in the protocol.

After approval the work continues. Complaints, adverse event reports and field corrections feed back into the risk file. The FDA’s rules still require medical device reporting and corrections and removals reporting alongside the quality regulation. The chain at the top of this page runs again for every one of them.

Why does the risk file define a fail-safe state for the radio link?

Chapter 10

Field Guide: Terms, Numbers, a Checklist and the Core Code

Keep the whole chain on one page: what each term means, which numbers to remember, and the code that checks a change

The one-paragraph summary

A brain implant’s software ships only with evidence that matches the harm it can cause. The FDA sets the amount of proof by device class. ISO 14971 turns hazards into a risk file with safeguards and a stated residual risk. IEC 62304 assigns each software item a safety class A, B or C and sets the rigour of the lifecycle. ISO 13485 and design controls tie every requirement to a safeguard and a test in a Design History File. A model update needs a paired interval above a margin chosen in advance. And trial results must be read with their exposure: BrainGate counted 342 events in 12,203 implant-days, SWITCH saw none in 4 patients over 12 months, and neither can rule out rare harms.

The terms

TermPlain meaningWhere
Class I, II, IIILow, middle and greatest risk. Class III needs general controls plus premarket approval.Ch 1
IDEAn exemption that lets a sponsor test an unapproved device in people under rules in 21 CFR 812.Ch 1
Hazard, hazardous situation, harmA source of harm; the hazard meeting a person; the injury.Ch 2
Residual riskThe risk left after all controls, judged against the benefit.Ch 2
Single faultOne part fails while the rest works. It must not cause unacceptable risk.Ch 2
Safety class A, B, CNo injury possible; non-serious injury; death or serious injury (IEC 62304, public summaries).Ch 3
SOUPSoftware of unknown provenance: code you did not write, such as a framework.Ch 3
Verification, validationBuilt it right (against requirements); built the right thing (against real needs).Ch 4
DHF, traceability matrixThe design record; the table linking need, requirement, safeguard and test.Ch 4
Non-inferiority marginThe largest loss you accept, set before the data.Ch 5
Rule of threeZero events in n person-years allows a rate up to about 3 / n.Ch 6
PCCPA predetermined change control plan: planned model changes authorised in advance.Ch 5, 9

The numbers that matter

NumberWhat it isSource
14Adults with BrainGate devices, 2004 to 2021Rubin 2023
12,203Implant-days (17,927 array-days); mean 872 days per personRubin 2023
342 / 274 / 68All adverse events / unrelated (80.1%) / device-relatedRubin 2023
35 of 68Device-related events that were skin problems at the incision or pedestalRubin 2023
0Intracranial infections, explants for safety, or deaths related to the deviceRubin 2023
33.43Person-years; under 1% power to detect a doubling of intracranial infectionRubin 2023
5 / 4 / 12 moSWITCH: evaluated / analysed / follow-up, with no serious events, occlusion or migrationMitchell 2023
233 HzSWITCH mean signal bandwidth (SD 16 Hz)Mitchell 2023
May 2021FDA final guidance on implanted BCI devicesFDA
2 Feb 2026The QMSR takes effect, incorporating ISO 13485:2016 into 21 CFR 820FDA, via summaries
9 per 100 pyHighest rate still allowed after 33.4 person-years with no event (my arithmetic)Ch 6

A checklist before a change reaches a person

  1. Name the part you changed and list the hazards it can reach.
  2. Check each reached hazard still has safeguards, and each safeguard still has a test.
  3. Confirm the software item’s safety class has not risen.
  4. List every pinned third-party item that moved, and rerun its tests.
  5. For a model update, state the metric and margin before running the data.
  6. Run the paired interval on held-out sessions and compare its lower end with the margin.
  7. Run the bench: safeguards, fail-safe state on link loss, latency budget.
  8. Run the security scan and read the new findings.
  9. Have someone who did not write the change review the risk file.
  10. Write the change control record: what, why, which tests, who approved.

The core as code

Here is the whole chain as a short program: the impact of a change, the unwitnessed safeguards, the rule of three, and the ship decision. It reproduces the numbers in this lesson.

python
import math

# the toy system from the lesson: part -> hazard -> safeguard -> test
PART_HAZ = {"screen": [5], "decoder": [0, 1], "firmware": [0, 1, 2], "radio": [3, 4, 1]}
HAZ_CTL  = {0: [0, 1], 1: [7, 3], 2: [2, 3], 3: [4], 4: [5], 5: [6]}
CTL_TEST = {0: [0, 1], 1: [2], 2: [3, 4], 3: [5, 6], 4: [7, 8], 5: [9, 10], 6: [11], 7: [12]}

def impact(part):
    """Which hazards, safeguards and tests does a change to `part` reach?"""
    haz = set(PART_HAZ[part])
    ctl = {c for h in haz for c in HAZ_CTL[h]}
    tst = {t for c in ctl for t in CTL_TEST[c]}
    return haz, ctl, tst

def unwitnessed(kept_tests):
    """Safeguards whose every test was removed from the suite."""
    return [c for c, ts in CTL_TEST.items() if not set(ts) & set(kept_tests)]

def rule_of_three(person_years, events=0):
    """Exact one-sided 95% Poisson upper limit on the event rate."""
    upper = {0: 2.996, 1: 4.744, 2: 6.296, 3: 7.754}[events]
    return upper / person_years

T95 = {1: 12.706, 2: 4.303, 3: 3.182, 4: 2.776, 5: 2.571, 6: 2.447, 7: 2.365, 8: 2.306}

def gain_interval(diffs):
    """95% interval for the mean of paired per-session differences."""
    n = len(diffs); m = sum(diffs) / n
    s = math.sqrt(sum((d - m) ** 2 for d in diffs) / (n - 1))
    t = T95.get(n - 1, 1.96)
    h = t * s / math.sqrt(n)
    return m - h, m + h

def ship_decision(diffs, margin=1.0):
    lo, hi = gain_interval(diffs)
    if lo > 0:        return "ship: better"
    if lo > -margin:  return "ship: not worse"
    return "hold: not shown safe"


for p in PART_HAZ:
    h, c, t = impact(p); print(p, len(h), len(c), len(t))
print(unwitnessed(set(range(13)) - {12}))
print(round(rule_of_three(33.4), 3), round(rule_of_three(4), 3))
d = [3, 1, 4, -1, 2, 3, 0, 2]
print(gain_interval(d), ship_decision(d))

Run it and you get the lesson’s toy numbers: the firmware change reaches 3 hazards, 5 safeguards and 8 tests; removing the 13th test leaves safeguard 7 (the stop button) with no witness; 33.4 person-years gives a ceiling of 0.09 per person-year; and the eight-session example gives an interval of 0.35 to 3.15 and a ship decision.

Where this sits

Earlier lessons built the signal chain this one protects. The recording map shows what each sensor can see. Recording hardware explains the implant electronics whose safeguards we traced. Drift and recalibration, Measuring a BCI and Real-time closed loop cover the evidence and latency questions behind a model update. For general guardrails on learned systems, see AI safety guardrails and evaluation statistics.

Sources used

The takeaway. Safety in a BCI is a chain of records, each tied to the next: harm, hazard, safeguard, requirement, test, result. A change is safe to ship when you can walk that chain for every hazard it reaches, and when the trial numbers behind it are read with their exposure. A zero is a ceiling on the rate, not an absence of risk.
A team changes the spike threshold in implant firmware. What must it do before shipping?

Now press Present or Teach and explain the chain out loud, from memory: from a changed line of code to hazards, safeguards, tests and the change record, and what a zero in a trial can and cannot prove. Then go back to the instrument at the top, pick each change in turn, and explain why the numbers differ.

BCI Safety and Regulation
Read the BrainGate safety paper · Read the SWITCH paper · Back to Gleams