Lineage OS is the most popular and well-maintained custom ROM available out there. It also releases security patches as soon as Google releases patches for Android. The ROM is also open source, so I don’t have any reason to call it unsafe.