About 20 years ago, a student in one of my courses began missing classes. After several weeks, she appeared in my office and said that she had a history of major depression, had experienced a relapse and had been committed to the psychiatric ward of the local hospital. She had lost her motivation to do things, she said, and for several days her depression made even basic actions such as getting out of bed impossible. Verbatim, she said to me: ‘I did not have any free will.’

My student’s comment, and the fact that depression is caused by dysfunctional circuits in the brain, caused me to question the nature of free will itself. For millennia, philosophers have debated whether humans have free will, typically defined as the ability to choose between alternative possibilities. The main threat to free will was ‘causal determinism’ – the thesis that natural laws and past events entail only one path from present to future. This means that any action one performs at any given time is the only one possible.

Some philosophers maintain that free will is incompatible with causal determinism, which by definition allows only one possibility – in essence, it assigns our life trajectories in advance. Others argue that we don’t need alternative possibilities for free will but only the desires and intentions that actually guide what we decide to do.

Yet my student made me think that the debate could be reframed. Free will might have nothing to do with the universe outside and everything to do with how the brain enables or disables our behaviour and thoughts. What if free will relies on the internal, on how successfully the brain generates and sustains the physiological, cognitive and emotional dimensions of our bodies and minds – and has nothing to do with the external at all?

The best way to study free will, I posited, might be through neurological and psychiatric disorders resulting from dysfunction in neural circuits regulating movement, cognition and mood. Patients with Parkinson’s disease experience uncontrollable tremors or equally debilitating rigidity. For those with obsessive-compulsive disorder (OCD), intrusive thoughts and repetitive behaviour seem impossible to suppress. Major depression can dull motivation and destroy the capacity for pleasure. Damage to the region of the brain regulating memory formation can limit the capacity to recall experiences and project oneself into the future. Other traumatic brain injuries undermine free will by causing extensive paralysis and the inability to communicate. If we think of free will as the ability to plan and act without mental or physical compulsion or constraint, then these brain disorders represent a spectrum in which free will is mildly to completely impaired.

By repairing the damage, free will could be restored (and our understanding of it deepened along the way). And thanks to emerging technology, some repairs are already here and others could soon be available in the form of neural prostheses – brain implants capable of modulating, replacing or bypassing damaged and dysfunctional neural circuits. These devices might restore to the afflicted control of their minds and bodies and, in essence, allow them to reclaim their freedom of will.

The most obvious prosthetic technique is deep brain stimulation (DBS), a literal pacemaker for the brain. In DBS, electrodes are implanted in dysfunctional neural circuits and connected by wires to a battery-powered pulse generator lying under the collarbone. Activating the electrodes and stimulating different regions of the brain can modulate over- and underactive circuits, restoring the brain’s function.

DBS acts as both a probe and modulator of neural circuits. While implanting electrodes and adjusting the level of current they deliver, neurosurgeons can observe patients’ responses to stimulation in real time. Stimulating the right circuits at the right frequency can modulate and restore them to normal function.

Many Parkinson’s patients report relief from tremors or rigidity and restoration of bodily control as soon the electrodes in the area regulating motor functions are activated. A Toronto-based study published in 2008 showed that DBS helped 60 per cent of patients who had failed other treatments for major depression. ‘The pain, fear, anxiety and depression are pretty much completely gone, and I am now a very happy, healthy, working, active, fulfilled and grateful individual,’ one of the Toronto patients said that year in an interview with CBS News.

DBS has helped reduce the intrusive thoughts of OCD. A German patient suffering with the diagnosis for two decades said she ‘would have committed suicide’ without DBS. Instead, her wilful desires, not the intrusions of a broken brain circuitry, now control what she does and says.

When the hippocampus is damaged, it could be replaced by a chip implanted in the same region of the brain

DBS has also successfully intervened in one of the most devastating impediments to free will – Alzheimer’s disease. Researchers used the technique in early-stage Alzheimer’s patients to stimulate the fornix, which is connected to the hippocampus and helps regulate the way memory is formed and stored. They found that 12 months of continuous stimulation of the fornix increased glucose metabolism, a key indicator of neural activity in the brain. One Alzheimer’s patient with the device implanted in his brain in a 2008 University of Toronto study has maintained most of his cognitive and motor functions to date. In patients with epilepsy, stimulation of the entorhinal cortex, also connected to the hippocampus, has already enhanced memory and could be used for Alzheimer’s as well.

DBS is hardly alone. More advanced implants promise an enhancement of free will, too. Take the hippocampal prosthesis (HP). A sea-horse-shaped structure deep inside the brain’s temporal lobe, the hippocampus controls the formation, consolidation and short-term storage of memory. When part or all of the hippocampus is damaged or removed via brain injury or neurosurgery, it could be replaced by the HP, a chip designed to function like a natural hippocampus and implanted in the same region of the brain. Although it has been used only in animal models so far, a human HP could restore the capacity for memory by taking sensory information from the world and converting it into new memories. These memories could be stored and retrieved for planning and acting in the present and future. HP could be ready for implantation in the human brain in the next five to 10 years.

The paralysed, meanwhile, could recover free will through the brain-computer interface (BCI), a technology that translates mental intentions into actions in the physical world. In its crudest application, a BCI user can execute a plan by communicating literal thoughts about movements generated in the brain’s motor cortex to adjacent electrodes implanted in this region or applied atop the skull. The electrodes, in turn, signal a computer that runs a mechanical device. The most advanced BCI consists of a microelectrode array implanted in the motor cortex itself, with signals transmitted to computer by radio or Wi-Fi, eliminating the need for any wires at all. By turning wishes and intentions into agency, free will is restored.

BCI combined with brain-imaging technology could even restore free will to the minimally conscious or ‘locked-in’ – brain-injured patients who are aware of events but are too impaired to give any outward sign. At the moment, these patients have no say over their lives – not even whether they want artificial hydration and respiration, or any extraordinary interventions to keep them alive. Yet with the new technologies we could ask them and record the activity in brain regions controlling language and thought, giving such patients choice over their own life and death.

Could neural prosthetics enhance free will in people without brain injury or neuropsychiatric disease? Could they bequeath stronger resolve and more self-control to the indecisive or impulsive, providing a boost for staying on task or making a stronger stand? Stimulating a circuit in the prefrontal cortex, the executive centre of the brain, might enhance the capacity to respond to reasons for or against certain actions and cause one to act more decisively and prudently in executing intentions.

But free will enhancement for neuronormals is some way off because the healthy brain is so subtly balanced, and the technology still so crude. Implant risks include bleeding and infection, along with the potential to affect the wrong area of the brain. For instance, when stimulation reached beyond the motor area of the brain in some Parkinson’s patients, they became impulsive and developed behaviour such as hypersexuality and gambling. Others have experienced mood disturbances in the form of mania or hypomania. Some effects are more benign but no less surprising. One Dutch man receiving DBS for OCD told The Guardian this May that he developed a sudden love for the music of Johnny Cash. In another case, a patient with combined depression and anxiety reported that he felt better after undergoing several experimental sessions of DBS. He then asked his psychiatrist and neurosurgeon to increase the electrical current of the stimulator so that he could feel ‘a bit happier’. This resulted in a euphoric state in which he felt ‘unrealistically good’ and ‘overwhelmed’ by the sensation of happiness.

Overstimulating targeted brain circuits, or stimulating the wrong circuits, can result in compulsive or manic behaviour that impairs the capacity to reason and act in one’s best interests. It can undermine the will and be just as disabling as the disorder the technique is designed to treat. Such findings suggest optimal levels of cognition and emotion, and an ideal range for the brain processes sustaining them. Stimulating the brain above these levels could actually undermine will, making people less responsive to reason, less flexible in their behaviour and less able to adapt to the demands of the environment.

So the technology comes with a host of ethical concerns. If free will could be safely enhanced, would those with strengthened capacities be held to a higher standard? These high expectations might be fair if the enhanced capacities were the result of a voluntary decision, not medical need.

DBS does not replace the person as the agent. Instead, it is an enabling device

And even in the case of medical necessity, issues of responsibility abound. Consider a patient with an injured hippocampus who has a brain implant to compensate for memory loss. Suppose this patient leaves his infant in an unventilated car on a hot day. Did the device malfunction, preventing him from remembering his child? Or did he form a memory of his action but was distracted by other information? Forgetting might be a way of preventing the brain from becoming overloaded by too much information, which impairs reasoning and decision-making. Still, given the risk of death to the child, one would expect more of the parent’s memory retrieval. If it could be shown that the prosthesis malfunctioned – perhaps generating illusory images, such as a family picnic or vacation – would the parent be excused from charges of criminal negligence or would he still be held accountable for poor monitoring of his device?

Another pressing question: do these devices really restore free will or do they actually take it away? One concern about all neural prostheses is that they seem to replace the person as the real agent and source of their mental states and actions. One depression patient participating in a 2008 University of Toronto study had responded well to DBS, but experienced a return of his symptoms after a battery in the pulse generator ran out. ‘I’m just happy it wasn’t me, that it was the battery,’ he remarked. This is a misunderstanding: it was not the malfunctioning pulse generator but faulty circuits in his brain that were causing his depression. Understandably, his comment reflected a desire to believe that he and not the device was in control of his mood and actions. Yet the fact is that DBS does not replace the person as the agent. Instead, it is an enabling device whose modulating effects on dysfunctional brain circuits return this control to him. It does not matter whether our mental states and actions are generated and sustained by a natural or an artificial system such as DBS, HP or BCI. Provided that these systems connect in the right way with neural inputs and outputs that regulate our minds and bodies, they can ensure that the person in whom they are implanted is in control.

Once free will prostheses become commonplace, we might need to rethink the meaning of free will itself. We might just conclude that free will does not depend on the universe or an immaterial soul but on the extent to which the brain enables or disables our ability to think and act. We should not conceive of free will in terms of whether laws of nature and events in the past allow us room to act, but in functional terms – as acting according to our desires, beliefs, reasons and intentions. We are more than just material beings. But the capacity to choose and act freely depends on how the brain generates and sustains the mind. For those whose brains are fractured by injury or disease, neural prostheses can help undertake and complete projects to realise their humanity in a rich variety of ways.