Of course Oral exams immediately comes to mind as a solution. However, it is necessary to acknowledge that writing is a different process, and engages different parts of the brain. I am almost an incompetent speaker, yet I feel far more competent writing.
I suggest including extemporaneous essay questions as part of your assessment of your students. After all, despite the advent of AI, writing will remain an essential human skill going forward.
Edit: until Neuralink is common.