https://en.m.wikipedia.org/wiki/Posse_Comitatus_Act
There are a number of situations in which the Act does not apply. These include:
National Guard units, state defense forces, and naval militias[19] while under the authority of the governor of a state. However, when the National Guard is under federal control via 10 U.S.C. § 12406, that shifts control from the state governor to the President, making Guard operations subject to the Posse Comitatus Act as well.
Federal troops used in accordance to the Insurrection Act, which has been invoked 23 times, as of 1992.
Under 18 U.S.C. § 831, the Attorney General may request that the Secretary of Defense provide emergency assistance if domestic law enforcement is inadequate to address certain types of threats involving the release of nuclear materials, such as potential use of a nuclear or radiological weapon. Such assistance may be by any personnel under the authority of the Department of Defense, provided such assistance does not adversely affect U.S. military preparedness. The only exemption is the deployment of nuclear materials on the part of the United States Armed Forces.
Provide surveillance, intelligence gathering, observation, and equipment for domestic law enforcement on operations such as drug interdiction and counter-terrorism missions. For example, Delta Force soldiers from Fort Bragg were deployed upon request by the Federal Bureau of Investigation to serve as sniper/observer teams, run communications, provide medical support, gather intelligence, and conduct assistance in explosive breaching during the 1987 Atlanta prison riots.[20]
Exclusion applicable to U.S. Coast Guard
Edit
See also: Missions of the United States Coast Guard
Although it is an armed service,[21] the U.S. Coast Guard, which operates under the United States Department of Homeland Security during peacetime, is not restricted by the Posse Comitatus Act but has explicit authority to enforce federal law. This is true even when the Coast Guard is operating as a service within the United States Navy during wartime.[8]
In December 1981, the Military Cooperation with Civilian Law Enforcement Agencies Act was enacted clarifying permissible military assistance to domestic law enforcement agencies and the Coast Guard, especially in