Hi Barry
Our boat (Tringa No50) has a Firetrace automatic extinguisher that protects the main electrics and the engine compartment.
https://www.firetrace.co.uk . I don't know whether it is still the case but they used to supply "second user" systems.
Firetrace works on a pressurised plastic tube that bursts and releases fire suppressant if it gets too hot. The biggest problem on out boat was finding somewhere to mount the cylinder, it ended up behind the nav. instruments panel.
I guess there are several options for small automatic extinguishers which are designed to mount in the engine compartment.
Martin