In Meditation I, having doubted the senses and mathematical truths, Descartes pushes further. What if, rather than a good God, there exists an evil demon of supreme power and cunning who devotes all his efforts to deceiving Descartes? Under such a hypothesis, everything we believe might be false.
The evil demon is not a sincere metaphysical hypothesis — it is a logical device. By imagining the worst possible epistemic scenario, Descartes forces himself to find a belief so certain it survives even demonic deception. That belief turns out to be the cogito.
The demon argument also raises the question of whether God — even a non-deceptive God — could have created us as beings who are systematically mistaken. Descartes returns to this in Meditation III and IV, arguing that God's goodness guarantees the reliability of clear and distinct perception.
Hilary Putnam's brain-in-a-vat thought experiment is the modern descendant of Descartes's demon. Nick Bostrom's simulation argument is another variation. The demon has proved remarkably durable as a vehicle for sceptical argument.