You can program the engine control to do what you would like regarding engine shutdowns for cause.
Of course that's not a good idea when you can't float without it.
Left to their own the engine will keep running (at least at idle) until the blade tips wear away or until the fuel system breaks down somehow.
I am aware of some newer engines today that having sensed an overspeed will latch the fuel control at idle (not withstanding the throttle position) and can only be reset by a restart. Other than that I can't think of a forced (no pilot involved) shutdown
I'm still confused by the question
Is it a historical question or a technical how-to question?