The standard governing this is UL 1741 in the US or VDE-AR-N 4105 in the EU. both require certified inverters to detect grid loss and immediately cut off.
So these plug in batteries are only functioning as "time shift" of power usage, but not as a mechanism to go supply standby power to the house?
yeah, it’s called anti-islanding. UL 3700 is the thing to look at if you want to read more about some of the safety precautions