The main purpose of the Stop Dangerous Sanctuary Cities Act is to ensure that state and local law enforcement can work with federal officials to address issues related to violent criminals and suspected terrorists who are in the United States illegally. The legislation aims to enhance public safety by promoting cooperation between different levels of law enforcement. Key provisions of the Act include granting state and local law enforcement officers the authority to act as agents of the Department of Homeland Security when they comply with federal detainers.