The "Ex Machina" sin is a plot device where an unsolvable problem is presented to the characters, but immediately resolved by someone or something coming out of nowhere and fixing it for them, usually saving their lives in the process. Often with the convenience and timing possible only through the magic of screenwriting.

It is always used with a prefix: "X" Ex Machina, e.g Gradus Ex Machina, the prefix referring to the plot device used.