When may drivers leave their vehicle unattended with the engine running?

It is illegal for any driver to permit their car to stand idling and unattended without turning off the engine, locking the ignition, removing the key from the ignition, and setting the brake. However, these requirements do not apply to a driver who starts the engine by using a remote starter or other similar device that remotely starts the engine without the key in the ignition.
DMV Writen Test